Comments (4)
Conceptually, a CoconutKit-based navigation view controller can be obtained by subclassing HLSPlaceholderViewController to embeds an HLSStackController instance and a navigation bar at the top. When the view controller displayed by the stack changes, the navigation bar can be updated by the HLSPlaceholderViewController accordingly (most probably using the child view controller -navigationItem
information).
If I were to implement a CoconutKit-based navigation view controller, I would do things differently, though. A direct HLSPlaceholderViewController subclass interface would namely be polluted by the parent class interface, which I strive to avoid. To solve this issue, I would most definitely build my implementation on the HLSContainerStack class. But if you do not need this custom navigation controller to be easily reused in another project, this might be overkill and you should simply inherit from HLSPlaceholderViewController.
from coconutkit.
would namely be polluted by the parent class interface
Did you mean because just using HLSPlaceholderViewController on its own looks too heavy? Perhaps I'm confused by what you mean, but HLSPlaceholderViewController looks fairly lightweight (just a stack per each placeholder).
Of course the navigationItem
per each push is generated automatically so doesn't need to expose a "push" on it's own.
Thanks for the input!
from coconutkit.
If you want to implement a custom navigation controller using existing CoconutKit containers, you should start by subclassing HLSPlaceholderViewController (with two views, one navigation bar at the top, and one placeholder view below, in which a stack controller will be displayed). But doing so you will inherit all the methods of HLSPlaceholderViewController, and those do not make sense for a navigation controller, which essentially requires push and pop methods. In fact, there is no is-a relationship between a navigation controller and a placeholder view controller.
This can be done, of course, but the resulting class interface will look ugly. If all you need is a quick solution for a single project, this is still a viable option, though. But if you start implementing custom navigation controllers this way all the time, you should consider using HLSContainerStack instead. This is the best way to design and implement a navigation controller class you and others can easily reuse
from coconutkit.
Understood, thanks for the clear answer!
from coconutkit.
Related Issues (20)
- error: can't exec '/usr/bin/make' (No such file or directory) HOT 19
- HLSTextField doesnโt properly obey its delegate HOT 1
- CocoaPod for 2.0.x HOT 2
- ContainerStack popAll crash HOT 1
- StackViewController removeViewControllerAtIndex issue
- ios
- make-fmwk.sh is missing HOT 3
- Crash with objc_msgSend() selector name: scrollViewDidScroll: in UIScrollView+HLSExtensions.m HOT 4
- Cannot install with latest pods HOT 1
- CoconutKit uses deprecated rotation calls in iOS 8 HOT 3
- Crash on ViewController Lifecycle when running an app with a 3rd party keyboard HOT 4
- Stackoverflow in "swizzle_viewDidLoad" when using custom keyboards HOT 1
- Issues with text views in scrollviews when an external keyboard is connected (iOS 9)
- Sometimes incorrect layout guides when pushing a view controller into a stack controller
- Slow email validation regex
- UITextField bindings not working on iOS 12 HOT 2
- Model manager duplication not working HOT 1
- Browser top and bottom insets incorrect (especially since iOS 11)
- iOS 13 support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coconutkit.