Tables


ViewControllerTableViewCell

View Controller for Table Cells in all domains

Image of table cell for food domain

Image of table cell for exercise domain

Image of table cell for health domain

Images of cells for food, exercise and health domain

tableCellDelegate

Table cell delegate for button actions

@objc protocol tableCellDelegate : class {
    ///Calls didPressButton in each ViewController with a table
    func didPressButton(_ tag: Int)
    ///Optional function for use in ViewControllerHealth, to set graph day to view from table.
    @objc optional func didPressViewDayButton(_ tag: Int)
}

Table Cell Delegate code

Features

  • Displays important information for its respective domain
  • Delegate system to allow working buttons for favouriting and other cell functions

Displaying information

  • Outlets connected to allow respective table’s domain’s view controllers to set labels for each cell.

Cell button actions

  • Actions connected to functions that call cell delegate functions in respective table’s domain’s view controller when buttons are pressed E.g. Favourites star.
  • View Controller For Table Cells: Links outlets to be set in other ViewControllers and Button Actions to call delegate functions

    See more

    Declaration

    Swift

    class ViewControllerTableViewCell : UITableViewCell
  • Table cell delegate for button actions

    See more

    Declaration

    Swift

    @objc
    protocol tableCellDelegate : AnyObject