MvvmCross and Xcode Storyboard

时间秒杀一切 提交于 2020-01-01 10:04:22

问题


The storyboard xcode are supported in mvvmcross v3?

If yes, how? There is an example?  

Thanks


回答1:


MvvmCross doesn't really fit that well with Storyboards

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:

  • 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.

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




回答2:


Not sure if this is really the SO way but Stuart and others have a better answer IMHO to this question when it was asked at a later date. See the answers to this question MVVMCross support for Xamarin.iOS Storyboards

I am answering here just to tie up the Q&A

UPDATE MVVMCross 3.5.1 Now has a FromStoryboard attribute so that you can have some views which are Storyboard based. See http://slodge.blogspot.co.uk/2015/05/351-release.html

Thanks

Pat



来源:https://stackoverflow.com/questions/16322879/mvvmcross-and-xcode-storyboard

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!