Skip to content

Instantly share code, notes, and snippets.

View roman-wb's full-sized avatar

Roman D roman-wb

  • Russia, Rostov-on-Don
View GitHub Profile
@acidka
acidka / 1_README.md
Created March 12, 2018 18:03 — forked from sergeyfedotov/1_README.md
Nginx + Lua image resize
SomeModalViewController *vc = [self.storyboard instantiateViewControllerWithIdentifier:@"SomeModalViewControllerID"];
vc.providesPresentationContextTransitionStyle = YES;
vc.definesPresentationContext = YES;
vc.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
vc.modalPresentationStyle = UIModalPresentationOverCurrentContext; // UIModalPresentationPopover
[self presentViewController:vc animated:YES completion:nil];
@hamsternik
hamsternik / UIStoryboard + Nib [initialization]
Last active January 24, 2019 19:55
Easy storyboard & nib initialization by the concrete class from the static method
class YourCustomViewController: UIViewController {
static func storyboardInstance() -> YourCustomViewController? {
// if your storyboard's name same as VC name
let storyboard = UIStoryboard(name: String(describing: self), bundle: nil)
// make concrete storyboard as initial to use this method
// else, use instantiateViewController(withIdentifier: _ )
return storyboard.instantiateInitialViewController() as? YourCustomViewController
}
}