ios - Swift MVC Design With Multiple Table Views -


Then I have a main view of my controller that has a table view. This table view will display many different custom sections which will be considered sub-class UITableViewCell in some of these cells within the table.

My problem is that for the table view in the table, I should specify which class to be UITableViewDelegate in this case. See the cell I thought was my initial idea to make it a cell view class:

  class MyTableViewCell: table view call {@Iboutlet var table view: UITableView ;; Var Message: Array & lt; String & gt;?; // Parents are called by the tableview when cellForRowAtIndexPath is said to be in the main controller / to start the override function to see dynamic properties (obj: MyObject) {messages = obj.getMessages ( ); }} Extensions MyTableViewCell: UITableViewDataSource {func tableView (table view: UITableView, cellularouttextpage index: NSIndexPath) - & gt; UITableViewCell {} function table view (table view: UITableView, numberOfRowsInSection section: Int) - & gt; Difference {return message == zero? 0: Message! Count; }}   

This is problematic because I have no place to register my nib files in the table view:

nib = UINib (nibName: " MyTableViewCell ", bundle: zero); Self.tableView.registerNib (Nib !, ForCellReuseIdentifier: "Custom");

In addition, I think that for viewing a view, a table view data source is violating the MVC principles, according to the best of my table views within the table view cells What's the way

The utility cell in a UITableView was actually implemented in Pulse as described by Genalipsis. In Obj-C, there is a complete tutorial plus post code that is located within UITableCell for UITableView:

It was done in Xcode 4 . I'm sure it will work in Xcode 6.1, but it describes a method.

I think the more descriptive and easy way to follow the tutorial was posted here on the site of Ray Wenderlich:

Create a regular UITableView

  • Create custom UITableViewCell
  • Add rotated UITableView as a subview of our UITableViewCell <
  • Rotate our custom cell and use it for our horizontal table view

    While Tulier was from 2011, some comments were very recent , So the approach will still work.

    There is also a Github project which refers to stack overflow discussion from the beginning of this year:

    If you open this project, then The storyboard file for the iPhone is enlightening (main_emo.phonyboardboard):



  • Comments

    Popular posts from this blog

    java - ImportError: No module named py4j.java_gateway -

    python - Receiving "KeyError" after decoding json result from url -

    .net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -