Rightpoint/Swiftilities

Animates creation of view

dostrander opened this issue · 3 comments

If you have a textview/textfield trying to get become the first responder on presentation of the view controller, the whole view will animate the creation of the view.

This is an example of what happens on app launch with a bunch of random views on screen.

animation

It has to do with this line in the keyboard class:
https://github.com/Raizlabs/Swiftilities/blob/develop/Pod/Classes/Keyboard/Keyboard.swift#L109

Not sure what the best solution to this is, maybe checking to see if the UIViewController has been presented:
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIViewController_Class/#//apple_ref/occ/instm/UIViewController/isBeingPresented

However whether or not it animates is based on the Keyboard class and not the view controller, so that would take a little finagling to get right.

The reason why the centered views are not moving is because they are center justified. However, the ones that are pinned to the sides are animating because on view creation it is 600x600 in a xib and 0x0 in code and will shrink/grow based on view size.

Hey @ateliercw -- didn't you find an easy fix for this?

I think it may need fiddling in the view or view controller being presented, probably with forcing a non-animated layout pass when the view is added to a superview