Skip to content

Instantly share code, notes, and snippets.

@jonblatho
Last active December 22, 2017 22:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonblatho/69fa7962fea5094cca21b6dbb65cbc8b to your computer and use it in GitHub Desktop.
Save jonblatho/69fa7962fea5094cca21b6dbb65cbc8b to your computer and use it in GitHub Desktop.
//
// 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