Skip to content

Commit b7a4792

Browse files
authored
Merge pull request #45 from RxSwiftCommunity/feature/swift3
Support for Swift 3 (and Xcode 9.2 beta 2) 🎉
2 parents 95d59b2 + 50f2eb8 commit b7a4792

22 files changed

+196
-232
lines changed

.travis.yml

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
language: objective-c
2-
osx_image: xcode7.3
2+
osx_image: xcode8.3
33
rvm:
4-
- "2.3.1"
4+
- "2.4.1"
55

66
env:
77
global:
@@ -12,9 +12,6 @@ env:
1212
- OS=macos
1313
- OS=tvos
1414

15-
before_install:
16-
- brew install swiftlint
17-
1815
install:
1916
- gem install bundler --no-doc --no-ri
2017
- bundle install --path="./.vendor/bundle"

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Change Log
22

33
## [Unreleased](https://github.com/RxSwiftCommunity/RxViewModel/tree/HEAD)
4+
- Support for Swift 3 & 4 [\#45](https://github.com/RxSwiftCommunity/RxViewModel/pull/45) ([freak4pc](https://github.com/freak4pc))
45

56
[Full Changelog](https://github.com/RxSwiftCommunity/RxViewModel/compare/3.1.3...HEAD)
67

Cartfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
github "ReactiveX/RxSwift" ~> 2.5
1+
github "ReactiveX/RxSwift" ~> 3.4

Cartfile.resolved

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
github "ReactiveX/RxSwift" "2.6.0"
1+
github "ReactiveX/RxSwift" "3.5.0"

Carthage/Checkouts/RxSwift

Submodule RxSwift updated 1159 files

Demo/.swift-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.0

Demo/Demo.xcodeproj/project.pbxproj

+15-7
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@
309309
};
310310
607FACE41AFB9204008FA782 = {
311311
CreatedOnToolsVersion = 6.3.1;
312-
TestTargetID = 607FACCF1AFB9204008FA782;
312+
TestTargetID = 1168B9761D2DFF2A00784841;
313313
};
314314
};
315315
};
@@ -411,7 +411,7 @@
411411
);
412412
runOnlyForDeploymentPostprocessing = 0;
413413
shellPath = /bin/sh;
414-
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
414+
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";
415415
showEnvVarsInLog = 0;
416416
};
417417
3B32E276864ED8DE0A42EB66 /* [CP] Copy Pods Resources */ = {
@@ -456,7 +456,7 @@
456456
);
457457
runOnlyForDeploymentPostprocessing = 0;
458458
shellPath = /bin/sh;
459-
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
459+
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";
460460
showEnvVarsInLog = 0;
461461
};
462462
74F4425F80A70ACF54C96776 /* [CP] Check Pods Manifest.lock */ = {
@@ -471,7 +471,7 @@
471471
);
472472
runOnlyForDeploymentPostprocessing = 0;
473473
shellPath = /bin/sh;
474-
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
474+
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";
475475
showEnvVarsInLog = 0;
476476
};
477477
8B85B57729C5E3D4D213BC72 /* [CP] Copy Pods Resources */ = {
@@ -531,7 +531,7 @@
531531
);
532532
runOnlyForDeploymentPostprocessing = 0;
533533
shellPath = /bin/sh;
534-
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
534+
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";
535535
showEnvVarsInLog = 0;
536536
};
537537
F088206876394936F4C2A77D /* [CP] Copy Pods Resources */ = {
@@ -627,6 +627,7 @@
627627
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks $(FRAMEWORK_SEARCH_PATHS)";
628628
PRODUCT_BUNDLE_IDENTIFIER = es.estebantorr.Demo;
629629
PRODUCT_NAME = "$(TARGET_NAME)";
630+
SWIFT_VERSION = 3.0;
630631
};
631632
name = Debug;
632633
};
@@ -641,6 +642,7 @@
641642
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks $(FRAMEWORK_SEARCH_PATHS)";
642643
PRODUCT_BUNDLE_IDENTIFIER = es.estebantorr.Demo;
643644
PRODUCT_NAME = "$(TARGET_NAME)";
645+
SWIFT_VERSION = 3.0;
644646
};
645647
name = Release;
646648
};
@@ -655,6 +657,7 @@
655657
PRODUCT_BUNDLE_IDENTIFIER = "es.estebantorr.RxViewModelTests-tvOS";
656658
PRODUCT_NAME = "$(TARGET_NAME)";
657659
SDKROOT = appletvos;
660+
SWIFT_VERSION = 3.0;
658661
TVOS_DEPLOYMENT_TARGET = 9.2;
659662
};
660663
name = Debug;
@@ -669,6 +672,7 @@
669672
PRODUCT_BUNDLE_IDENTIFIER = "es.estebantorr.RxViewModelTests-tvOS";
670673
PRODUCT_NAME = "$(TARGET_NAME)";
671674
SDKROOT = appletvos;
675+
SWIFT_VERSION = 3.0;
672676
TVOS_DEPLOYMENT_TARGET = 9.2;
673677
};
674678
name = Release;
@@ -687,6 +691,7 @@
687691
PRODUCT_BUNDLE_IDENTIFIER = "es.estebantorr.RxViewModelTests-macOS";
688692
PRODUCT_NAME = "$(TARGET_NAME)";
689693
SDKROOT = macosx;
694+
SWIFT_VERSION = 3.0;
690695
};
691696
name = Debug;
692697
};
@@ -703,6 +708,7 @@
703708
PRODUCT_BUNDLE_IDENTIFIER = "es.estebantorr.RxViewModelTests-macOS";
704709
PRODUCT_NAME = "$(TARGET_NAME)";
705710
SDKROOT = macosx;
711+
SWIFT_VERSION = 3.0;
706712
};
707713
name = Release;
708714
};
@@ -803,7 +809,8 @@
803809
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks $(FRAMEWORK_SEARCH_PATHS)";
804810
PRODUCT_BUNDLE_IDENTIFIER = "es.estebantorr.$(PRODUCT_NAME:rfc1034identifier)";
805811
PRODUCT_NAME = "$(TARGET_NAME)";
806-
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/tmp_Example.app/tmp_Example";
812+
SWIFT_VERSION = 3.0;
813+
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Demo.app/Demo";
807814
};
808815
name = Debug;
809816
};
@@ -816,7 +823,8 @@
816823
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks $(FRAMEWORK_SEARCH_PATHS)";
817824
PRODUCT_BUNDLE_IDENTIFIER = "es.estebantorr.$(PRODUCT_NAME:rfc1034identifier)";
818825
PRODUCT_NAME = "$(TARGET_NAME)";
819-
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/tmp_Example.app/tmp_Example";
826+
SWIFT_VERSION = 3.0;
827+
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Demo.app/Demo";
820828
};
821829
name = Release;
822830
};

