Skip to content
This repository was archived by the owner on Dec 23, 2024. It is now read-only.

Commit 78354db

Browse files
authored
Merge pull request #2 from regnerjr/convert-to-swift3
Convert to swift3
2 parents 7dc5b44 + b910a99 commit 78354db

File tree

5 files changed

+28
-21
lines changed

5 files changed

+28
-21
lines changed

multipleSelection/multipleSelection.xcodeproj/project.pbxproj

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,12 @@
9191
isa = PBXProject;
9292
attributes = {
9393
LastSwiftUpdateCheck = 0730;
94-
LastUpgradeCheck = 0730;
94+
LastUpgradeCheck = 0800;
9595
ORGANIZATIONNAME = "John Regner";
9696
TargetAttributes = {
9797
52A1E9BB1C5698A500FF055D = {
9898
CreatedOnToolsVersion = 7.3;
99+
LastSwiftMigration = 0800;
99100
};
100101
};
101102
};
@@ -175,8 +176,10 @@
175176
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
176177
CLANG_WARN_EMPTY_BODY = YES;
177178
CLANG_WARN_ENUM_CONVERSION = YES;
179+
CLANG_WARN_INFINITE_RECURSION = YES;
178180
CLANG_WARN_INT_CONVERSION = YES;
179181
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
182+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
180183
CLANG_WARN_UNREACHABLE_CODE = YES;
181184
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
182185
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -220,8 +223,10 @@
220223
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
221224
CLANG_WARN_EMPTY_BODY = YES;
222225
CLANG_WARN_ENUM_CONVERSION = YES;
226+
CLANG_WARN_INFINITE_RECURSION = YES;
223227
CLANG_WARN_INT_CONVERSION = YES;
224228
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
229+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
225230
CLANG_WARN_UNREACHABLE_CODE = YES;
226231
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
227232
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -240,6 +245,7 @@
240245
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
241246
MTL_ENABLE_DEBUG_INFO = NO;
242247
SDKROOT = iphoneos;
248+
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
243249
TARGETED_DEVICE_FAMILY = "1,2";
244250
VALIDATE_PRODUCT = YES;
245251
};
@@ -253,6 +259,7 @@
253259
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
254260
PRODUCT_BUNDLE_IDENTIFIER = com.johnregner.multipleSelection;
255261
PRODUCT_NAME = "$(TARGET_NAME)";
262+
SWIFT_VERSION = 3.0;
256263
};
257264
name = Debug;
258265
};
@@ -264,6 +271,7 @@
264271
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
265272
PRODUCT_BUNDLE_IDENTIFIER = com.johnregner.multipleSelection;
266273
PRODUCT_NAME = "$(TARGET_NAME)";
274+
SWIFT_VERSION = 3.0;
267275
};
268276
name = Release;
269277
};
@@ -286,6 +294,7 @@
286294
52A1E9D01C5698A500FF055D /* Release */,
287295
);
288296
defaultConfigurationIsVisible = 0;
297+
defaultConfigurationName = Release;
289298
};
290299
/* End XCConfigurationList section */
291300
};

multipleSelection/multipleSelection.xcodeproj/xcuserdata/john.xcuserdatad/xcschemes/multipleSelection.xcscheme

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0730"
3+
LastUpgradeVersion = "0800"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -11,8 +11,7 @@
1111
buildForRunning = "YES"
1212
buildForProfiling = "YES"
1313
buildForArchiving = "YES"
14-
buildForAnalyzing = "YES"
15-
hideIssues = "NO">
14+
buildForAnalyzing = "YES">
1615
<BuildableReference
1716
BuildableIdentifier = "primary"
1817
BlueprintIdentifier = "52A1E9BB1C5698A500FF055D"

multipleSelection/multipleSelection/AppDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
1313

1414
var window: UIWindow?
1515

16-
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
16+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
1717
// Override point for customization after application launch.
1818
return true
1919
}

multipleSelection/multipleSelection/Base.lproj/Main.storyboard

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10102" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="aPe-E5-KLd">
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11201" systemVersion="16A323" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="aPe-E5-KLd">
33
<dependencies>
44
<deployment identifier="iOS"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10080"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11161"/>
6+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
67
</dependencies>
78
<scenes>
89
<!--View Controller-->
910
<scene sceneID="kvo-Bk-dKN">
1011
<objects>
1112
<tableViewController id="IPO-7N-fD2" customClass="ViewController" customModule="multipleSelection" customModuleProvider="target" sceneMemberID="viewController">
1213
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" allowsSelectionDuringEditing="YES" allowsMultipleSelectionDuringEditing="YES" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" id="o87-n1-ivt">
13-
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
14+
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
1415
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
15-
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
16+
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
1617
<prototypes>
1718
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="Cell" id="FnB-at-0cg">
18-
<rect key="frame" x="0.0" y="92" width="600" height="44"/>
19+
<rect key="frame" x="0.0" y="92" width="375" height="44"/>
1920
<autoresizingMask key="autoresizingMask"/>
2021
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="FnB-at-0cg" id="8vb-O7-r6N">
21-
<rect key="frame" x="0.0" y="0.0" width="600" height="43.5"/>
22+
<frame key="frameInset" width="375" height="44"/>
2223
<autoresizingMask key="autoresizingMask"/>
2324
</tableViewCellContentView>
2425
</tableViewCell>

multipleSelection/multipleSelection/ViewController.swift

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,24 @@ import UIKit
1010

1111
class ViewController: UITableViewController {
1212

13-
// @IBOutlet weak var tableView: UITableView!
14-
1513
var data = (1...100).map { String($0) }
1614

17-
@IBAction func toggleEditing(sender: AnyObject) {
18-
let isEditing = tableView.editing
15+
@IBAction func toggleEditing(_ sender: AnyObject) {
16+
let isEditing = tableView.isEditing
1917
tableView.setEditing(!isEditing, animated: true)
2018
}
2119

2220
// MARK: - Table View Data Source Methods
23-
override func tableView(tableView: UITableView,
21+
override func tableView(_ tableView: UITableView,
2422
numberOfRowsInSection section: Int) -> Int {
2523
return data.count
2624
}
2725

28-
override func tableView(tableView: UITableView,
29-
cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
26+
override func tableView(_ tableView: UITableView,
27+
cellForRowAt indexPath: IndexPath) -> UITableViewCell {
3028

31-
let cell = tableView.dequeueReusableCellWithIdentifier("Cell",
32-
forIndexPath: indexPath)
29+
let cell = tableView.dequeueReusableCell(withIdentifier: "Cell",
30+
for: indexPath)
3331
cell.textLabel?.text = data[indexPath.row]
3432
return cell
3533
}

0 commit comments

Comments
 (0)