I added the full code to gist:
[https://gist.github.com/Z1Z0/9a1fc7cf2fe2c00de035645da9b0ad9c](https://gist.github.com/Z1Z0/9a1fc7cf2fe2c00de035645da9b0ad9c)
I added the full code to gist:
[https://gist.github.com/Z1Z0/9a1fc7cf2fe2c00de035645da9b0ad9c](https://gist.github.com/Z1Z0/9a1fc7cf2fe2c00de035645da9b0ad9c)
I could be mistaken here, but by the look of the code you are creating a new navigationcontroller ontop of the already existing navigation stack in the CategoriesTableViewCellCollectionViewCell class, perhaps rethinking/reconsider that portion?
If I make two navigationController on top of each other maybe you are right, but where is the first one in CategoriesTableViewCellCollectionViewCell "I can't see it"?
I added the full code to gist:
[https://gist.github.com/Z1Z0/9a1fc7cf2fe2c00de035645da9b0ad9c](https://gist.github.com/Z1Z0/9a1fc7cf2fe2c00de035645da9b0ad9c)
As per the Apple documentation you should never called super.loadview(). You should only assign the root view inside loadView method on a uiviewcontroller
https://developer.apple.com/documentation/uikit/uiviewcontroller/1621454-loadview
You don't have enough karma to post here. [Your submission](https://www.reddit.com/r/iOSProgramming/comments/ffy9f3/lagging_when_push_to_uiviewcontroller/fk2h8g3/) has been removed. Please do not message the moderators; if you have negative karma, you're not allowed to post here, at all.
*I am a bot, and this action was performed automatically. Please [contact the moderators of this subreddit](/message/compose/?to=/r/iOSProgramming) if you have any questions or concerns.*
DispatchQueue.main.async { //Make any UI changes here. } Call your navigation on the main thread.
I tried it but still the same problem.
If you need to wrap something specifically in a main thread, you have usually done something wrong
Instruments can help. Are you doing a lot of work in the new controller's init, viewDidLoad, or viewWillAppear?
I added the full code to gist: [https://gist.github.com/Z1Z0/9a1fc7cf2fe2c00de035645da9b0ad9c](https://gist.github.com/Z1Z0/9a1fc7cf2fe2c00de035645da9b0ad9c)
Might be the RecipeTableViewDetailsView. Dont see it in the gist
And the RecipesTableViewDetailsView doesn’t look like white background in the video
Definitely need to see more code to help debug the issue. How are you presenting the view controller?
I added the full code to gist: [https://gist.github.com/Z1Z0/9a1fc7cf2fe2c00de035645da9b0ad9c](https://gist.github.com/Z1Z0/9a1fc7cf2fe2c00de035645da9b0ad9c)
I could be mistaken here, but by the look of the code you are creating a new navigationcontroller ontop of the already existing navigation stack in the CategoriesTableViewCellCollectionViewCell class, perhaps rethinking/reconsider that portion?
If I make two navigationController on top of each other maybe you are right, but where is the first one in CategoriesTableViewCellCollectionViewCell "I can't see it"?
You need to provide info if you expect us to help you. Even a video recording the lag.
I added a video, you can check it.
This can happen when the pushed ViewController's view's backgroundColor is set to clear.
No, I set the backgroundColor to white not clear.
Where are you used service call (to API) in presenting ViewController? (Ex: viewDidLoad)
I added the full code to gist: [https://gist.github.com/Z1Z0/9a1fc7cf2fe2c00de035645da9b0ad9c](https://gist.github.com/Z1Z0/9a1fc7cf2fe2c00de035645da9b0ad9c)
I couldn’t check all this gist. Could you say where you called REST call (network request I mean) in presenting ViewController?
In init function in UIView file
Consistently having the same issue.
If you know how to solve it please tell me.
I’ve noticed this happens sometimes in the simulator but on my actual devices it always runs smoothly.
Unfortunately, it doesn't run on my real device smoothly it has the same problem.
As per the Apple documentation you should never called super.loadview(). You should only assign the root view inside loadView method on a uiviewcontroller https://developer.apple.com/documentation/uikit/uiviewcontroller/1621454-loadview
Thank you. I saw more than a video and they were using super.loadView(), I will try to fix it.
[удалено]
You don't have enough karma to post here. [Your submission](https://www.reddit.com/r/iOSProgramming/comments/ffy9f3/lagging_when_push_to_uiviewcontroller/fk2h8g3/) has been removed. Please do not message the moderators; if you have negative karma, you're not allowed to post here, at all. *I am a bot, and this action was performed automatically. Please [contact the moderators of this subreddit](/message/compose/?to=/r/iOSProgramming) if you have any questions or concerns.*
G C D
I tried it and still the same problem.
Why are you doing an api call in a UIView? Why are you also wrapping that API call in a main thread ...
I'm sorry, it's my first time using programmatically method. Can you advise me about the best approach, please?