Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swift 4.2 Migration #41

Merged
merged 5 commits into from Sep 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .swift-version
@@ -1 +1 @@
4.0
4.2
1 change: 1 addition & 0 deletions CHANGELOG.md
@@ -1,6 +1,7 @@
# Change Log

## [Unreleased]
* [#41](https://github.com/Blackjacx/SHSearchBar/pull/41): Swift 4.2 - [@blackjacx](https://github.com/blackjacx).

## [1.4.3] - 2018-07-12
* [#39](https://github.com/Blackjacx/SHSearchBar/pull/39): Make localized extension internal - [@blackjacx](https://github.com/blackjacx).
Expand Down
9 changes: 6 additions & 3 deletions Example/Podfile
@@ -1,13 +1,16 @@
platform :ios, '9.0'
use_frameworks!

# ignore all warnings from all pods
inhibit_all_warnings!

target 'SHSearchBar_Example' do
pod 'SHSearchBar', :path => '../'

target 'SHSearchBar_Tests' do
inherit! :search_paths

pod 'Quick', '~> 1.2.0'
pod 'Nimble', '~> 7.0.2'
pod 'Quick'
pod 'Nimble'
end
end
end
18 changes: 9 additions & 9 deletions Example/Podfile.lock
@@ -1,11 +1,11 @@
PODS:
- Nimble (7.0.3)
- Quick (1.2.0)
- SHSearchBar (1.4.2)
- Nimble (7.3.1)
- Quick (1.3.2)
- SHSearchBar (1.4.3)

DEPENDENCIES:
- Nimble (~> 7.0.2)
- Quick (~> 1.2.0)
- Nimble
- Quick
- SHSearchBar (from `../`)

SPEC REPOS:
Expand All @@ -18,10 +18,10 @@ EXTERNAL SOURCES:
:path: "../"

SPEC CHECKSUMS:
Nimble: 7f5a9c447a33002645a071bddafbfb24ea70e0ac
Quick: 58d203b1c5e27fff7229c4c1ae445ad7069a7a08
SHSearchBar: 1dbf4c712c66c764c5463471f86c37b20df9bcfe
Nimble: 04f732da099ea4d153122aec8c2a88fd0c7219ae
Quick: 2623cb30d7a7f41ca62f684f679586558f483d46
SHSearchBar: 9348be4524c9b7630891f5c0827719bc1996e55a

PODFILE CHECKSUM: b2f7b434f9f12c2e8304b00e3983b43b76652086
PODFILE CHECKSUM: bafa9295d0d82a5003cf14c577a68b7ca4bbe61b

COCOAPODS: 1.5.3
32 changes: 13 additions & 19 deletions Example/SHSearchBar.xcodeproj/project.pbxproj
Expand Up @@ -227,17 +227,17 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0830;
LastUpgradeCheck = 0830;
LastUpgradeCheck = 1000;
ORGANIZATIONNAME = CocoaPods;
TargetAttributes = {
607FACCF1AFB9204008FA782 = {
CreatedOnToolsVersion = 6.3.1;
DevelopmentTeam = PCW579R278;
LastSwiftMigration = 0900;
LastSwiftMigration = 1000;
};
607FACE41AFB9204008FA782 = {
CreatedOnToolsVersion = 6.3.1;
LastSwiftMigration = 0900;
LastSwiftMigration = 1000;
TestTargetID = 607FACCF1AFB9204008FA782;
};
};
Expand Down Expand Up @@ -436,6 +436,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
Expand All @@ -444,12 +445,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
Expand Down Expand Up @@ -488,6 +491,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
Expand All @@ -496,12 +500,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
Expand Down Expand Up @@ -541,8 +547,7 @@
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
VERSIONING_SYSTEM = "apple-generic";
};
name = Debug;
Expand All @@ -559,8 +564,7 @@
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
VERSIONING_SYSTEM = "apple-generic";
};
name = Release;
Expand All @@ -570,10 +574,6 @@
baseConfigurationReference = 155C0B974831EDF00FEDD99F /* Pods-SHSearchBar_Tests.debug.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
);
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
Expand All @@ -582,8 +582,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SHSearchBar_Example.app/SHSearchBar_Example";
};
name = Debug;
Expand All @@ -593,16 +592,11 @@
baseConfigurationReference = 55ED08248C3B1B7D84327940 /* Pods-SHSearchBar_Tests.release.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
);
INFOPLIST_FILE = Tests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SHSearchBar_Example.app/SHSearchBar_Example";
};
name = Release;
Expand Down
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "1000"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -40,7 +40,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
Expand Down Expand Up @@ -70,7 +69,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
2 changes: 1 addition & 1 deletion Example/SHSearchBar/AppDelegate.swift
Expand Up @@ -14,7 +14,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]? = [:]) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = [:]) -> Bool {
return true
}

Expand Down
2 changes: 1 addition & 1 deletion Example/SHSearchBar/SearchBarTitleView.swift
Expand Up @@ -40,7 +40,7 @@ class SearchbarTitleView: UIView {

// This is important to make the title view expanding from left to right
override var intrinsicContentSize: CGSize {
return UILayoutFittingExpandedSize
return UIView.layoutFittingExpandedSize
}
}

2 changes: 1 addition & 1 deletion Example/Tests/SHSearchBarSpec.swift
Expand Up @@ -642,7 +642,7 @@ class SharedConfiguration: QuickConfiguration {
expected[.foregroundColor] = searchbar.isActive ? expectedTextColor : expectedTextColor?.withAlphaComponent(0.5)

for key in expected.keys {
guard let value = attributes[key.rawValue] as? UIColor, let expectedValue = expected[key] as? UIColor else {
guard let value = attributes[key] as? UIColor, let expectedValue = expected[key] as? UIColor else {
XCTFail("Value or expected value not found for key \(key)")
return
}
Expand Down