uianimation

How can I callback as a CABasicAnimation is animating?

房东的猫 提交于 2019-12-02 08:43:17
I have an animation I'm using to snap a rotatable UIView to a circular grid. As the view animates, I need to update another view based on the rotating views position. How can I go about getting the position of the rotating view as it animates into position? When animation starts you can start a function that will be polling current view position using a timer (I suppose you will need to get presentationLayer from view's layer and get position values from it). There's no callbacks for CAAnimation other than animationDidStart and animationDidStop so it seems that's the solution (if I'm not

UIPageViewController: Fade In/Out Animation Between Viewcontrollers?

左心房为你撑大大i 提交于 2019-12-02 06:34:37
问题 I followed the tutorial over @ http://www.appcoda.com/uipageviewcontroller-storyboard-tutorial/ to implement a UIPageViewController. I need to make the transition between view controllers to fade in/out when the user scrolls between them. An example of an app that does this is over here https://itunes.apple.com/us/app/tapiture/id645402534?mt=8 回答1: Use the delegate pageViewController:willTransitionToViewControllers: . This is called as the gesture begins. You know what the old view controller

UIPageViewController: Fade In/Out Animation Between Viewcontrollers?

拥有回忆 提交于 2019-12-02 03:16:24
I followed the tutorial over @ http://www.appcoda.com/uipageviewcontroller-storyboard-tutorial/ to implement a UIPageViewController. I need to make the transition between view controllers to fade in/out when the user scrolls between them. An example of an app that does this is over here https://itunes.apple.com/us/app/tapiture/id645402534?mt=8 Use the delegate pageViewController:willTransitionToViewControllers: . This is called as the gesture begins. You know what the old view controller is because it's already there. You know what the new view controller is because this message tells you.

how to to make gesturerecognizer working in an animating UIImage view

*爱你&永不变心* 提交于 2019-12-01 21:44:04
问题 i have 5 animating image in a image view and will like to allow user to tap on them base on the default ID and push it to another view. i tried to add in gesture tap but the imageview are not detecting. can anybody give me some advise ? EDIT: end up i did not use it, i set a UIButton instead. thank you :) viewDidLoad self.defaultID = [[NSMutableArray alloc] initWithObjects:@"7",@"9",@"11",@"27",@"6",nil]; self.defaultImageCaption = [[NSMutableArray alloc] initWithObjects:@"Ver",@"Green",@"Red

how to to make gesturerecognizer working in an animating UIImage view

我是研究僧i 提交于 2019-12-01 19:03:06
i have 5 animating image in a image view and will like to allow user to tap on them base on the default ID and push it to another view. i tried to add in gesture tap but the imageview are not detecting. can anybody give me some advise ? EDIT: end up i did not use it, i set a UIButton instead. thank you :) viewDidLoad self.defaultID = [[NSMutableArray alloc] initWithObjects:@"7",@"9",@"11",@"27",@"6",nil]; self.defaultImageCaption = [[NSMutableArray alloc] initWithObjects:@"Ver",@"Green",@"Red",@"CF",@"Dwarf",nil]; //default image imageViewTop.alpha = 1.0; imageViewBottom.alpha = 0.0;

Animations not working in ios playground

荒凉一梦 提交于 2019-12-01 06:25:52
This is my animation method (PreloaderView.swift) public func performAction(action: PreloaderAction) { let highOpacity = CABasicAnimation.init(keyPath: "opacity") let middleOpacity = CABasicAnimation.init(keyPath: "opacity") let lowOpacity = CABasicAnimation.init(keyPath: "opacity") if action == .PreloaderActionNone { self.thirdShape.removeAllAnimations() self.firstShape.opacity = 0.3; self.secondShape.opacity = 0.5 self.thirdShape.opacity = 1.0 } else if action == .PreloaderActionFailure { UIView.animateWithDuration(2, animations: { self.thirdShape.strokeColor = UIColor.redColor().CGColor })

Animations not working in ios playground

孤者浪人 提交于 2019-12-01 05:19:56
问题 This is my animation method (PreloaderView.swift) public func performAction(action: PreloaderAction) { let highOpacity = CABasicAnimation.init(keyPath: "opacity") let middleOpacity = CABasicAnimation.init(keyPath: "opacity") let lowOpacity = CABasicAnimation.init(keyPath: "opacity") if action == .PreloaderActionNone { self.thirdShape.removeAllAnimations() self.firstShape.opacity = 0.3; self.secondShape.opacity = 0.5 self.thirdShape.opacity = 1.0 } else if action == .PreloaderActionFailure {

Nested closures does not like argument list

喜夏-厌秋 提交于 2019-11-30 08:16:18
问题 A UIView needs to change a warning label depending on the completion handler of a custom control: voucherInputView.completionHandler = {[weak self] (success: Bool) -> Void in self?.proceedButton.enabled = success self?.warningLabel.alpha = 1.0 if success { self?.warningLabel.text = "Code you entered is correct" self?.warningLabel.backgroundColor = UIColor.greenColor() } else { self?.warningLabel.text = "Code you entered is incorrect" self?.warningLabel.backgroundColor = UIColor.orangeColor()

Problems with transitionWithView and animateWithDuration

早过忘川 提交于 2019-11-30 05:21:41
I have problems with transitionWithView and animateWithDuration . One of my animateWithDuration blocks doesn't transition, it is a sudden change, and transitionWithView does not temporarily disable user interaction. I have checked the docs and believe I am doing everything correctly, but obviously something is wrong. Here are the two blocks of code: This is in my main View Controller ViewController which has three container views/child view controllers. This block moves one of the container views, but does not block the user from other interactions in ViewController while the transition is

Nested closures does not like argument list

风格不统一 提交于 2019-11-29 06:20:49
A UIView needs to change a warning label depending on the completion handler of a custom control: voucherInputView.completionHandler = {[weak self] (success: Bool) -> Void in self?.proceedButton.enabled = success self?.warningLabel.alpha = 1.0 if success { self?.warningLabel.text = "Code you entered is correct" self?.warningLabel.backgroundColor = UIColor.greenColor() } else { self?.warningLabel.text = "Code you entered is incorrect" self?.warningLabel.backgroundColor = UIColor.orangeColor() } UIView.animateWithDuration(NSTimeInterval(1.0), animations:{ ()-> Void in self?.warningLabel.alpha =