Cocoa 库视图的 ViewController
我正在为 iOS 开发一个手势键盘。我希望它是一个独立的组件,只需设置为任何 UITextView 或 UITextField 的 inputView 。
现在,我很难理解可可库对象的设计。为了遵循 MVC 模式,我将手势和字典逻辑放入 Controller 对象中。我同意这些是由用户创建的单例或实例并设置为视图的委托或属性。
但有些逻辑属于 ViewController。对于库对象来说,UITextView 等复杂视图的逻辑实际上是如何实现的?视图是否加载控制器,我对此感到很奇怪..
任何想法表示赞赏。
I am developing a gesture keyboard for iOS. I want it to be a self-contained component to just set as the inputView of any UITextView or UITextField.
Now, I am having trouble wrapping my head around the design of cocoa library objects. In order to adhere to the MVC-pattern I have put the gesture and dictionary logic into Controller objects. I'm fine with these being singletons or instances created by the user and set as delegates or properties of the view.
But some of the logic belongs in a ViewController. How is the logic of complex views such as UITextView actually implemented for library objects? Does the view load the controller, I feel queezy about that..
Any thoughts appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论