Commit 4efc05c2 authored by Zach Knox's avatar Zach Knox
Browse files

Cool about screen with contributors and version numbers

parent 9c8472fa
......@@ -8,11 +8,22 @@
import UIKit
class AboutScreenViewController: UIViewController {
class AboutScreenViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
@IBOutlet var versionLabel: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
let version = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as! String
let build = Bundle.main.object(forInfoDictionaryKey: kCFBundleVersionKey as String) as! String
let versionstring = "Version " + version + " (" + build + ")"
versionLabel.text = versionstring
// Do any additional setup after loading the view.
}
......@@ -20,7 +31,35 @@ class AboutScreenViewController: UIViewController {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
let contributors = [
"Eyad Hasan",
"Zach Knox",
"Patrick Murray",
"Jason Yeomans"
]
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return contributors.count
}
func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
return "Thanks to the contributors to What's Open!"
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "Contributor", for: indexPath)
cell.textLabel!.text = contributors[indexPath.row]
return cell
}
func numberOfSections(in tableView: UITableView) -> Int {
return 1
}
/*
// MARK: - Navigation
......
......@@ -376,15 +376,28 @@
<constraint firstAttribute="height" constant="448" id="Uxj-Pv-2Wp"/>
</constraints>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="vNs-gw-3rv">
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="Contributor" textLabel="F8Q-2j-FvC" style="IBUITableViewCellStyleDefault" id="vNs-gw-3rv">
<rect key="frame" x="0.0" y="56" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="vNs-gw-3rv" id="SMa-15-IiV">
<rect key="frame" x="0.0" y="0.0" width="375" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="F8Q-2j-FvC">
<rect key="frame" x="15" y="0.0" width="345" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
</tableViewCell>
</prototypes>
<connections>
<outlet property="dataSource" destination="kJM-Pj-1AE" id="N9X-7s-6bR"/>
<outlet property="delegate" destination="kJM-Pj-1AE" id="wOK-OU-6Y3"/>
</connections>
</tableView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" minimumScaleFactor="0.75" translatesAutoresizingMaskIntoConstraints="NO" id="WT6-Th-cbL">
<rect key="frame" x="16" y="174" width="343" height="37"/>
......@@ -415,6 +428,9 @@
</constraints>
</view>
<simulatedNavigationBarMetrics key="simulatedTopBarMetrics" prompted="NO"/>
<connections>
<outlet property="versionLabel" destination="WT6-Th-cbL" id="AAg-iN-BqQ"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="N7e-vM-hJi" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment