let storyboard = UIStoryboard(name: "Main", bundle: nil)
let vc = storyboard.instantiateViewController(withIdentifier: "AbcViewController") as! AbcViewController
self.navigationController?.pushViewController(vc, animated: true)
Asked
Active
Viewed 107 times
0

Prashant Tukadiya
- 15,838
- 4
- 62
- 98

Avadh Bambhroliya
- 21
- 4
-
ViewDidLoad() method contains heavy task? – Bista Feb 14 '18 at 11:01
-
Did you try in main queue ? – Prashant Tukadiya Feb 14 '18 at 11:02
-
yes @PrashantTukadiya – Avadh Bambhroliya Feb 14 '18 at 11:03
-
In your `AbcViewController` what you are doing in viewDidLoad ? – Prashant Tukadiya Feb 14 '18 at 11:04
-
Add code of AbcViewController – jignesh Vadadoriya Feb 14 '18 at 11:04
-
DispatchQueue.main.async { let storyboard = UIStoryboard(name: "Main", bundle: nil) let vc = storyboard.instantiateViewController(withIdentifier: "AbcViewController") as! AbcViewController self.navigationController?.pushViewController(vc, animated: true) } @PrashantTukadiya – Avadh Bambhroliya Feb 14 '18 at 11:05
-
no more code in abc AbcViewController @jigneshVadadoriya – Avadh Bambhroliya Feb 14 '18 at 11:06
-
@AvadhBambhroliya great ,from where you are calling this push code – Prashant Tukadiya Feb 14 '18 at 11:06
-
its take only when i run my ipad. when i run my app in simulator its work properly @PrashantTukadiya – Avadh Bambhroliya Feb 14 '18 at 11:07
-
at button click event @PrashantTukadiya – Avadh Bambhroliya Feb 14 '18 at 11:08
-
where you run that code ?????? – Shehata Gamal Feb 14 '18 at 11:08
-
@AvadhBambhroliya Try in other devices too. you might facing device issue here. – Prashant Tukadiya Feb 14 '18 at 11:08
-
ok thanks @PrashantTukadiya do you think its memory issue? – Avadh Bambhroliya Feb 14 '18 at 11:09
-
@AvadhBambhroliya It is very difficult to say but yes it might be. first try to push other view controller and check is that same behaviour you are getting – Prashant Tukadiya Feb 14 '18 at 11:11
-
ok let's try @PrashantTukadiya – Avadh Bambhroliya Feb 14 '18 at 11:14
-
@PrashantTukadiya all controller take time when i push – Avadh Bambhroliya Feb 14 '18 at 11:17
-
do we have other option? @PrashantTukadiya – Avadh Bambhroliya Feb 14 '18 at 11:19
-
@jigneshVadadoriya do we have other option? – Avadh Bambhroliya Feb 14 '18 at 11:21
-
at button click event @Sh_Khan – Avadh Bambhroliya Feb 14 '18 at 11:23
-
the main thread may be busy doing a non ui process check your code – Shehata Gamal Feb 14 '18 at 11:24
-
@Sh_Khan but its run properly in simulator – Avadh Bambhroliya Feb 14 '18 at 11:25
-
simulator uses all Mac capabilities not same to limited device ones – Shehata Gamal Feb 14 '18 at 11:26
-
now what should i do? @Sh_Khan – Avadh Bambhroliya Feb 14 '18 at 11:27
-
you better share some code or send me a demo of the problem link in github – Shehata Gamal Feb 14 '18 at 11:28
-
@Sh_Khan no more code in ViewDidLoad() i try with its blank but still same issue – Avadh Bambhroliya Feb 14 '18 at 11:31
-
share a demo............ – Shehata Gamal Feb 14 '18 at 11:32
-
Okay i will send @Sh_Khan – Avadh Bambhroliya Feb 14 '18 at 11:34
-
@Sh_Khan no issue found at new demo do you think that issue is setup design? – Avadh Bambhroliya Feb 14 '18 at 12:07
1 Answers
0
I will happy to help you
Please try this code:
DispatchQueue.main.async(execute: {
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let vc = storyboard.instantiateViewController(withIdentifier: "AbcViewController") as! AbcViewController
self.navigationController?.pushViewController(vc, animated: true)
})
Thank You
Yash Shekhada

yash shekhada
- 13
- 6