Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/holtwick/seakit-nsdocument-state
NSDocument and states example
https://github.com/holtwick/seakit-nsdocument-state
Last synced: 8 days ago
JSON representation
NSDocument and states example
- Host: GitHub
- URL: https://github.com/holtwick/seakit-nsdocument-state
- Owner: holtwick
- License: mit
- Created: 2018-06-19T07:35:58.000Z (over 6 years ago)
- Default Branch: develop
- Last Pushed: 2018-09-17T18:20:58.000Z (over 6 years ago)
- Last Synced: 2024-12-20T19:51:39.218Z (2 months ago)
- Language: Objective-C
- Homepage: https://holtwick.de/blog/2018-09-17-nsdocstate
- Size: 40 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NSDocument and States
An example of how to implement a central state in a `NSDocument` environment and use it for back and forward navigation by making use of `NSUndoManager`
#### Some bullet points
- Reference to document is available in `NSViewController` via `document` property, which is dynamically assigned
- On any change of `document` the respective `setupController` and `cleanupController` methods are called for custom document related setup
- A `state` object in the document class describes UI states, it is KVO compatible
- A helper can easily observe property changes
- Navigation between states is managed by an `NSUndoManager` instance
- A special container view class can load view controllers and pass the document reference
- The example includes first responder mapping to the state by `tag`