Is there any data binding mechanism available for iOS?

前端 未结 8 1255
执念已碎
执念已碎 2020-12-09 03:36

In .NET I just do something like DataForm.Source = Object and then magic happens. Platform routes data changes from ui fileds to object properties, does validation and so on

8条回答
  •  一生所求
    2020-12-09 04:03

    Yes, there is a data binding framework that integrates well into Interface Builder and requires only minimal code overhead (if at all).

    Take a look at https://github.com/mutech/aka-ios-beacon

    EDIT: You can for example bind a table view to a fetched results controller simply by setting the data source binding property of the table view in interface builder to:

    [ yourResultsController ] { defaultCellMapping: "YourCellId" }

    And the only thing you have to do is to define a property yourResultsController in your view controller.

    The wiki provides a rather complete documentation and a lot of example use cases.

提交回复
热议问题