Skip to content

Commit f0a3a97

Browse files
authored
Feature/swift4 (#11)
* Perform automatic source migration to Swift4 * Automatic updates for project files * Remove deprecated string functions in favor of Swift 4 methods * Update the podspec and documentation * Clean up existing warnings * Bump version number to 1.2.0
1 parent d74e262 commit f0a3a97

9 files changed

Lines changed: 42 additions & 16 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## v1.1.1 (June 23, 2018)
2+
3+
* Additional updates for Swift 4, cleaning up the project and deprecated usages.
4+
15
## v1.1.0 (June 19, 2018)
26

37
* Update pods to support Swift 4 versions of dependencies.

Example/GABoardGameGeek.xcodeproj/project.pbxproj

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,12 @@
141141
isa = PBXProject;
142142
attributes = {
143143
LastSwiftUpdateCheck = 0720;
144-
LastUpgradeCheck = 0820;
144+
LastUpgradeCheck = 0940;
145145
ORGANIZATIONNAME = CocoaPods;
146146
TargetAttributes = {
147147
607FACE41AFB9204008FA782 = {
148148
CreatedOnToolsVersion = 6.3.1;
149-
LastSwiftMigration = 0820;
149+
LastSwiftMigration = 0940;
150150
TestTargetID = 607FACCF1AFB9204008FA782;
151151
};
152152
};
@@ -252,14 +252,22 @@
252252
CLANG_CXX_LIBRARY = "libc++";
253253
CLANG_ENABLE_MODULES = YES;
254254
CLANG_ENABLE_OBJC_ARC = YES;
255+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
255256
CLANG_WARN_BOOL_CONVERSION = YES;
257+
CLANG_WARN_COMMA = YES;
256258
CLANG_WARN_CONSTANT_CONVERSION = YES;
259+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
257260
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
258261
CLANG_WARN_EMPTY_BODY = YES;
259262
CLANG_WARN_ENUM_CONVERSION = YES;
260263
CLANG_WARN_INFINITE_RECURSION = YES;
261264
CLANG_WARN_INT_CONVERSION = YES;
265+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
266+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
267+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
262268
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
269+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
270+
CLANG_WARN_STRICT_PROTOTYPES = YES;
263271
CLANG_WARN_SUSPICIOUS_MOVE = YES;
264272
CLANG_WARN_UNREACHABLE_CODE = YES;
265273
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -299,14 +307,22 @@
299307
CLANG_CXX_LIBRARY = "libc++";
300308
CLANG_ENABLE_MODULES = YES;
301309
CLANG_ENABLE_OBJC_ARC = YES;
310+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
302311
CLANG_WARN_BOOL_CONVERSION = YES;
312+
CLANG_WARN_COMMA = YES;
303313
CLANG_WARN_CONSTANT_CONVERSION = YES;
314+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
304315
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
305316
CLANG_WARN_EMPTY_BODY = YES;
306317
CLANG_WARN_ENUM_CONVERSION = YES;
307318
CLANG_WARN_INFINITE_RECURSION = YES;
308319
CLANG_WARN_INT_CONVERSION = YES;
320+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
321+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
322+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
309323
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
324+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
325+
CLANG_WARN_STRICT_PROTOTYPES = YES;
310326
CLANG_WARN_SUSPICIOUS_MOVE = YES;
311327
CLANG_WARN_UNREACHABLE_CODE = YES;
312328
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -335,7 +351,7 @@
335351
isa = XCBuildConfiguration;
336352
baseConfigurationReference = 9DBE8ADBA401567C3671C127 /* Pods-GABoardGameGeek_Tests.debug.xcconfig */;
337353
buildSettings = {
338-
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
354+
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)";
339355
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
340356
GCC_PREPROCESSOR_DEFINITIONS = (
341357
"DEBUG=1",
@@ -345,21 +361,23 @@
345361
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
346362
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
347363
PRODUCT_NAME = "$(TARGET_NAME)";
348-
SWIFT_VERSION = 3.0;
364+
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
365+
SWIFT_VERSION = 4.0;
349366
};
350367
name = Debug;
351368
};
352369
607FACF41AFB9204008FA782 /* Release */ = {
353370
isa = XCBuildConfiguration;
354371
baseConfigurationReference = 3CD75A01818909122282EE04 /* Pods-GABoardGameGeek_Tests.release.xcconfig */;
355372
buildSettings = {
356-
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
373+
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)";
357374
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
358375
INFOPLIST_FILE = Tests/Info.plist;
359376
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
360377
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
361378
PRODUCT_NAME = "$(TARGET_NAME)";
362-
SWIFT_VERSION = 3.0;
379+
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
380+
SWIFT_VERSION = 4.0;
363381
};
364382
name = Release;
365383
};

