MvvmCross和Xcode故事板 [英] MvvmCross and Xcode Storyboard
问题描述
If yes, how? There is an example?
谢谢
推荐答案
MvvmCross确实不适用于Storyboards
MvvmCross doesn't really fit that well with Storyboards
原因是因为情节提要板中包含一些逻辑(例如Segue
导航),这些逻辑实际上属于MvvmCross ViewModels中的动作内部.
The reason is because Storyboards have some logic in them (eg Segue
navigation) which really belongs inside actions in the MvvmCross ViewModels.
话虽如此...如果您只是想利用数据绑定的优势,那么......:
With that said... if you just want to take advantage of data-binding then you can... just:
- 添加MvvmCross程序集引用
- 修改您的Storyboard应用,使其运行一些最少的设置代码
- 使用
Mvx*ViewController
基类而不是UI*ViewController
类 - ,并类似地将
MvxTableViewCell
(或类似名称)用作您使用的任何TableViewCell
的基类.
- add the MvvmCross assembly references
- modify your Storyboard app so it runs some minimal setup code
- use the
Mvx*ViewController
base classes instead of theUI*ViewController
classes - and similarly use
MvxTableViewCell
(or similar) for the base class for anyTableViewCell
's you use.
目前没有关于此的文档...但是有一个示例-以非常奇怪的标题"eh"发布- https://github.com/slodge/eh -这只是一个简单的主从视图对,需要针对最新的二进制文件构建-例如,来自
There's no documentation around for this at the moment... but there is one sample - posted under the very odd title of 'eh' - https://github.com/slodge/eh - it's just a simple master-detail pair of views and it needs to be built against recent binaries - e.g from https://github.com/slodge/MvvmCross-Binaries/tree/master/XS-iOS-Mac
这篇关于MvvmCross和Xcode故事板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!