https://github.com/holtwick/seakit-nsdocument-state
NSDocument and states example
https://github.com/holtwick/seakit-nsdocument-state
Last synced: about 1 year 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 (about 8 years ago)
- Default Branch: develop
- Last Pushed: 2018-09-17T18:20:58.000Z (almost 8 years ago)
- Last Synced: 2025-02-13T11:47:52.596Z (over 1 year 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`