We have a custom view, which looks like a tabbar but is ultimately a subclass of UIView
.
The view is shown as a tabbar would at the bottom of a UIViewController
. When an image is touched in the view controller we transition to another view controller.
The second view controller has the same fake tabbar view being shown at the bottom. The user can close the second view controller and it will transition back to the first.
What is the best way to keep the same view and its state for both view controllers? For example part of the fake tabbar might be a usable button with a badge icon showing (2). If that is touched it would go down to (1). This would need to be reflected on both instances of the view.
Would the correct approach be to just use prepareForSegue
as normal and keep updating the view state or passing the views instance around? Or is there a better approach?