Example/GABoardGameGeek.xcodeproj/xcshareddata/xcschemes/GABoardGameGeek-Example.xcscheme

Lines changed: 3 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 = "0820"
3+
LastUpgradeVersion = "0940"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -40,8 +40,8 @@
4040
buildConfiguration = "Debug"
4141
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4242
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
43-
shouldUseLaunchSchemeArgsEnv = "YES"
44-
codeCoverageEnabled = "YES">
43+
codeCoverageEnabled = "YES"
44+
shouldUseLaunchSchemeArgsEnv = "YES">
4545
<Testables>
4646
<TestableReference
4747
skipped = "NO">

Example/Podfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
use_frameworks!
2+
3+
platform :ios, '9.0'
4+
25
target 'GABoardGameGeek_Tests' do
36
pod 'GABoardGameGeek', :path => '../'
47

Example/Podfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
PODS:
22
- Alamofire (4.7.2)
3-
- GABoardGameGeek (1.0.0):
3+
- GABoardGameGeek (1.2.0):
44
- Alamofire
55
- SWXMLHash
66
- Nimble (7.1.2)
@@ -43,12 +43,12 @@ EXTERNAL SOURCES:
4343

4444
SPEC CHECKSUMS:
4545
Alamofire: e4fa87002c137ba2d8d634d2c51fabcda0d5c223
46-
GABoardGameGeek: c3939bf394df20648cef010e57690e69274a3a82
46+
GABoardGameGeek: 75611b3474f4dbc6f02226c6e55d7390a4a96fd7
4747
Nimble: 3835ba9f459daa6b347f8a8e110aaae8ca1920a8
4848
OHHTTPStubs: 1e21c7d2c084b8153fc53d48400d8919d2d432d0
4949
Quick: 03278013f71aa05fe9ecabc94fbcc6835f1ee76f
5050
SWXMLHash: f4522438189f72b41e39676d19469a8969d60dd1
5151

52-
PODFILE CHECKSUM: 54474ed4c073938fd2dbb3036f9e72cce6b2fad8
52+
PODFILE CHECKSUM: c1d49c01375be0edda60080b38a7b403428e213a
5353

5454
COCOAPODS: 1.5.3

GABoardGameGeek.podspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ to deal with the complexities of parsing and error-checking the XML.
2020
s.tvos.deployment_target = '9.0'
2121

2222
s.source_files = 'GABoardGameGeek/Classes/**/*'
23+
s.swift_version = '4.0'
2324

2425
s.dependency 'Alamofire'
2526
s.dependency 'SWXMLHash'

GABoardGameGeek/Classes/Utils.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ internal extension String {
3030
- returns: A substring that can be sorted alphabetically.
3131
*/
3232
func getSortString(_ sortIndex: Int) -> String {
33-
if sortIndex <= 1 || sortIndex > self.characters.count {
33+
if sortIndex <= 1 || sortIndex > self.count {
3434
return self
3535
} else {
36-
return self.substring(from: self.characters.index(self.startIndex, offsetBy: sortIndex - 1))
36+
return String(self[self.index(self.startIndex, offsetBy: sortIndex - 1)...]);
3737
}
3838
}
3939
}

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2016 Geoff Amey <gca3020@users.noreply.github.com>
1+
Copyright (c) 2018 Geoff Amey <gca3020@users.noreply.github.com>
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ BoardGameGeek XMLAPI2 Swift Framework for interacting with games and collections
2020
## Requirements
2121

2222
- iOS 8.0+, macOS 10.10+, tvOS 9.0+, watchOS 2.0+
23-
- Xcode 8.1+
23+
- Xcode 9.0+
2424
- Swift 4.0
2525

2626
## Dependencies

0 commit comments

Comments
 (0)