Posts

Showing posts with the label UIKit

Add "Parallax Effect" to your UIView by this One Line Code

Would you like to add " Parallax Effect" to your UIView ? Just add this UIView category to your project and import it in any of your classes and apply like this to your code through a simple one line code : [self.view addParallaxEffect]; Also, keep in touch for more Categories  coming on the way.

UIKit Dynamics Overview

Yes, now you can have all your UI objects to behave like how objects in a physics environment behave. You can have physics concepts like Gravity, Collisions, springs etc..  added to the UI Objects. Apple updated the UIKit framework (which contains almost all the iOS UI Elements) such that any physics behavior could be added to the UIKit Elements/Objects. Hence,  2d physics engine lies just underneath the UIKit to simulate the real world objects. In order to use UIKit Dynamics, we use " UIDynamicBehavior " to apply different behaviors to objects, which binds to the " UIDynamicItem " protocol, UIView does this already for you, hence any subclass of UIView just works with this. You can even create your own objects binding to the above protocol. After setting/applying all the physics behaviors to the objects that we needed to have, we can provide them to the " UIDynamicAnimator " - think this as the controller of UIKit Dynamics, which handles/calculate...