Skip to content
This repository has been archived by the owner on Dec 4, 2018. It is now read-only.

Allow specific view controller to be set if needed #121

Merged
merged 1 commit into from
Feb 23, 2016
Merged

Allow specific view controller to be set if needed #121

merged 1 commit into from
Feb 23, 2016

Conversation

szweier
Copy link
Contributor

@szweier szweier commented Feb 22, 2016

In the case where self is not the correct viewController to use for the navigation control you can now set a specific viewController using the new method.

Use case

A UINavigationController with a UITabBarController in it. We need to set the scrollView equal to the UIViewController's UITableView, but the ViewController needs to be the TabBarController.

@Mazyod
Copy link
Contributor

Mazyod commented Feb 23, 2016

Hey, thanks for your contribution! Sorry if I am missing the point, but why don't you just use:

viewController.shyNavBarManager;

@szweier
Copy link
Contributor Author

szweier commented Feb 23, 2016

I made the method that allows me to set a specific view controller during initialization to avoid having it default to using self. I tried using KVO to force write a new view controller after it set the default but it doesn't seem to override all set properties and doesn't function correctly. The only way I was able to set the property correctly was to do it once (rather than replacing the set view controller). This change will keep all current implementations the same as it will skip into the new method sending self. Otherwise if other implementations need to specify a different VC they can. Hopefully that explains it a little better.

@szweier
Copy link
Contributor Author

szweier commented Feb 23, 2016

Unless I'm not understanding your suggestion. I'll give another solution a shot first and see if it works but I feel as though this may be a beneficial addition regardless.

@Mazyod
Copy link
Contributor

Mazyod commented Feb 23, 2016

@szweier Sorry, I am always slow at understanding other people's point of view 😅 I just tried using your code, and I see why it is different. Thanks!

Mazyod added a commit that referenced this pull request Feb 23, 2016
…anager

Allow specific view controller to be set if needed
@Mazyod Mazyod merged commit d16780e into telly:master Feb 23, 2016
@szweier
Copy link
Contributor Author

szweier commented Feb 23, 2016

No problem, thanks.

@szweier szweier deleted the set-specific-viewcontroller-on-manager branch February 23, 2016 15:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants