uiviewanimation

UIView Animation on multiple UIImageViews in ARC

不羁岁月 提交于 2019-12-02 20:52:31
问题 I have an animation in my app that grows a UIImageView and then shrinks it (really two animations). Throughout the app this may happen on several different UIImageViews. I found a way to do this that worked really well, but it now doesn't seem to be compatible with Automatic Reference Counting. Here is my code: [UIView beginAnimations:@"growImage" context:imageName]; [UIView setAnimationDuration:0.5f]; [UIView setAnimationCurve:UIViewAnimationCurveEaseIn]; [UIView setAnimationDelegate:self];

Animated curve line in Swift 3

给你一囗甜甜゛ 提交于 2019-12-02 18:55:47
I want to draw some bezier lines and I want to animate them with a wave effect, Example Do you have some ideas about how I can do this ? Bezier line is it the best method to do it ? I found only 2 libs for this, but they are not really useful for what I need, I try to modify the code of one lib, unfortunately without success https://github.com/yourtion/YXWaveView I found this lib, https://antiguab.github.io/bafluidview/ which does the work, but it written in obj-c, maybe you know something like this in swift You can use a display link , a special kind of timer optimized for screen refresh

How to animate UIImageViews like hatch doors opening

£可爱£侵袭症+ 提交于 2019-12-02 17:33:25
I'm trying to create an animation that would look like 2 french doors (or 2 hatch doors) opening towards the user. I tried using the built in UIViewAnimationOptionTransitionFlipFromRight transition, but the origin of the transition seems to be the center of the UIImageView rather than the left edge. Basically I have 2 UIImageViews that each fill have the screen. I would like the animation to look like the UIImageViews are lifting from the center of the screen to the edges. [UIView transitionWithView:leftView duration:1.0 options:UIViewAnimationOptionTransitionFlipFromRight animations:^ {

UIView animation options using Swift

寵の児 提交于 2019-12-02 17:02:09
How do I set the UIViewAnimationOptions to .Repeat in an UIView animation block: UIView.animateWithDuration(0.2, delay:0.2 , options: UIViewAnimationOptions, animations: (() -> Void), completion: (Bool) -> Void)?) Swift 3 Pretty much the same as before: UIView.animate(withDuration: 0.2, delay: 0.2, options: UIViewAnimationOptions.repeat, animations: {}, completion: nil) except that you can leave out the full type: UIView.animate(withDuration: 0.2, delay: 0.2, options: .repeat, animations: {}, completion: nil) and you can still combine options: UIView.animate(withDuration: 0.2, delay: 0.2,

How to animate the width and height of a UIView in Xcode?

耗尽温柔 提交于 2019-12-02 16:19:30
I have this subview I want to add to my main view, but make it expand from the origin. I read some of the Apple documentation but I don't understand where I am making mistake. I can animate the origin of the frame, i.e. to get it slide in from wherever, but the width/height doesn't seem to animate. Code as follows: [UIView beginAnimations:@"animateAddContentView" context:nil]; [UIView setAnimationDuration:0.4]; customView.frame= CGRectMake(self.view.frame.origin.x +5, self.view.frame.origin.y +5, 0, 150); [self.view addSubview:customView]; customView.frame= CGRectMake(self.view.frame.origin.x

How to programmatically add a search bar to a UITableView header?

喜欢而已 提交于 2019-12-02 12:23:38
How would i go about programmatically adding a search bar into a uitableview header? Specifically i have a bar button item that when it's pressed i would like to animate in a search bar into the table view header and when the cancel button is pressed it will animate back out of the view and the header scales back to normal. Would this be possible? Thanks. It's based on Swift 2 but It's not very diff to swift 3 Add search delegate to view controller: UISearchResultsUpdating Make a search: let searchController = UISearchController(searchResultsController: nil) Set this default values for

iOS UIView Animation Issue

杀马特。学长 韩版系。学妹 提交于 2019-12-02 07:28:34
I have an issue with a UIView animation when switching between pages in a UITabBarController. A view in UIViewControllerA is playing the following animation:- [UIView animateWithDuration:1.0 delay:0.0 options:UIViewAnimationOptionRepeat | UIViewAnimationOptionCurveLinear | UIViewAnimationOptionBeginFromCurrentState animations:^{ CGAffineTransform transform = CGAffineTransformMakeRotation(M_PI); self.animationImageView.transform = transform; } completion:NULL]; The animation is a custom loading wheel which stops when a song has been loaded. If I switch between pages, i.e. from UIViewControllerA

Animate `backgroundColor` of a `UIView` that implements `drawRect`

喜你入骨 提交于 2019-12-01 15:34:29
问题 I have a custom UIView and I would like to animate its backgroundColor property. This is an animatable property of a UIView . This is the code: class ETTimerUIView: UIView { required init(coder aDecoder: NSCoder) { super.init(coder: aDecoder) } // other methods func flashBg() { UIView.animateWithDuration( 1.0, animations: { self.backgroundColor = UIColor.colorYellow() }) } override func drawRect() { // Something related to a timer I'm rendering } This code causes causes the animation to skip

iOS UIView Animation CATransform3DMakeRotation confusion

和自甴很熟 提交于 2019-12-01 11:19:41
I have a UIView that I am trying to animate flipping down, while having its axis at the bottom of the view. E.g.: To do this, I am trying to use a UIView animation: [UIView animateWithDuration:3 delay:0 options:UIViewAnimationCurveEaseOut animations:^{ // Flip Down top3.layer.anchorPoint = CGPointMake(0.5, 1.0); top3.layer.transform = CATransform3DMakeRotation(M_PI, 1, 0, 0); } completion:^(BOOL finished) { // Reset? //top3.transform = CGAffineTransformMakeScale(1, 1); }]; Right now it isn't working how I want, it seems like the view is animating AWAY from the user rather then toward. It does

flip animation in swift flips whole view not subviews

亡梦爱人 提交于 2019-12-01 00:41:11
I need to switch between two subviews, for that I am using flip animation, but it flips whole screen not subview. Here is the code I used to flip: UIView.transitionFromView(frontView, toView: backView, duration: 1, options: UIViewAnimationOptions.TransitionFlipFromRight | UIViewAnimationOptions.ShowHideTransitionViews, completion: nil) I have created frontView and backView in StoryBoard, and backView hidden initially. Please help me too flip only the subviews. This question is old, but it can help someone. If you want to flip your self.view use it: UIView.transitionWithView(self.view, duration