Skip to content

Commit

Permalink
Merge pull request #80 from prolificinteractive/chore/swift-4.2-update
Browse files Browse the repository at this point in the history
[Chore] Swift 4.2 Update
  • Loading branch information
malinkas86 authored Oct 22, 2018
2 parents ee6c767 + 2eae7cf commit fa8aa69
Show file tree
Hide file tree
Showing 13 changed files with 36 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0
4.2
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# * https://github.com/supermarin/xcpretty#usage

language: objective-c
osx_image: xcode9
osx_image: xcode10
# cache: cocoapods
# podfile: Example/Podfile

Expand All @@ -12,5 +12,5 @@ before_install:
- pod install --project-directory=Example

script:
- set -o pipefail && travis_retry xcodebuild test -project Yoshi/Yoshi.xcodeproj -scheme YoshiTests -destination 'platform=iOS Simulator,name=iPhone 6,OS=11.0' | xcpretty
- set -o pipefail && travis_retry xcodebuild test -project Yoshi/Yoshi.xcodeproj -scheme YoshiTests -destination 'platform=iOS Simulator,name=iPhone 8,OS=12.0' | xcpretty
- pod lib lint --allow-warnings
2 changes: 1 addition & 1 deletion Example/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
platform :ios, '12.0'
use_frameworks!

target 'YoshiExample' do
Expand Down
14 changes: 9 additions & 5 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
PODS:
- Instabug (5.2.4)
- Yoshi/Core (2.2.2)
- Yoshi/QAKit (2.2.2):
- Yoshi/Core (3.0.0-beta.2)
- Yoshi/QAKit (3.0.0-beta.2):
- Yoshi/Core

DEPENDENCIES:
- Instabug (= 5.2.4)
- Yoshi/QAKit (from `../`)

SPEC REPOS:
https://github.com/cocoapods/specs.git:
- Instabug

EXTERNAL SOURCES:
Yoshi:
:path: "../"

SPEC CHECKSUMS:
Instabug: 6fa40a5e2a4620f0589dfc8e4e01b1018c8c42b1
Yoshi: 032a56c87369104a3a1ee80a247e551d91bddc99
Yoshi: 1e0f101768c6f2d0cc289f64b065f54bc732d60a

PODFILE CHECKSUM: 3e1269998b54f9d27d611d2231c251556652c10a
PODFILE CHECKSUM: 6937f5f3704e17fb013434d20f6bd261b2e48f51

COCOAPODS: 1.2.0
COCOAPODS: 1.5.3
17 changes: 12 additions & 5 deletions Example/YoshiExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,12 @@
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-YoshiExample/Pods-YoshiExample-resources.sh",
"${PODS_ROOT}/Instabug/Instabug.bundle",
);
name = "[CP] Copy Pods Resources";
outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Instabug.bundle",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
Expand All @@ -222,9 +225,12 @@
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-YoshiExample/Pods-YoshiExample-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/Yoshi/Yoshi.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Yoshi.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
Expand All @@ -237,13 +243,16 @@
files = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-YoshiExample-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
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";
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/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# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
Expand Down Expand Up @@ -333,6 +342,7 @@
OTHER_SWIFT_FLAGS = "-D DEBUG";
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand Down Expand Up @@ -378,6 +388,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 4.2;
VALIDATE_PRODUCT = YES;
};
name = Release;
Expand All @@ -386,7 +397,6 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 611645F651489CBB0C351E8B /* Pods-YoshiExample.debug.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
Expand All @@ -402,7 +412,6 @@
SWIFT_OBJC_BRIDGING_HEADER = "YoshiExample/YoshiExample-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand All @@ -411,7 +420,6 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 4B69EFE97A45841AA3569F78 /* Pods-YoshiExample.release.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
Expand All @@ -427,7 +435,6 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "YoshiExample/YoshiExample-Bridging-Header.h";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
Expand Down
4 changes: 2 additions & 2 deletions Example/YoshiExample/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?

func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.

#if DEBUG
Expand Down Expand Up @@ -87,7 +87,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
// MARK: - Yoshi Invocation options
// Implement the functionality you want!

override func motionBegan(_ motion: UIEventSubtype, with event: UIEvent?) {
override func motionBegan(_ motion: UIEvent.EventSubtype, with event: UIEvent?) {
Yoshi.motionBegan(motion, withEvent: event)
}

Expand Down
2 changes: 1 addition & 1 deletion Yoshi.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = "Yoshi"
s.version = "3.0.0-beta.1"
s.version = "3.0.0-beta.2"
s.summary = "A helpful companion for your iOS app."

# This description is used to generate tags and improve search results.
Expand Down
4 changes: 2 additions & 2 deletions Yoshi/Yoshi.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -594,7 +594,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ public struct YoshiMenuCellDataSource: YoshiReusableCellDataSource {

private let subtitle: String?

private let accessoryType: UITableViewCellAccessoryType
private let accessoryType: UITableViewCell.AccessoryType

/// Initalize the YoshiMenuCellDataSource instance
///
/// - Parameters:
/// - title: Main title for the cell
/// - subtitle: Subtitle for the cell
public init(title: String, subtitle: String?, accessoryType: UITableViewCellAccessoryType = .none) {
public init(title: String, subtitle: String?, accessoryType: UITableViewCell.AccessoryType = .none) {
self.title = title
self.subtitle = subtitle
self.accessoryType = accessoryType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public typealias YoshiSingleSelection = (title: String, subtitle: String?)
/// Once provided with initial selection and options, Yoshi will maintain the selection and present them in a tableview.
open class YoshiSingleSelectionMenu: YoshiSubmenu {

open let title: String
public let title: String

open var subtitle: String? {
return availableSelections[selectedIndex].title
Expand Down
2 changes: 1 addition & 1 deletion Yoshi/Yoshi/Utility/Extensions/UIWindowExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ extension UIWindow {
return 60
}

override open func motionBegan(_ motion: UIEventSubtype, with event: UIEvent?) {
override open func motionBegan(_ motion: UIEvent.EventSubtype, with event: UIEvent?) {
Yoshi.motionBegan(motion, withEvent: event)
}

Expand Down
2 changes: 1 addition & 1 deletion Yoshi/Yoshi/Yoshi.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public final class Yoshi {
- parameter motion: (UIEventSubtype) the motion captured by the original motionBegan call
- parameter event: (UIEvent) the event captured by the original motionBegan call
*/
public class func motionBegan(_ motion: UIEventSubtype, withEvent event: UIEvent?) {
public class func motionBegan(_ motion: UIEvent.EventSubtype, withEvent event: UIEvent?) {
guard motion == .motionShake
&& YoshiConfigurationManager.sharedInstance.shouldShow(.shakeMotionGesture) else {
return
Expand Down
2 changes: 1 addition & 1 deletion Yoshi/Yoshi/YoshiConfigurationManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ internal final class YoshiConfigurationManager {
}

let window = UIWindow(frame: UIScreen.main.bounds)
window.windowLevel = UIWindowLevelNormal
window.windowLevel = .normal

// Use a dummy view controller with clear background.
// This way, we can make the actual view controller we want to present a form sheet on the iPad.
Expand Down

0 comments on commit fa8aa69

Please sign in to comment.