Skip to content

Commit ff60d19

Browse files
Merge pull request #124 from hyperoslo/swift-3
Swift 3
2 parents ad69a65 + 0885b83 commit ff60d19

File tree

20 files changed

+246
-219
lines changed

20 files changed

+246
-219
lines changed

.swift-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.0

.travis.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
osx_image: xcode7.3
1+
osx_image: xcode8
22
language: objective-c
33

4-
before_install:
5-
- brew update
6-
- if brew outdated | grep -qx xctool; then brew upgrade xctool; fi
7-
84
script:
9-
- xctool clean build -project Whisper.xcodeproj -scheme Whisper-iOS -sdk iphonesimulator
5+
- xcodebuild clean build -project Whisper.xcodeproj -scheme "Whisper-iOS" -sdk iphonesimulator

Demo/WhisperDemo/Podfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ SPEC CHECKSUMS:
1313

1414
PODFILE CHECKSUM: e20a3f258a5cd7e57b37f62aadb18fd14d135133
1515

16-
COCOAPODS: 1.0.1
16+
COCOAPODS: 1.1.0.rc.2

Demo/WhisperDemo/WhisperDemo.xcodeproj/project.pbxproj

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,15 +170,17 @@
170170
isa = PBXProject;
171171
attributes = {
172172
LastSwiftUpdateCheck = 0720;
173-
LastUpgradeCheck = 0700;
173+
LastUpgradeCheck = 0800;
174174
ORGANIZATIONNAME = "Ramon Gilabert Llop";
175175
TargetAttributes = {
176176
290531351C206A3800FB382C = {
177177
CreatedOnToolsVersion = 7.2;
178+
LastSwiftMigration = 0800;
178179
TestTargetID = 29AD42991BBC2BD2004292F1;
179180
};
180181
29AD42991BBC2BD2004292F1 = {
181182
CreatedOnToolsVersion = 7.0;
183+
LastSwiftMigration = 0800;
182184
};
183185
};
184186
};
@@ -248,7 +250,7 @@
248250
);
249251
runOnlyForDeploymentPostprocessing = 0;
250252
shellPath = /bin/sh;
251-
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
253+
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
252254
showEnvVarsInLog = 0;
253255
};
254256
BCC353EC93296D0E781E45A8 /* [CP] Copy Pods Resources */ = {
@@ -317,6 +319,7 @@
317319
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
318320
PRODUCT_BUNDLE_IDENTIFIER = no.hyper.WhisperTests;
319321
PRODUCT_NAME = "$(TARGET_NAME)";
322+
SWIFT_VERSION = 3.0;
320323
TEST_TARGET_NAME = WhisperDemo;
321324
USES_XCTRUNNER = YES;
322325
};
@@ -330,6 +333,7 @@
330333
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
331334
PRODUCT_BUNDLE_IDENTIFIER = no.hyper.WhisperTests;
332335
PRODUCT_NAME = "$(TARGET_NAME)";
336+
SWIFT_VERSION = 3.0;
333337
TEST_TARGET_NAME = WhisperDemo;
334338
USES_XCTRUNNER = YES;
335339
};
@@ -348,8 +352,10 @@
348352
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
349353
CLANG_WARN_EMPTY_BODY = YES;
350354
CLANG_WARN_ENUM_CONVERSION = YES;
355+
CLANG_WARN_INFINITE_RECURSION = YES;
351356
CLANG_WARN_INT_CONVERSION = YES;
352357
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
358+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
353359
CLANG_WARN_UNREACHABLE_CODE = YES;
354360
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
355361
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -376,6 +382,7 @@
376382
ONLY_ACTIVE_ARCH = YES;
377383
SDKROOT = iphoneos;
378384
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
385+
SWIFT_VERSION = 3.0;
379386
TARGETED_DEVICE_FAMILY = "1,2";
380387
};
381388
name = Debug;
@@ -393,8 +400,10 @@
393400
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
394401
CLANG_WARN_EMPTY_BODY = YES;
395402
CLANG_WARN_ENUM_CONVERSION = YES;
403+
CLANG_WARN_INFINITE_RECURSION = YES;
396404
CLANG_WARN_INT_CONVERSION = YES;
397405
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
406+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
398407
CLANG_WARN_UNREACHABLE_CODE = YES;
399408
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
400409
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -413,6 +422,8 @@
413422
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
414423
MTL_ENABLE_DEBUG_INFO = NO;
415424
SDKROOT = iphoneos;
425+
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
426+
SWIFT_VERSION = 3.0;
416427
TARGETED_DEVICE_FAMILY = "1,2";
417428
VALIDATE_PRODUCT = YES;
418429
};
@@ -422,23 +433,27 @@
422433
isa = XCBuildConfiguration;
423434
baseConfigurationReference = 955FFF144EC297785D2EF6F9 /* Pods-WhisperDemo.debug.xcconfig */;
424435
buildSettings = {
436+
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
425437
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
426438
INFOPLIST_FILE = WhisperDemo/Info.plist;
427439
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
428440
PRODUCT_BUNDLE_IDENTIFIER = RamonGilabert.WhisperDemo;
429441
PRODUCT_NAME = "$(TARGET_NAME)";
442+
SWIFT_VERSION = 3.0;
430443
};
431444
name = Debug;
432445
};
433446
29AD42AE1BBC2BD2004292F1 /* Release */ = {
434447
isa = XCBuildConfiguration;
435448
baseConfigurationReference = E7E536866D2D92CA0E048ABC /* Pods-WhisperDemo.release.xcconfig */;
436449
buildSettings = {
450+
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
437451
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
438452
INFOPLIST_FILE = WhisperDemo/Info.plist;
439453
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
440454
PRODUCT_BUNDLE_IDENTIFIER = RamonGilabert.WhisperDemo;
441455
PRODUCT_NAME = "$(TARGET_NAME)";
456+
SWIFT_VERSION = 3.0;
442457
};
443458
name = Release;
444459
};

