Skip to content

Commit

Permalink
Merge pull request #69 from RxSwiftCommunity/swift-4
Browse files Browse the repository at this point in the history
Swift 4 support
  • Loading branch information
jegnux authored Oct 19, 2017
2 parents e90294d + 0066240 commit 6fbf2b3
Show file tree
Hide file tree
Showing 36 changed files with 238 additions and 164 deletions.
3 changes: 1 addition & 2 deletions .swift-version
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
3.0

4.0
2 changes: 1 addition & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "ReactiveX/RxSwift" ~> 3.6.0
github "ReactiveX/RxSwift" ~> 4.0
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "ReactiveX/RxSwift" "3.6.1"
github "ReactiveX/RxSwift" "4.0.0"
2 changes: 1 addition & 1 deletion Carthage/Checkouts/RxSwift
Submodule RxSwift updated 393 files
2 changes: 1 addition & 1 deletion Example/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.0'
config.build_settings['SWIFT_VERSION'] = '4.0'
config.build_settings['MACOSX_DEPLOYMENT_TARGET'] = '10.10'
end
end
Expand Down
24 changes: 12 additions & 12 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
PODS:
- RxCocoa (3.6.1):
- RxSwift (~> 3.6)
- RxGesture (1.1.0):
- RxCocoa (~> 3.6)
- RxSwift (~> 3.6)
- RxSwift (3.6.1)
- RxCocoa (4.0.0):
- RxSwift (~> 4.0)
- RxGesture (1.2.0):
- RxCocoa (~> 4.0)
- RxSwift (~> 4.0)
- RxSwift (4.0.0)

DEPENDENCIES:
- RxGesture (from `../`)

EXTERNAL SOURCES:
RxGesture:
:path: "../"
:path: ../

SPEC CHECKSUMS:
RxCocoa: 84a08739ab186248c7f31ce4ee92d6f8a947d690
RxGesture: 063f6526ef4d5dccbbe5bb1b6cbbfa87c40e9edf
RxSwift: f9de85ea20cd2f7716ee5409fc13523dc638e4e4
RxCocoa: d62846ca96495d862fa4c59ea7d87e5031d7340e
RxGesture: 475ea0ad59c4d7e9fd69cd716de424d35c632c4a
RxSwift: fd680d75283beb5e2559486f3c0ff852f0d35334

PODFILE CHECKSUM: 87dce50e515c3ab9fbaaadbb035bac3159168996
PODFILE CHECKSUM: 0136f70245280ee3abce3dde436beef35ef1e177

COCOAPODS: 1.2.1
COCOAPODS: 1.3.1
4 changes: 2 additions & 2 deletions Example/RxGesture-OSX/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ import Cocoa

@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {
}

}
25 changes: 12 additions & 13 deletions Example/RxGesture-OSX/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import RxSwift
import RxCocoa
import RxGesture


class Step {
enum Action { case previous, next }

Expand Down Expand Up @@ -73,7 +72,7 @@ class MacViewController: NSViewController {
.startWith(0)
.map { (steps[$0], $0) }
.subscribe(onNext: { [unowned self] in self.updateStep($0, at: $1) })
.addDisposableTo(bag)
.disposed(by: bag)
}

override func viewDidAppear() {
Expand Down Expand Up @@ -117,7 +116,7 @@ class MacViewController: NSViewController {
.subscribe(onNext: { _ in
nextStep.onNext(.next)
})
.addDisposableTo(stepBag)
.disposed(by: stepBag)
})

lazy var doubleClickStep: Step = Step(
Expand All @@ -134,7 +133,7 @@ class MacViewController: NSViewController {
.subscribe(onNext: { _ in
nextStep.onNext(.next)
})
.addDisposableTo(stepBag)
.disposed(by: stepBag)
})

lazy var rightClickStep: Step = Step(
Expand All @@ -151,7 +150,7 @@ class MacViewController: NSViewController {
.subscribe(onNext: { _ in
nextStep.onNext(.next)
})
.addDisposableTo(stepBag)
.disposed(by: stepBag)
})

lazy var anyClickStep: Step = Step(
Expand All @@ -167,7 +166,7 @@ class MacViewController: NSViewController {
.when(.recognized)
.subscribe(onNext: { _ in
nextStep.onNext(.next)
}).addDisposableTo(stepBag)
}).disposed(by: stepBag)
})

lazy var pressStep: Step = Step(
Expand All @@ -184,7 +183,7 @@ class MacViewController: NSViewController {
.subscribe(onNext: { _ in
nextStep.onNext(.next)
})
.addDisposableTo(stepBag)
.disposed(by: stepBag)
})