Demo/Demo.xcodeproj/xcshareddata/xcschemes/Demo.xcscheme

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0730"
3+
LastUpgradeVersion = "0830"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Demo/Demo.xcodeproj/xcshareddata/xcschemes/RxViewModelTests-macOS.xcscheme

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0730"
3+
LastUpgradeVersion = "0830"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Demo/Demo.xcodeproj/xcshareddata/xcschemes/RxViewModelTests-tvOS.xcscheme

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0730"
3+
LastUpgradeVersion = "0830"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Demo/Demo/AppDelegate.swift

+4-31
Original file line numberDiff line numberDiff line change
@@ -10,36 +10,9 @@ import UIKit
1010

1111
@UIApplicationMain
1212
class AppDelegate: UIResponder, UIApplicationDelegate {
13+
var window: UIWindow?
1314

14-
var window: UIWindow?
15-
16-
17-
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
18-
// Override point for customization after application launch.
19-
return true
20-
}
21-
22-
func applicationWillResignActive(application: UIApplication) {
23-
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
24-
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
25-
}
26-
27-
func applicationDidEnterBackground(application: UIApplication) {
28-
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
29-
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
30-
}
31-
32-
func applicationWillEnterForeground(application: UIApplication) {
33-
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
34-
}
35-
36-
func applicationDidBecomeActive(application: UIApplication) {
37-
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
38-
}
39-
40-
func applicationWillTerminate(application: UIApplication) {
41-
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
42-
}
43-
44-
15+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
16+
return true
17+
}
4518
}

Demo/Demo/ViewController.swift

-8
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,8 @@
99
import UIKit
1010

1111
class ViewController: UIViewController {
12-
1312
override func viewDidLoad() {
1413
super.viewDidLoad()
15-
// Do any additional setup after loading the view, typically from a nib.
16-
}
17-
18-
override func didReceiveMemoryWarning() {
19-
super.didReceiveMemoryWarning()
20-
// Dispose of any resources that can be recreated.
2114
}
2215

23-
2416
}

Demo/Podfile

+2-16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
source 'https://github.com/CocoaPods/Specs.git'
22

33
use_frameworks!
4+
inhibit_all_warnings!
45

56
# Test Libraries
67
def test_pods
@@ -36,19 +37,4 @@ target 'RxViewModelTests-macOS' do
3637
library
3738

3839
test_pods
39-
end
40-
41-
# Hack to fix testability until cocoapods gets an update
42-
post_install do |installer|
43-
installer.pods_project.targets.each do |target|
44-
target.build_configurations.each do |config|
45-
if config.name == 'Debug'
46-
config.build_settings['ENABLE_TESTABILITY'] = 'YES'
47-
48-
if target.name.include? "RxViewModel-"
49-
config.build_settings['CLANG_ENABLE_CODE_COVERAGE'] = 'YES'
50-
end
51-
end
52-
end
53-
end
54-
end
40+
end

Demo/Podfile.lock

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
PODS:
2-
- Nimble (4.1.0)
3-
- Quick (0.9.2)
4-
- RxSwift (2.5.0)
5-
- RxViewModel (3.1.4):
6-
- RxSwift (~> 2.5)
2+
- Nimble (7.0.1)
3+
- Quick (1.1.0)
4+
- RxSwift (3.4.0)
5+
- RxViewModel (4.0.0):
6+
- RxSwift (~> 3.4)
77

88
DEPENDENCIES:
99
- Nimble
@@ -15,11 +15,11 @@ EXTERNAL SOURCES:
1515
:path: "../"
1616

1717
SPEC CHECKSUMS:
18-
Nimble: 97a0a4cae5124c117115634b2d055d8c97d0af19
19-
Quick: 18d057bc66451eedd5d1c8dc99ba2a5db6e60226
20-
RxSwift: 402b41a50e922a0368fc14cb3bc9f4427920e8ae
21-
RxViewModel: cb396b511b9b94bd7a253b86b6b5a65e2b36043e
18+
Nimble: 657d000e11df8aebe27cdaf9d244de7f30ed87f7
19+
Quick: dafc587e21eed9f4cab3249b9f9015b0b7a7f71d
20+
RxSwift: 3789a1af753002a14edecdb698a2424624296a9c
21+
RxViewModel: f306c2963ff6978705c07a5c299abc5cc9f9a982
2222

23-
PODFILE CHECKSUM: 3783e79cefc5ffb9fe32d2e6f6d48bf5ec74e93f
23+
PODFILE CHECKSUM: 5b740ff0f8e82b1a56bee6decd0acad5bd6013b9
2424

25-
COCOAPODS: 1.0.1
25+
COCOAPODS: 1.2.1

0 commit comments

Comments
 (0)