core-animation

Layer-backed OpenGLView redraws only if window is resized

只谈情不闲聊 提交于 2019-12-04 08:09:56
问题 I have a window with a main view of type NSView and a subview which is a subclass of NSOpenGLView whose name is CustomOpenGLView . The subclass of NSOpenGLView is obtained through a Custom View in Interface Builder and by setting its class to CustomOpenGLView . This is made according to the Apple Sample Code Layer Backed OpenGLView. The app is made to draw something to the OpenGLContext every, let's say, 0.05 seconds. With Core Animation Layer disabled I am able to see the moving object in

What does “Receiver type 'CALayer' for instance message is a forward declaration” mean here?

强颜欢笑 提交于 2019-12-04 07:46:22
问题 I'm porting a block of code from an iOS4 project to iOS5 and I'm having some troubles with ARC. The code generates a PDF from a screen capture. PDF Generation Code UIView *captureView; ... NSMutableData *pdfData = [NSMutableData data]; UIGraphicsBeginPDFContextToData(pdfData, captureView.bounds, nil); UIGraphicsBeginPDFPage(); CGContextRef pdfContext = UIGraphicsGetCurrentContext(); [captureView.layer renderInContext:pdfContext]; UIGraphicsEndPDFContext(); The renderInContext line

Rotate in z-axis like core-animation slot machine

三世轮回 提交于 2019-12-04 07:41:31
I was to able to move or animate my UIView by this code down here: - (void) makeAnim1{ //downward animation [UIView animateWithDuration:1.5 delay:0.15 options: UIViewAnimationCurveLinear animations:^{ carousel.frame = CGRectOffset(carousel.frame, 0, 650); } completion:^(BOOL finished){ //task after an animation ends [self performSelector:@selector(makeAnim1_1) withObject:nil afterDelay:2.0]; NSLog(@"Done!"); }]; } - (void) makeAnim1_1{ //upward animation [UIView animateWithDuration:1.5 delay:0.1 options: UIViewAnimationCurveLinear animations:^{ carousel.frame = CGRectOffset(carousel.frame, 0,

Are there any third-party libraries to do cool view transitions in iPhone OS?

纵饮孤独 提交于 2019-12-04 07:37:35
问题 I don't really like that flip-transition. It's boring. I'd like to see something cool, like water effect, fog, or whatever. Is there something available or do I have to (re)invent the wheel for that? 回答1: The animation types available via [CATransition animation] are: kCATransitionFade kCATransitionPush kCATransitionMoveIn kCATransitionReveal @"suckEffect" @"spewEffect" @"genieEffect" @"unGenieEffect" @"rippleEffect" @"twist" @"tubey" @"swirl" @"charminUltra" @"zoomyIn" @"zoomyOut" The

How to animate a human written stroke using Swift/iOS?

强颜欢笑 提交于 2019-12-04 07:33:25
问题 Objective I am attempting to create an animated approximation of human writing, using a UIBezierPath generated from a glyph. I understand and I have read the many UIBezierPath questions which sound similar to mine (but are not the same). My goal is to create an animation that approximates the look of a human performing the writing of characters and letters. Background I've created a playground that I am using to better understand paths for use in animating glyphs as if they were drawn by hand

Move CALayer via UIBezierPath

好久不见. 提交于 2019-12-04 07:32:56
I have a layer that will move from point A to point B on a UIBezierPath. I have found a lot of samples those are refers to CAAnimation and UIBezierPath. But I need to move my layer only from specified point to another on bezier path. Any suggestions would be appreciated. Thanks Hope this will be helpful. UIBezierPath *trackPath = [UIBezierPath bezierPath]; . . . CAKeyframeAnimation *anim = [CAKeyframeAnimation animationWithKeyPath:@"position"]; anim.path = trackPath.CGPath; anim.repeatCount = 1; anim.duration = 2.0; [layerToAnimate addAnimation:anim forKey:@"pathGuide"]; If your bezier path is

How to reuse the same code for different components created dynamically?

ぃ、小莉子 提交于 2019-12-04 06:59:31
问题 I have a post button in my page on click of it I get a fish <div> component which moves randomly. I want to create a generic code so that many fishes which are created on click of post button move randomly using a generic code so that the efficiency increases. Can you please help me in developing a code to animate my fish dynamically for multiple fishes. Reuseable code is what I'm looking for. <section class="main-content" id="container"> <input type="button" value="Post" class="post-button"

Animations disappear in iOS application after some time

此生再无相见时 提交于 2019-12-04 06:58:43
After several minutes running all animations in my application disappeared, even system animations like alert animation and UINavigationController animations. What can be the issue? P.S. I dont use [UIView setAnimationsEnabled] anywhere. Well, the answer is - system sometimes disables animations, and, normally, it enables them back on. But in my case, for some reason, it failed to set them back enabled. And this happens only during transitions between UIViewControllers. What I came up with, is to reset [UIView setAnimationsEnabled:YES] after every transition. 来源: https://stackoverflow.com

Recommended objective-c Math libraries for working with Quaternions Matrices Vectors etc

天大地大妈咪最大 提交于 2019-12-04 06:56:12
I'm looking for a good Math library in objective-c that does your usual Matrix Vector and Quaternion tasks for use in conjunction with Core Animation. The library needs to be free for commercial use. Thanks! Eigen is a lightweight C++ linear algebra package which provides could matrix, vector and quaternion support. While I have not used it in anger, it seems to have a much nicer interface than BLAS/LAPACK and supports a bunch of things those libraries don't Current versions of iOS include the Accelerate Framework , which includes a large set of accelerated matrix math routines (BLAS, LAPACK,

Stop and start an animation by touch. Objective C

非 Y 不嫁゛ 提交于 2019-12-04 06:55:13
I have made an animation that moves across the screen, my animation loops continuously. How can I stop the animation when you tap the animated image, Then let the animation continue when you lift the touch? I know how to use TouchesMoved to move a specified button like this: CGPoint point = [[[event allTouches] anyObject] locationInView:self.view]; UIControl *control = sender; control.center = point; But getting it to work with my animation. I would like the animation to continue after I touch it. SelectedCellViewController.h // SelectedCellViewController.h #import <Accounts/Accounts.h>