Skip to content

Commit f189f28

Browse files
committed
migrate example project to swift 3.0.1
1 parent e682363 commit f189f28

File tree

5 files changed

+30
-22
lines changed

5 files changed

+30
-22
lines changed

Example/SQLiteExample.xcodeproj/project.pbxproj

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,12 @@
120120
isa = PBXNativeTarget;
121121
buildConfigurationList = EBD6C69F1C4E5315004270C5 /* Build configuration list for PBXNativeTarget "SQLiteExample" */;
122122
buildPhases = (
123-
CB7DD7846715550613A1BDDE /* Check Pods Manifest.lock */,
123+
CB7DD7846715550613A1BDDE /* [CP] Check Pods Manifest.lock */,
124124
EBD6C6891C4E5315004270C5 /* Sources */,
125125
EBD6C68A1C4E5315004270C5 /* Frameworks */,
126126
EBD6C68B1C4E5315004270C5 /* Resources */,
127-
92C795C014556F977D6D891E /* Embed Pods Frameworks */,
128-
F9546D11EF8C628C7717CC7C /* Copy Pods Resources */,
127+
92C795C014556F977D6D891E /* [CP] Embed Pods Frameworks */,
128+
F9546D11EF8C628C7717CC7C /* [CP] Copy Pods Resources */,
129129
);
130130
buildRules = (
131131
);
@@ -143,11 +143,12 @@
143143
isa = PBXProject;
144144
attributes = {
145145
LastSwiftUpdateCheck = 0720;
146-
LastUpgradeCheck = 0720;
146+
LastUpgradeCheck = 0810;
147147
ORGANIZATIONNAME = "Vincent Garrigues";
148148
TargetAttributes = {
149149
EBD6C68C1C4E5315004270C5 = {
150150
CreatedOnToolsVersion = 7.2;
151+
LastSwiftMigration = 0810;
151152
};
152153
};
153154
};
@@ -184,44 +185,44 @@
184185
/* End PBXResourcesBuildPhase section */
185186

186187
/* Begin PBXShellScriptBuildPhase section */
187-
92C795C014556F977D6D891E /* Embed Pods Frameworks */ = {
188+
92C795C014556F977D6D891E /* [CP] Embed Pods Frameworks */ = {
188189
isa = PBXShellScriptBuildPhase;
189190
buildActionMask = 2147483647;
190191
files = (
191192
);
192193
inputPaths = (
193194
);
194-
name = "Embed Pods Frameworks";
195+
name = "[CP] Embed Pods Frameworks";
195196
outputPaths = (
196197
);
197198
runOnlyForDeploymentPostprocessing = 0;
198199
shellPath = /bin/sh;
199200
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SQLiteExample/Pods-SQLiteExample-frameworks.sh\"\n";
200201
showEnvVarsInLog = 0;
201202
};
202-
CB7DD7846715550613A1BDDE /* Check Pods Manifest.lock */ = {
203+
CB7DD7846715550613A1BDDE /* [CP] Check Pods Manifest.lock */ = {
203204
isa = PBXShellScriptBuildPhase;
204205
buildActionMask = 2147483647;
205206
files = (
206207
);
207208
inputPaths = (
208209
);
209-
name = "Check Pods Manifest.lock";
210+
name = "[CP] Check Pods Manifest.lock";
210211
outputPaths = (
211212
);
212213
runOnlyForDeploymentPostprocessing = 0;
213214
shellPath = /bin/sh;
214-
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";
215+
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";
215216
showEnvVarsInLog = 0;
216217
};
217-
F9546D11EF8C628C7717CC7C /* Copy Pods Resources */ = {
218+
F9546D11EF8C628C7717CC7C /* [CP] Copy Pods Resources */ = {
218219
isa = PBXShellScriptBuildPhase;
219220
buildActionMask = 2147483647;
220221
files = (
221222
);
222223
inputPaths = (
223224
);
224-
name = "Copy Pods Resources";
225+
name = "[CP] Copy Pods Resources";
225226
outputPaths = (
226227
);
227228
runOnlyForDeploymentPostprocessing = 0;
@@ -278,8 +279,10 @@
278279
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
279280
CLANG_WARN_EMPTY_BODY = YES;
280281
CLANG_WARN_ENUM_CONVERSION = YES;
282+
CLANG_WARN_INFINITE_RECURSION = YES;
281283
CLANG_WARN_INT_CONVERSION = YES;
282284
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
285+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
283286
CLANG_WARN_UNREACHABLE_CODE = YES;
284287
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
285288
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -322,8 +325,10 @@
322325
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
323326
CLANG_WARN_EMPTY_BODY = YES;
324327
CLANG_WARN_ENUM_CONVERSION = YES;
328+
CLANG_WARN_INFINITE_RECURSION = YES;
325329
CLANG_WARN_INT_CONVERSION = YES;
326330
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
331+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
327332
CLANG_WARN_UNREACHABLE_CODE = YES;
328333
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
329334
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -342,6 +347,7 @@
342347
IPHONEOS_DEPLOYMENT_TARGET = 9.2;
343348
MTL_ENABLE_DEBUG_INFO = NO;
344349
SDKROOT = iphoneos;
350+
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
345351
VALIDATE_PRODUCT = YES;
346352
};
347353
name = Release;
@@ -355,6 +361,7 @@
355361
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
356362
PRODUCT_BUNDLE_IDENTIFIER = io.garriguv.SQLiteExample;
357363
PRODUCT_NAME = "$(TARGET_NAME)";
364+
SWIFT_VERSION = 3.0;
358365
};
359366
name = Debug;
360367
};
@@ -367,6 +374,7 @@
367374
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
368375
PRODUCT_BUNDLE_IDENTIFIER = io.garriguv.SQLiteExample;
369376
PRODUCT_NAME = "$(TARGET_NAME)";
377+
SWIFT_VERSION = 3.0;
370378
};
371379
name = Release;
372380
};

