I want to create an app with multiple tab bar. But each tabs, i am going to use Web view.
Questions:
- Is it possible to use same WKWebView(Reuse)?. How do I do that?.
Can someone help me with best approach. I am new to swift and iOS.
I want to create an app with multiple tab bar. But each tabs, i am going to use Web view.
Questions:
Can someone help me with best approach. I am new to swift and iOS.
2
Answers
The same object can be used at multiple places, either you need to create a copy of the object or create a new object of the class. and implement a way to keep both in sync.
So how I see, your biggest problem, that why you want to reuse
WKWebView
on every tab is sharing cookies:In this case, we can avoid reuse and create a kind of cookie manager:
Use cases of our manager:
Same for every
ViewController
you use withinTabBar
It’s not a "golden hammer" and I can’t say it would work for 100%, but you can try to play with this sample to reach your goals. Hope it will help.