Jean-Benoist
Jean-Benoist

Reputation: 11

How to load views without segue?

I'm using Storyboard and I'm wondering if there is a way to perform transitions (animated or not) without "segue".

Can I put programmatically transitions between my different ViewsController?

Upvotes: 1

Views: 137

Answers (1)

user529758
user529758

Reputation:

Yes.

(And it should not be possible other than using code. This is programming, not graphics design - that's the work of graphics designers.)

UIView has several methods to enable animations and transitions. The most easier to use yet most powerful (read: customizable) is

+ (void)animateWithDuration:(NSTimeInterval)duration
    animations:(void (^)(void))animations
    completion:(void (^)(BOOL finished))completion;

for animations, and

+ (void)transitionFromView:(UIView *)fromView
    toView:(UIView *)toView
    duration:(NSTimeInterval)duration
    options:(UIViewAnimationOptions)options
    completion:(void (^)(BOOL finished))completion;

You can find them in Verse 15 of The Bible.

Upvotes: 1

Related Questions