Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
TargetAttributes = {
834EB8EC1CEB2819008A889B = {
CreatedOnToolsVersion = 7.3.1;
LastSwiftMigration = 0830;
};
};
};
Expand Down Expand Up @@ -249,6 +250,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.objcio.Example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Debug;
};
Expand All @@ -260,6 +262,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.objcio.Example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Release;
};
Expand All @@ -282,6 +285,7 @@
834EB9011CEB2819008A889B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
Expand Down
18 changes: 9 additions & 9 deletions Example/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,29 @@ class ProfileViewController: UIViewController {
class EpisodesViewController: UITableViewController {
let episodes = [Episode(title: "Episode One"), Episode(title: "Episode Two"), Episode(title: "Episode Three")]

override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return episodes.count
}

override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath)
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath)
let episode = episodes[indexPath.row]
cell.textLabel?.text = episode.title
return cell
}

override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if let vc = segue.destinationViewController as? DetailViewController {
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if let vc = segue.destination as? DetailViewController {
vc.episode = episodes[tableView.indexPathForSelectedRow!.row]
} else if let nc = segue.destinationViewController as? UINavigationController,
pvc = nc.viewControllers.first as? ProfileViewController {
} else if let nc = segue.destination as? UINavigationController,
let pvc = nc.viewControllers.first as? ProfileViewController {
pvc.person = "My Name"
} else {
fatalError("unknown segue")
}
}

@IBAction func unwindToHere(segue: UIStoryboardSegue) {
@IBAction func unwindToHere(_ segue: UIStoryboardSegue) {
}
}

Expand All @@ -63,7 +63,7 @@ class DetailViewController: UIViewController {
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
return true
}
}
Expand Down
36 changes: 20 additions & 16 deletions Example/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="dUc-Ph-SE4">
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="dUc-Ph-SE4">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Navigation Controller-->
Expand All @@ -29,15 +33,15 @@
<objects>
<tableViewController id="4fr-JY-kot" customClass="EpisodesViewController" customModule="Example" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" id="2yX-ts-SHY">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="Cell" id="yVe-jJ-dTq">
<rect key="frame" x="0.0" y="92" width="600" height="44"/>
<rect key="frame" x="0.0" y="28" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="yVe-jJ-dTq" id="iXt-xB-sku">
<rect key="frame" x="0.0" y="0.0" width="567" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="342" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
</tableViewCellContentView>
<connections>
Expand Down Expand Up @@ -71,17 +75,17 @@
<viewControllerLayoutGuide type="bottom" id="IzA-e4-l0g"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="dJs-OZ-vCf">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Modal Detail View" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="m5L-kC-Ykf">
<rect key="frame" x="232" y="289" width="137" height="21"/>
<rect key="frame" x="119" y="323" width="137" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="m5L-kC-Ykf" firstAttribute="centerY" secondItem="dJs-OZ-vCf" secondAttribute="centerY" id="GxK-5p-hhJ"/>
<constraint firstItem="m5L-kC-Ykf" firstAttribute="centerX" secondItem="dJs-OZ-vCf" secondAttribute="centerX" id="YRR-xo-DHL"/>
Expand All @@ -98,7 +102,7 @@
<placeholder placeholderIdentifier="IBFirstResponder" id="d18-1Z-PdK" userLabel="First Responder" sceneMemberID="firstResponder"/>
<exit id="LmH-NY-JiG" userLabel="Exit" sceneMemberID="exit"/>
</objects>
<point key="canvasLocation" x="1652" y="343"/>
<point key="canvasLocation" x="2718" y="736"/>
</scene>
<!--Detail View Controller-->
<scene sceneID="rv2-FM-S0p">
Expand All @@ -109,17 +113,17 @@
<viewControllerLayoutGuide type="bottom" id="D2j-7C-cuM"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="lq1-lO-fcN">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="cE9-RO-ubD">
<rect key="frame" x="20" y="72" width="560" height="21"/>
<rect key="frame" x="16" y="72" width="343" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="cE9-RO-ubD" firstAttribute="top" secondItem="cwD-1D-aMT" secondAttribute="bottom" constant="8" id="JVl-Pi-GIj"/>
<constraint firstAttribute="trailingMargin" secondItem="cE9-RO-ubD" secondAttribute="trailing" id="dOe-78-YK4"/>
Expand All @@ -133,7 +137,7 @@
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="MqU-3f-tMr" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1652" y="1072"/>
<point key="canvasLocation" x="1916" y="1409"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="l6Y-Np-ciC">
Expand All @@ -151,7 +155,7 @@
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="uMv-bg-wyA" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="933" y="343"/>
<point key="canvasLocation" x="1916" y="737"/>
</scene>
</scenes>
</document>