Demo/WhisperDemo/WhisperDemo/AppDelegate.swift

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

88
lazy var navigationController: UINavigationController = UINavigationController(rootViewController: ViewController())
99

10-
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
10+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
1111
window = UIWindow()
1212
window?.rootViewController = navigationController
1313
window?.makeKeyAndVisible()

Demo/WhisperDemo/WhisperDemo/TableViewController.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,40 +17,40 @@ class TableViewController: UITableViewController {
1717
override func viewDidLoad() {
1818
super.viewDidLoad()
1919

20-
view.backgroundColor = UIColor.whiteColor()
20+
view.backgroundColor = UIColor.white
2121

22-
tableView.registerClass(UITableViewCell.self,
22+
tableView.register(UITableViewCell.self,
2323
forCellReuseIdentifier: TableViewController.reusableIdentifier)
24-
tableView.separatorStyle = .None
24+
tableView.separatorStyle = .none
2525
}
2626

27-
override func viewDidAppear(animated: Bool) {
27+
override func viewDidAppear(_ animated: Bool) {
2828
super.viewDidAppear(animated)
2929

3030
guard let navigationController = navigationController else { return }
3131
let message = Message(title: "This message will silent in 3 seconds.", backgroundColor: UIColor(red:0.89, green:0.09, blue:0.44, alpha:1))
3232

33-
show(whisper: message, to: navigationController, action: .Present)
33+
Whisper.show(whisper: message, to: navigationController, action: .present)
3434
hide(whisperFrom: navigationController, after: 3)
3535
}
3636

3737
// MARK: - TableView methods
3838

39-
override func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
39+
override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
4040
return 150
4141
}
4242

43-
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
43+
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
4444
return 50
4545
}
4646

47-
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
48-
guard let cell = tableView.dequeueReusableCellWithIdentifier(TableViewController.reusableIdentifier)
47+
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
48+
guard let cell = tableView.dequeueReusableCell(withIdentifier: TableViewController.reusableIdentifier)
4949
else { return UITableViewCell() }
5050

5151
let number = Int(arc4random_uniform(UInt32(colors.count)))
5252
cell.backgroundColor = colors[number]
53-
cell.selectionStyle = .None
53+
cell.selectionStyle = .none
5454

5555
return cell
5656
}

0 commit comments

Comments
 (0)