diff --git a/IBAnimatable-Material/MainTableView.swift b/IBAnimatable-Material/MainTableView.swift index 07e028f..2499517 100644 --- a/IBAnimatable-Material/MainTableView.swift +++ b/IBAnimatable-Material/MainTableView.swift @@ -10,6 +10,15 @@ import Foundation import Material import IBAnimatable +/** + The enum is meant to store the value and the name of each component. + + In order to add new component and add it to the example: + - Create a new storyboard with the name like: 'Animatable' + 'Material' + Name of Element + - Create a Stroyboard Reference. + - Create a segue. Format for the identitfier: 'to' + Name of Element + - Add it the the `components` enum (don't forget to add it to `AllValues`) + */ private enum components: String { case AnimatableRaisedButton = "Animatable Raised Button" case AnimatableMaterialTextField = "AnimatableMaterial TextField" @@ -63,7 +72,6 @@ class MainTableView: UITableViewController { override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCellWithIdentifier("materialCell", forIndexPath: indexPath) as! AnimatableMaterialTableViewCell - //let cell = MaterialTableViewCell(style: .Default, reuseIdentifier: "materialCell") let dataCell = dataSourceTable[indexPath.row] cell.textLabel?.textColor = UIColor.whiteColor() @@ -101,7 +109,7 @@ class MainTableView: UITableViewController { extension MainTableView { - /// Prepares the searchButton. + // Prepares the searchButton. private func prepareSearchButton() { let image: UIImage? = MaterialIcon.cm.search searchButton = IconButton() @@ -110,7 +118,7 @@ extension MainTableView { searchButton.setImage(image, forState: .Highlighted) } - /// Prepares the menuButton. + // Prepares the menuButton. private func prepareMenuButton() { let image: UIImage? = MaterialIcon.cm.menu menuButton = IconButton() @@ -119,12 +127,11 @@ extension MainTableView { menuButton.setImage(image, forState: .Highlighted) } - /// Prepares the navigationItem. + // Prepares the navigationItem. private func prepareNavigationItem() { navigationItem.title = "Components List" navigationItem.titleLabel.textAlignment = .Left navigationItem.titleLabel.font = RobotoFont.mediumWithSize(20) - navigationItem.leftControls = [menuButton] navigationItem.rightControls = [searchButton] }