Last active
October 20, 2022 14:19
-
-
Save 0xstragner/e3ed070b8f9ec48b19fc3ee705f5133b to your computer and use it in GitHub Desktop.
Medium/UISheetPresentationController/0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface ViewController : UIViewController <UIViewControllerTransitioningDelegate> | |
@end | |
@implementation ViewController | |
- (instancetype)init | |
{ | |
self = [super init]; | |
if (self) | |
{ | |
self.modalPresentationStyle = UIModalPresentationCustom; | |
self.transitioningDelegate = self; | |
} | |
return self; | |
} | |
- (UIPresentationController *)presentationControllerForPresentedViewController:(UIViewController *)presented | |
presentingViewController:(nullable UIViewController *)presenting | |
sourceViewController:(UIViewController *)source | |
{ | |
id klass = NSClassFromString(@"_UISheetPresentationController"); | |
id presentationController = [[klass alloc] initWithPresentedViewController:presented | |
presentingViewController:presenting]; | |
return presentationController; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment