Swift – Push UIView animation

Simple code snippet today that show how to push a UIView and obtain the same effect of a UINavigationController as push action, choosing also the side (.fromLeft / .fromRight).

We can do this using the CATransitionanimations. Very simple:

func push( view: UIView, side: CATransitionSubtype = .fromRight ) {
    let transition = CATransition()
    transition.type = CATransitionType.push
    transition.subtype = side

    self.layer.add(transition, forKey: nil)
    self.addSubview(view)
}

Enjoy pushing!

 

Objective-C – UIStoryboard segue custom transition

UIStoryboardSegue object is responsible for performing the visual transition between two view controllers. In addition, segue objects are used to prepare for the transition from one view controller to another. Segue objects contain information about the view controllers involved in a transition. When a segue is triggered, but before the visual transition occurs, the storyboard runtime calls the current view controller’s prepareForSegue:sender: method so that it can pass any needed data to the view controller that is about to be displayed.

Read More
 

Objectivec – 3D View Rotation

Today, how to make a 3d rotation using two UIView.

Problem

I want to rotate my view in 3d perspective, but after animation, buttons not responds to touch events.
This happens because after a 3d trasform, the point of view is different, and the frame go out for a walk…

Read More