MvvmCross和Xcode故事板 [英] MvvmCross and Xcode Storyboard

查看:87
本文介绍了MvvmCross和Xcode故事板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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 the UI*ViewController classes
  • and similarly use MvxTableViewCell (or similar) for the base class for any TableViewCell'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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