lazy var panStep: Step = Step(
Expand All @@ -202,7 +201,7 @@ class MacViewController: NSViewController {
label.stringValue = String(format: "(%.f, %.f)", arguments: [translation.x, translation.y])
view.layer!.transform = CATransform3DMakeTranslation(translation.x, translation.y, 0.0)
})
.addDisposableTo(stepBag)
.disposed(by: stepBag)

view.rx
.anyGesture(
Expand All @@ -212,7 +211,7 @@ class MacViewController: NSViewController {
.subscribe(onNext: { _ in
nextStep.onNext(.next)
})
.addDisposableTo(stepBag)
.disposed(by: stepBag)
})

lazy var rotateStep: Step = Step(
Expand All @@ -230,7 +229,7 @@ class MacViewController: NSViewController {
label.stringValue = String(format: "angle: %.2f", rotation)
view.layer!.transform = CATransform3DMakeRotation(rotation, 0, 0, 1)
})
.addDisposableTo(stepBag)
.disposed(by: stepBag)

view.rx
.anyGesture(
Expand All @@ -240,7 +239,7 @@ class MacViewController: NSViewController {
.subscribe(onNext: { _ in
nextStep.onNext(.next)
})
.addDisposableTo(stepBag)
.disposed(by: stepBag)
})

lazy var magnificationStep: Step = Step(
Expand All @@ -258,7 +257,7 @@ class MacViewController: NSViewController {
label.stringValue = String(format: "scale: %.2f", scale)
view.layer!.transform = CATransform3DMakeScale(scale, scale, 1)
})
.addDisposableTo(stepBag)
.disposed(by: stepBag)

view.rx
.anyGesture(
Expand All @@ -268,7 +267,7 @@ class MacViewController: NSViewController {
.subscribe(onNext: { _ in
nextStep.onNext(.next)
})
.addDisposableTo(stepBag)
.disposed(by: stepBag)
})

}
Expand Down
56 changes: 48 additions & 8 deletions Example/RxGesture.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,13 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0730;
LastUpgradeCheck = 0820;
LastUpgradeCheck = 0900;
ORGANIZATIONNAME = CocoaPods;
TargetAttributes = {
607FACCF1AFB9204008FA782 = {
CreatedOnToolsVersion = 6.3.1;
DevelopmentTeam = GF5CUXMCNW;
LastSwiftMigration = 0800;
LastSwiftMigration = 0910;
};
9CBB5C8F1CA3D9C30089E3EA = {
CreatedOnToolsVersion = 7.3;
Expand Down Expand Up @@ -267,13 +267,16 @@
files = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-RxGesture_OSX_Demo-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
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";
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;
};
58D78C3A772A244F05D5E0CC /* [CP] Embed Pods Frameworks */ = {
Expand All @@ -282,9 +285,16 @@
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-RxGesture_iOS_Demo/Pods-RxGesture_iOS_Demo-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/RxCocoa-iOS/RxCocoa.framework",
"${BUILT_PRODUCTS_DIR}/RxGesture-iOS/RxGesture.framework",
"${BUILT_PRODUCTS_DIR}/RxSwift-iOS/RxSwift.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxCocoa.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxGesture.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxSwift.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
Expand Down Expand Up @@ -327,9 +337,16 @@
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-RxGesture_OSX_Demo/Pods-RxGesture_OSX_Demo-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/RxCocoa-macOS/RxCocoa.framework",
"${BUILT_PRODUCTS_DIR}/RxGesture-macOS/RxGesture.framework",
"${BUILT_PRODUCTS_DIR}/RxSwift-macOS/RxSwift.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxCocoa.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxGesture.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxSwift.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
Expand All @@ -342,13 +359,16 @@
files = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-RxGesture_iOS_Demo-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
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";
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 @@ -410,14 +430,20 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = 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_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand Down Expand Up @@ -446,6 +472,8 @@
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
Expand All @@ -457,14 +485,20 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = 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_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand All @@ -485,6 +519,8 @@
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
VALIDATE_PRODUCT = YES;
};
name = Release;
Expand All @@ -502,7 +538,8 @@
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
Expand All @@ -519,7 +556,8 @@
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
};
name = Release;
};
Expand All @@ -539,7 +577,8 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.underplot.RxGesture-OSX";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
Expand All @@ -558,7 +597,8 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.underplot.RxGesture-OSX";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0820"
LastUpgradeVersion = "0910"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -40,6 +40,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
Expand Down Expand Up @@ -79,6 +80,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
Loading

0 comments on commit 6fbf2b3

Please sign in to comment.