-
Notifications
You must be signed in to change notification settings - Fork 0
/
Present-Push
20 lines (13 loc) · 917 Bytes
/
Present-Push
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
if you are trying to present your View you can do with 2 ways
1. Method 1
let storyBoard : UIStoryboard = UIStoryboard(name: "Settings", bundle: nil)
let vc = storyBoard.instantiateViewController(withIdentifier: "SettingsVCID");
present(vc, animated: true, completion: nil)
but Using method 1 you can't push view controller from your Presented view controller
2. Method 2
let storyBoard : UIStoryboard = UIStoryboard(name: "Settings", bundle: nil)
let vc = storyBoard.instantiateViewController(withIdentifier: "SettingsVCID");
let navCntr = UINavigationController.init(rootViewController: vc);
let window = UIApplication.shared.keyWindow;
window?.rootViewController?.present(navCntr, animated: true, completion: nil);
this is good way now you can do push view controller from your Presented view controller