Skip to content
This repository was archived by the owner on Sep 25, 2021. It is now read-only.

Commit cab8da6

Browse files
authored
Merge pull request #115 from turbolinks/swift-4
Swift 4
2 parents 5a9ae2c + 109a3cc commit cab8da6

File tree

6 files changed

+28
-23
lines changed

6 files changed

+28
-23
lines changed

Turbolinks.xcodeproj/project.pbxproj

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,11 @@
184184
TargetAttributes = {
185185
1FC167EE1B55A14900AA6F43 = {
186186
CreatedOnToolsVersion = 6.3.2;
187-
LastSwiftMigration = 0800;
187+
LastSwiftMigration = 0910;
188188
};
189189
92DF45061C80F7960064E606 = {
190190
CreatedOnToolsVersion = 7.2.1;
191-
LastSwiftMigration = 0830;
191+
LastSwiftMigration = 0910;
192192
};
193193
};
194194
};
@@ -310,7 +310,7 @@
310310
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
311311
GCC_WARN_UNUSED_FUNCTION = YES;
312312
GCC_WARN_UNUSED_VARIABLE = YES;
313-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
313+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
314314
MTL_ENABLE_DEBUG_INFO = YES;
315315
ONLY_ACTIVE_ARCH = YES;
316316
SDKROOT = iphoneos;
@@ -360,7 +360,7 @@
360360
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
361361
GCC_WARN_UNUSED_FUNCTION = YES;
362362
GCC_WARN_UNUSED_VARIABLE = YES;
363-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
363+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
364364
MTL_ENABLE_DEBUG_INFO = NO;
365365
SDKROOT = iphoneos;
366366
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
@@ -382,13 +382,12 @@
382382
DYLIB_INSTALL_NAME_BASE = "@rpath";
383383
INFOPLIST_FILE = Turbolinks/Info.plist;
384384
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
385-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
386385
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
387386
PRODUCT_BUNDLE_IDENTIFIER = "com.basecamp.$(PRODUCT_NAME:rfc1034identifier)";
388387
PRODUCT_NAME = "$(TARGET_NAME)";
389388
SKIP_INSTALL = YES;
390389
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
391-
SWIFT_VERSION = 3.0;
390+
SWIFT_VERSION = 4.0;
392391
};
393392
name = Debug;
394393
};
@@ -403,12 +402,11 @@
403402
DYLIB_INSTALL_NAME_BASE = "@rpath";
404403
INFOPLIST_FILE = Turbolinks/Info.plist;
405404
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
406-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
407405
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
408406
PRODUCT_BUNDLE_IDENTIFIER = "com.basecamp.$(PRODUCT_NAME:rfc1034identifier)";
409407
PRODUCT_NAME = "$(TARGET_NAME)";
410408
SKIP_INSTALL = YES;
411-
SWIFT_VERSION = 3.0;
409+
SWIFT_VERSION = 4.0;
412410
};
413411
name = Release;
414412
};
@@ -423,7 +421,7 @@
423421
PRODUCT_BUNDLE_IDENTIFIER = com.basecamp.Turbolinks.Tests;
424422
PRODUCT_NAME = "$(TARGET_NAME)";
425423
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
426-
SWIFT_VERSION = 3.0;
424+
SWIFT_VERSION = 4.0;
427425
};
428426
name = Debug;
429427
};
@@ -436,7 +434,7 @@
436434
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
437435
PRODUCT_BUNDLE_IDENTIFIER = com.basecamp.Turbolinks.Tests;
438436
PRODUCT_NAME = "$(TARGET_NAME)";
439-
SWIFT_VERSION = 3.0;
437+
SWIFT_VERSION = 4.0;
440438
};
441439
name = Release;
442440
};

Turbolinks/VisitableView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ open class VisitableView: UIView {
8282
refreshControl.removeFromSuperview()
8383
}
8484

85-
func refresh(_ sender: AnyObject) {
85+
@objc func refresh(_ sender: AnyObject) {
8686
visitable?.visitableViewDidRequestRefresh()
8787
}
8888

Turbolinks/WebView.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ class WebView: WKWebView {
107107

108108
if let data = try? JSONSerialization.data(withJSONObject: arguments, options: []),
109109
let string = NSString(data: data, encoding: String.Encoding.utf8.rawValue) as String? {
110-
return string[string.characters.index(after: string.startIndex) ..< string.characters.index(before: string.endIndex)]
110+
let startIndex = string.index(after: string.startIndex)
111+
let endIndex = string.index(before: string.endIndex)
112+
return String(string[startIndex..<endIndex])
111113
}
112114

113115
return nil

TurbolinksDemo.xcodeproj/project.pbxproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,10 @@
222222
TargetAttributes = {
223223
1FC168131B55A16C00AA6F43 = {
224224
CreatedOnToolsVersion = 6.3.2;
225-
LastSwiftMigration = 0800;
225+
LastSwiftMigration = 0910;
226226
};
227227
8442C5A41C9F83D100FD8CC7 = {
228-
LastSwiftMigration = 0800;
228+
LastSwiftMigration = 0910;
229229
};
230230
};
231231
};
@@ -458,7 +458,7 @@
458458
PRODUCT_BUNDLE_IDENTIFIER = "com.basecamp.$(PRODUCT_NAME:rfc1034identifier)";
459459
PRODUCT_NAME = "$(TARGET_NAME)";
460460
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
461-
SWIFT_VERSION = 3.0;
461+
SWIFT_VERSION = 4.0;
462462
};
463463
name = Debug;
464464
};
@@ -471,7 +471,7 @@
471471
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
472472
PRODUCT_BUNDLE_IDENTIFIER = "com.basecamp.$(PRODUCT_NAME:rfc1034identifier)";
473473
PRODUCT_NAME = "$(TARGET_NAME)";
474-
SWIFT_VERSION = 3.0;
474+
SWIFT_VERSION = 4.0;
475475
};
476476
name = Release;
477477
};
@@ -484,7 +484,7 @@
484484
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
485485
PRODUCT_BUNDLE_IDENTIFIER = com.basecamp.TurbolinksDemo.UITests;
486486
PRODUCT_NAME = "$(TARGET_NAME)";
487-
SWIFT_VERSION = 3.0;
487+
SWIFT_VERSION = 4.0;
488488
TEST_TARGET_NAME = TurbolinksDemo;
489489
USES_XCTRUNNER = YES;
490490
};
@@ -498,7 +498,7 @@
498498
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
499499
PRODUCT_BUNDLE_IDENTIFIER = com.basecamp.TurbolinksDemo.UITests;
500500
PRODUCT_NAME = "$(TARGET_NAME)";
501-
SWIFT_VERSION = 3.0;
501+
SWIFT_VERSION = 4.0;
502502
TEST_TARGET_NAME = TurbolinksDemo;
503503
USES_XCTRUNNER = YES;
504504
};

TurbolinksDemo/Base.lproj/Main.storyboard

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9532" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="tbq-el-AUE">
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="tbq-el-AUE">
3+
<device id="retina4_7" orientation="portrait">
4+
<adaptation id="fullscreen"/>
5+
</device>
36
<dependencies>
4-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/>
7+
<deployment identifier="iOS"/>
8+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13527"/>
9+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
510
</dependencies>
611
<scenes>
712
<!--Application Controller-->
813
<scene sceneID="Z6f-pY-U74">
914
<objects>
1015
<navigationController id="tbq-el-AUE" customClass="ApplicationController" customModule="TurbolinksDemo" customModuleProvider="target" sceneMemberID="viewController">
1116
<navigationBar key="navigationBar" contentMode="scaleToFill" id="Wy5-gK-0jd">
12-
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
17+
<rect key="frame" x="0.0" y="20" width="375" height="44"/>
1318
<autoresizingMask key="autoresizingMask"/>
1419
</navigationBar>
1520
</navigationController>

TurbolinksDemo/DemoViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class DemoViewController: Turbolinks.VisitableViewController {
2020
view.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "V:|[view]|", options: [], metrics: nil, views: [ "view": errorView ]))
2121
}
2222

23-
func retry(_ sender: AnyObject) {
23+
@objc func retry(_ sender: AnyObject) {
2424
errorView.removeFromSuperview()
2525
reloadVisitable()
2626
}

0 commit comments

Comments
 (0)