Skip to content

Commit 3ad82ef

Browse files
committed
migrate to Swift 4.2
1 parent e44305f commit 3ad82ef

File tree

13 files changed

+38
-22
lines changed

13 files changed

+38
-22
lines changed

.swift-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.0
1+
4.2

YNSearch.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
Pod::Spec.new do |s|
1010
s.name = 'YNSearch'
11-
s.version = '2.3.1'
11+
s.version = '2.3.2'
1212
s.summary = 'Awesome fully customizable search view written in Swift 4'
1313

1414
s.description = <<-DESC

YNSearch.xcodeproj/project.pbxproj

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -227,18 +227,19 @@
227227
isa = PBXProject;
228228
attributes = {
229229
LastSwiftUpdateCheck = 0830;
230-
LastUpgradeCheck = 0900;
230+
LastUpgradeCheck = 1000;
231231
ORGANIZATIONNAME = SeungyounYi;
232232
TargetAttributes = {
233233
19D22E2D1EA7A8F6006DF0AC = {
234234
CreatedOnToolsVersion = 8.3.2;
235235
DevelopmentTeam = 4G7K3CN2JU;
236-
LastSwiftMigration = 0830;
236+
LastSwiftMigration = 1000;
237237
ProvisioningStyle = Automatic;
238238
};
239239
19FE321A1EA7B77C00A4DB5E = {
240240
CreatedOnToolsVersion = 8.3.2;
241241
DevelopmentTeam = 4G7K3CN2JU;
242+
LastSwiftMigration = 1000;
242243
ProvisioningStyle = Automatic;
243244
};
244245
};
@@ -367,13 +368,15 @@
367368
CLANG_WARN_BOOL_CONVERSION = YES;
368369
CLANG_WARN_COMMA = YES;
369370
CLANG_WARN_CONSTANT_CONVERSION = YES;
371+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
370372
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
371373
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
372374
CLANG_WARN_EMPTY_BODY = YES;
373375
CLANG_WARN_ENUM_CONVERSION = YES;
374376
CLANG_WARN_INFINITE_RECURSION = YES;
375377
CLANG_WARN_INT_CONVERSION = YES;
376378
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
379+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
377380
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
378381
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
379382
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -407,7 +410,7 @@
407410
SDKROOT = iphoneos;
408411
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
409412
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
410-
SWIFT_VERSION = 4.0;
413+
SWIFT_VERSION = 4.2;
411414
TARGETED_DEVICE_FAMILY = "1,2";
412415
VERSIONING_SYSTEM = "apple-generic";
413416
VERSION_INFO_PREFIX = "";
@@ -428,13 +431,15 @@
428431
CLANG_WARN_BOOL_CONVERSION = YES;
429432
CLANG_WARN_COMMA = YES;
430433
CLANG_WARN_CONSTANT_CONVERSION = YES;
434+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
431435
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
432436
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
433437
CLANG_WARN_EMPTY_BODY = YES;
434438
CLANG_WARN_ENUM_CONVERSION = YES;
435439
CLANG_WARN_INFINITE_RECURSION = YES;
436440
CLANG_WARN_INT_CONVERSION = YES;
437441
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
442+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
438443
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
439444
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
440445
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -460,7 +465,7 @@
460465
MTL_ENABLE_DEBUG_INFO = NO;
461466
SDKROOT = iphoneos;
462467
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
463-
SWIFT_VERSION = 4.0;
468+
SWIFT_VERSION = 4.2;
464469
TARGETED_DEVICE_FAMILY = "1,2";
465470
VALIDATE_PRODUCT = YES;
466471
VERSIONING_SYSTEM = "apple-generic";
@@ -486,7 +491,7 @@
486491
PRODUCT_NAME = "$(TARGET_NAME)";
487492
SKIP_INSTALL = YES;
488493
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
489-
SWIFT_VERSION = 4.0;
494+
SWIFT_VERSION = 4.2;
490495
};
491496
name = Debug;
492497
};
@@ -507,7 +512,7 @@
507512
PRODUCT_BUNDLE_IDENTIFIER = com.seungyounyi.YNSearch;
508513
PRODUCT_NAME = "$(TARGET_NAME)";
509514
SKIP_INSTALL = YES;
510-
SWIFT_VERSION = 4.0;
515+
SWIFT_VERSION = 4.2;
511516
};
512517
name = Release;
513518
};
@@ -521,7 +526,7 @@
521526
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
522527
PRODUCT_BUNDLE_IDENTIFIER = com.seungyounyi.YNSearchDemo;
523528
PRODUCT_NAME = "$(TARGET_NAME)";
524-
SWIFT_VERSION = 4.0;
529+
SWIFT_VERSION = 4.2;
525530
};
526531
name = Debug;
527532
};
@@ -535,7 +540,7 @@
535540
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
536541
PRODUCT_BUNDLE_IDENTIFIER = com.seungyounyi.YNSearchDemo;
537542
PRODUCT_NAME = "$(TARGET_NAME)";
538-
SWIFT_VERSION = 4.0;
543+
SWIFT_VERSION = 4.2;
539544
};
540545
name = Release;
541546
};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