Example/SQLiteExample/AppDelegate.swift

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

66
var window: UIWindow?
77

8-
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject:AnyObject]?) -> Bool {
8+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
99

1010
guard let database = Database() else {
1111
fatalError("could not setup database")

Example/SQLiteExample/Database/Database.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,23 @@ struct Database {
2828
}
2929

3030
extension Database {
31-
static func storeURL() -> NSURL {
32-
guard let documentsURL = NSURL(string: NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)[0]) else {
31+
static func storeURL() -> URL {
32+
guard let documentsURL = URL(string: NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0]) else {
3333
fatalError("could not get user documents directory URL")
3434
}
3535

36-
return documentsURL.URLByAppendingPathComponent("store.sqlite")
36+
return documentsURL.appendingPathComponent("store.sqlite")
3737
}
3838

3939
static func migrations() -> [Migration] {
4040
return [ SeedDB() ]
4141
}
4242

43-
static func migrationsBundle() -> NSBundle {
44-
guard let bundleURL = NSBundle.mainBundle().URLForResource("Migrations", withExtension: "bundle") else {
43+
static func migrationsBundle() -> Bundle {
44+
guard let bundleURL = Bundle.main.url(forResource: "Migrations", withExtension: "bundle") else {
4545
fatalError("could not find migrations bundle")
4646
}
47-
guard let bundle = NSBundle(URL: bundleURL) else {
47+
guard let bundle = Bundle(url: bundleURL) else {
4848
fatalError("could not load migrations bundle")
4949
}
5050

Example/SQLiteExample/Database/Migrations/SeedDB.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ import SQLite
55
struct SeedDB: Migration {
66
var version: Int64 = 20160119131206685
77

8-
func migrateDatabase(db: Connection) throws {
8+
func migrateDatabase(_ db: Connection) throws {
99
let episodes = Table("episodes")
1010
let season = Expression<Int>("season")
1111
let name = Expression<String>("name")
1212

1313
try (1...24).map { "Episode \($0)" }.forEach {
14-
try db.run(episodes.insert(season <- 1, name <- $0))
14+
let _ = try db.run(episodes.insert(season <- 1, name <- $0))
1515
}
1616
}
1717
}

SQLiteMigrationManager.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@
365365
PRODUCT_BUNDLE_IDENTIFIER = io.garriguv.SQLiteMigrationManager;
366366
PRODUCT_NAME = "$(TARGET_NAME)";
367367
SKIP_INSTALL = YES;
368-
SWIFT_VERSION = 3.0;
368+
SWIFT_VERSION = 3.0.1;
369369
};
370370
name = Debug;
371371
};
@@ -386,7 +386,7 @@
386386
PRODUCT_BUNDLE_IDENTIFIER = io.garriguv.SQLiteMigrationManager;
387387
PRODUCT_NAME = "$(TARGET_NAME)";
388388
SKIP_INSTALL = YES;
389-
SWIFT_VERSION = 3.0;
389+
SWIFT_VERSION = 3.0.1;
390390
};
391391
name = Release;
392392
};

0 commit comments

Comments
 (0)