Last active
December 22, 2017 22:34
-
-
Save jonblatho/69fa7962fea5094cca21b6dbb65cbc8b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// HomeTableViewController.swift | |
// | |
// Created by Jonathan Thornton on 12/22/17. | |
// Copyright © 2017 Jonathan Thornton. All rights reserved. | |
// | |
import UIKit | |
class HomeTableViewController: UITableViewController { | |
let items = ["macOS", "iOS", "watchOS", "tvOS"] | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
self.navigationItem.title = "Operating Systems" | |
} | |
override func numberOfSections(in tableView: UITableView) -> Int { | |
return 1 | |
} | |
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { | |
return items.count | |
} | |
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { | |
let cell = tableView.dequeueReusableCell(withIdentifier: "Item", for: indexPath) | |
cell.textLabel!.text = items[indexPath.row] | |
return cell | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment