uiviewanimation

UIView.animateWithDuration Not Animating Swift (again)

我与影子孤独终老i 提交于 2020-08-02 06:03:47
问题 Note: I’ve already checked the following stack overflow issues: 27907570, 32229252, 26118141, 31604300 All I am trying to do is fade animate in a view (by alpha) when called by an IBAction attached to a button. Then reverse when a button on the view is hit. My wrinkle may be that I'm using a secondary view that is on the ViewDock in the storyboard View. The view is added to the subview at the time of viewDidLoad where the frame/bounds are set to the same as the superview (for a full layover)

UIImagePickerController how to do animated switch from rear to front camera?

旧巷老猫 提交于 2020-06-10 07:27:49
问题 I have been using custom overlay for UIImagePickerController controller, and everything is working fine. I have added button to switch between front and rear camera via - - (IBAction)changeCamera:(id)sender { if (self.imagePicker.cameraDevice == UIImagePickerControllerCameraDeviceRear) { self.imagePicker.cameraDevice = UIImagePickerControllerCameraDeviceFront; } else { self.imagePicker.cameraDevice = UIImagePickerControllerCameraDeviceRear; } } Problem is, switch is not animated. I have been

UIView Animation and UIButton stop working b/c Home pressed - Swift 4

被刻印的时光 ゝ 提交于 2020-01-26 03:58:44
问题 I have a playButton that performs a "breathing animation". The button works just fine when I press it. The problem occurs if I press the device's Home Button and then re-open the app. Upon re-opening, the playButton does not have the "breathing animation" and it does not work (nothing happens when it is pressed). @IBOutlet weak var playButton: UIButton! override func viewWillAppear(_ animated: Bool) { UIView.animate(withDuration: 1.0, delay: 0, options: [.autoreverse, .repeat,

iOS 13 CATransform3D issues

為{幸葍}努か 提交于 2020-01-25 06:49:09
问题 Prior to the release of iOS 13, I had had some CATransform3D code inside a UIView.animate block. In iOS 12, the result of the transformation animation looked like this: https://youtu.be/mfIzjjlKOBM. In iOS 13, the same transformation code now gives this result: https://youtu.be/hQdyGactIfA. As you can see in iOS 13 the animation is no longer a fluid cube movement like it is in iOS 12. Here's my basic code: UIView.animate(withDuration: duration, delay: 0, options: .curveEaseOut, animations: {

Move a View into Another view on button click in Swift iOS

人走茶凉 提交于 2020-01-16 07:18:19
问题 I am stumbled upon an issue in an application that i am making. I need to place one view into another view programmatically on button click. Now i need to move View 1 to the centre of View 2 on a button click with an animation. I tried to reposition the View1 to View 2 but i am not able to do it properly. This is the Final result that i am trying to achieve. CODE FOR CREATING THE RED VIEW My.cellSnapshot = snapshopOfCell(cell) var center = cell.center My.cellSnapshot!.center = center My

How to stop UIView Animation when needed?

非 Y 不嫁゛ 提交于 2020-01-15 05:24:29
问题 I have this Code: -(void)animationLoop{ CGPoint oldPoint = CGPointMake(myCircleUIView.frame.origin.x, myCircleUIView.frame.origin.y); [UIView animateWithDuration:1.0 animations: ^{ myCircleUIView.frame = CGRectMake(myCircleUIView.frame.origin.x + [self randomFloatingGenerator], myCircleUIView.frame.origin.y + [self randomFloatingGenerator], myCircleUIView.frame.size.width, myCircleUIView.frame.size.height); } completion: ^(BOOL finished) { [UIView animateWithDuration:1.0 animations:^{

How do you animate the sublayers of the layer of a UIView during a UIView animation?

不打扰是莪最后的温柔 提交于 2020-01-09 18:23:25
问题 In a UIView animation for a view, you can animate its subviews being laid out by including UIViewAnimationOptionLayoutSubviews in the options parameter of [UIView animateWithDuration:delay:options:animations:completion:] . However, I cannot find a way to animate it laying out its sublayers when they are not some view's backing layer; they would just jump into place to match the new bounds of the view. Since I'm working with layers and not views, it seems like I have to use Core Animation

Test whether a UIView is in the middle of animation

﹥>﹥吖頭↗ 提交于 2020-01-08 21:39:50
问题 Is there any way to tell if a UIView is in the middle of an animation? When I print out the view object while it is moving I notice that there is an "animations" entry: search bar should end editing: <UISearchBar: 0x2e6240; frame = (0 0; 320 88); text = ''; autoresize = W+BM; animations = { position=<CABasicAnimation: 0x6a69c40>; bounds=<CABasicAnimation: 0x6a6d4d0>; }; layer = <CALayer: 0x2e6e00>> When the animation has stopped and I print the view, the "animations" entry is now gone: search

Test whether a UIView is in the middle of animation

喜夏-厌秋 提交于 2020-01-08 21:39:24
问题 Is there any way to tell if a UIView is in the middle of an animation? When I print out the view object while it is moving I notice that there is an "animations" entry: search bar should end editing: <UISearchBar: 0x2e6240; frame = (0 0; 320 88); text = ''; autoresize = W+BM; animations = { position=<CABasicAnimation: 0x6a69c40>; bounds=<CABasicAnimation: 0x6a6d4d0>; }; layer = <CALayer: 0x2e6e00>> When the animation has stopped and I print the view, the "animations" entry is now gone: search