YNSearch.xcodeproj/xcshareddata/xcschemes/YNSearch.xcscheme

Lines changed: 1 addition & 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 = "0900"
3+
LastUpgradeVersion = "1000"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,7 +26,6 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
language = ""
3029
shouldUseLaunchSchemeArgsEnv = "YES">
3130
<Testables>
3231
</Testables>
@@ -37,7 +36,6 @@
3736
buildConfiguration = "Debug"
3837
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
3938
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
40-
language = ""
4139
launchStyle = "0"
4240
useCustomWorkingDirectory = "NO"
4341
ignoresPersistentStateOnLaunch = "NO"

YNSearch/Objectification.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public class Objectification {
5353
}
5454

5555
private func properties(mirror: Mirror) -> [String] {
56-
return mirror.children.flatMap { $0.label }
56+
return mirror.children.compactMap { $0.label }
5757
}
5858

5959
private func values(mirror: Mirror) -> [String] {
@@ -66,7 +66,7 @@ public class Objectification {
6666
}
6767

6868
private func all(mirror: Mirror) -> [String] {
69-
return mirror.children.flatMap { $0.label } + values(mirror: mirror)
69+
return mirror.children.compactMap { $0.label } + values(mirror: mirror)
7070
}
7171

7272
private func checkArray(object: Any) -> [String] {

YNSearch/YNSearch.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import UIKit
1111
open class YNSearch: NSObject {
1212
var pref: UserDefaults!
1313

14-
open static let shared: YNSearch = YNSearch()
14+
public static let shared: YNSearch = YNSearch()
1515

1616
public override init() {
1717
pref = UserDefaults.standard

YNSearch/YNSearchListView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ open class YNSearchListView: UITableView, UITableViewDelegate, UITableViewDataSo
2929
}
3030
}
3131

32-
public override init(frame: CGRect, style: UITableViewStyle) {
32+
public override init(frame: CGRect, style: UITableView.Style) {
3333
super.init(frame: frame, style: style)
3434
self.initView()
3535
}

YNSearch/YNSearchListViewCell.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
import UIKit
1010

1111
open class YNSearchListViewCell: UITableViewCell {
12-
open static let ID = "YNSearchListViewCell"
12+
public static let ID = "YNSearchListViewCell"
1313

1414
var leftMargin = 15
1515

1616
open var searchImageView: UIImageView!
1717
open var searchLabel: UILabel!
1818

19-
override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
19+
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
2020
super.init(style: style, reuseIdentifier: reuseIdentifier)
2121

2222
self.initView()

YNSearch/YNSearchMainView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ open class YNSearchMainView: UIView {
7373
self.addSubview(self.categoryLabel)
7474

7575
let font = UIFont.systemFont(ofSize: 12)
76-
let userAttributes = [NSAttributedStringKey.font : font, NSAttributedStringKey.foregroundColor: UIColor.gray]
76+
let userAttributes = [NSAttributedString.Key.font : font, NSAttributedString.Key.foregroundColor: UIColor.gray]
7777

7878
var formerWidth: CGFloat = margin
7979
var formerHeight: CGFloat = 50

0 commit comments

Comments
 (0)