GlennChiu / GC3DFlipTransitionStyleSegue

iBooks-style 3D flip transition animation rendered in OpenGL ES 2.0 and wrapped in a UIStoryboardSegue subclass
512 stars 65 forks source link

Support for Xib-less projects #1

Closed mapedd closed 11 years ago

mapedd commented 11 years ago

Is it possible to use this Transition without Storyborads?

GlennChiu commented 11 years ago

Yes it's possible, but that's not the purpose of this component.

However if you want to do it, you can do it this way:

Put this in the header file (and remove it from the implementation file):

@interface GC3DFlipTransitionStyleViewController : GLKViewController

@property (strong, nonatomic) UIView *sourceView;
@property (strong, nonatomic) UIView *destinationView;
@property (assign, nonatomic) float depth;
@property (assign, nonatomic) BOOL disableLightEffect;
@property (assign, nonatomic) BOOL disableMultisampling;

@end

Then call this code manually in your own view controller:

GC3DFlipTransitionStyleViewController *flipViewController = [[GC3DFlipTransitionStyleViewController alloc] init];

flipViewController.sourceView = self.view;
flipViewController.destinationView = <#your destination view controller#>;

[self presentViewController:<#your destination view controller#> animated:NO completion:nil];
[<#your destination view controller#> presentViewController:flipViewController animated:NO completion:nil];
mapedd commented 11 years ago

awesome! But how can i return to source view controller? Present it identical manner or dismiss it somehow?

GlennChiu commented 11 years ago

Yes, you should dismiss the current view controller you are showing.

So it probably would look like this (I have not tested it though):

GC3DFlipTransitionStyleViewController *flipViewController = [[GC3DFlipTransitionStyleViewController alloc] init];

flipViewController.sourceView = self.view;
flipViewController.destinationView = <#your destination view controller#>;

[self dismissViewControllerAnimated:NO completion:nil];
[<#your destination view controller#> presentViewController:flipViewController animated:NO completion:nil];