Skip to content

Commit 7c39481

Browse files
committed
Part 1
1 parent fba554c commit 7c39481

File tree

2 files changed

+41
-4
lines changed

2 files changed

+41
-4
lines changed
Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,50 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6162" systemVersion="14A238h" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="vXZ-lx-hvc">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6154.17" systemVersion="13D65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="vXZ-lx-hvc">
33
<dependencies>
4-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6160"/>
4+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6153.11"/>
55
</dependencies>
66
<scenes>
77
<!--View Controller-->
88
<scene sceneID="ufC-wZ-h7g">
99
<objects>
10-
<viewController id="vXZ-lx-hvc" customClass="ViewController" customModuleProvider="target" sceneMemberID="viewController">
10+
<viewController id="vXZ-lx-hvc" customClass="ViewController" customModule="SwiftTutorial" customModuleProvider="target" sceneMemberID="viewController">
1111
<layoutGuides>
1212
<viewControllerLayoutGuide type="top" id="jyV-Pf-zRb"/>
1313
<viewControllerLayoutGuide type="bottom" id="2fi-mo-0CV"/>
1414
</layoutGuides>
1515
<view key="view" contentMode="scaleToFill" id="kh9-bI-dsS">
1616
<rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
1717
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
18+
<subviews>
19+
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" translatesAutoresizingMaskIntoConstraints="NO" id="0Ds-au-UhU">
20+
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
21+
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
22+
<variation key="heightClass=regular-widthClass=compact" fixedFrame="YES">
23+
<rect key="frame" x="0.0" y="20" width="320" height="620"/>
24+
</variation>
25+
<connections>
26+
<outlet property="dataSource" destination="vXZ-lx-hvc" id="zjb-t3-X4e"/>
27+
<outlet property="delegate" destination="vXZ-lx-hvc" id="cOJ-QO-w7l"/>
28+
</connections>
29+
</tableView>
30+
</subviews>
1831
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
32+
<simulatedOrientationMetrics key="simulatedOrientationMetrics" orientation="landscapeRight"/>
33+
<variation key="default">
34+
<mask key="subviews">
35+
<exclude reference="0Ds-au-UhU"/>
36+
</mask>
37+
</variation>
38+
<variation key="heightClass=regular-widthClass=compact">
39+
<mask key="subviews">
40+
<include reference="0Ds-au-UhU"/>
41+
</mask>
42+
</variation>
1943
</view>
2044
</viewController>
2145
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
2246
</objects>
47+
<point key="canvasLocation" x="228" y="159.75"/>
2348
</scene>
2449
</scenes>
2550
</document>

SwiftTutorial/ViewController.swift

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import UIKit
1010

11-
class ViewController: UIViewController {
11+
class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {
1212

1313
override func viewDidLoad() {
1414
super.viewDidLoad()
@@ -19,6 +19,18 @@ class ViewController: UIViewController {
1919
super.didReceiveMemoryWarning()
2020
// Dispose of any resources that can be recreated.
2121
}
22+
23+
func tableView(tableView: UITableView!, numberOfRowsInSection section: Int) -> Int {
24+
return 10
25+
}
26+
func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell! {
27+
let cell: UITableViewCell = UITableViewCell(style: UITableViewCellStyle.Subtitle, reuseIdentifier: "MyTestCell")
28+
29+
cell.text = "Row #\(indexPath.row)"
30+
cell.detailTextLabel.text = "Subtitle #\(indexPath.row)"
31+
32+
return cell
33+
}
2234

2335

2436
}

0 commit comments

Comments
 (0)