Skip to content

Commit 06b7b21

Browse files
M0rtyMerrfreak4pc
authored andcommitted
Migrate example app to swift 5
1 parent 76973cd commit 06b7b21

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

Examples/Example.xcodeproj/project.pbxproj

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -910,6 +910,7 @@
910910
PRODUCT_BUNDLE_IDENTIFIER = io.rx.Tests;
911911
PRODUCT_NAME = "$(TARGET_NAME)";
912912
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
913+
SWIFT_VERSION = 5.0;
913914
};
914915
name = Debug;
915916
};
@@ -927,6 +928,7 @@
927928
PRODUCT_BUNDLE_IDENTIFIER = io.rx.Tests;
928929
PRODUCT_NAME = "$(TARGET_NAME)";
929930
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
931+
SWIFT_VERSION = 5.0;
930932
};
931933
name = Release;
932934
};
@@ -951,6 +953,7 @@
951953
SKIP_INSTALL = YES;
952954
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator appletvos appletvsimulator watchos watchsimulator";
953955
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
956+
SWIFT_VERSION = 5.0;
954957
};
955958
name = Debug;
956959
};
@@ -975,6 +978,7 @@
975978
SKIP_INSTALL = YES;
976979
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator appletvos appletvsimulator watchos watchsimulator";
977980
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
981+
SWIFT_VERSION = 5.0;
978982
};
979983
name = Release;
980984
};
@@ -1119,6 +1123,7 @@
11191123
PRODUCT_NAME = RxDataSources;
11201124
SKIP_INSTALL = YES;
11211125
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvos appletvsimulator";
1126+
SWIFT_VERSION = 5.0;
11221127
};
11231128
name = Debug;
11241129
};
@@ -1144,6 +1149,7 @@
11441149
SKIP_INSTALL = YES;
11451150
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvos appletvsimulator";
11461151
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
1152+
SWIFT_VERSION = 5.0;
11471153
};
11481154
name = Release;
11491155
};
@@ -1162,6 +1168,7 @@
11621168
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
11631169
PRODUCT_BUNDLE_IDENTIFIER = kzaher.Example;
11641170
PRODUCT_NAME = "$(TARGET_NAME)";
1171+
SWIFT_VERSION = 5.0;
11651172
TARGETED_DEVICE_FAMILY = "1,2";
11661173
};
11671174
name = Debug;
@@ -1182,6 +1189,7 @@
11821189
PRODUCT_BUNDLE_IDENTIFIER = kzaher.Example;
11831190
PRODUCT_NAME = "$(TARGET_NAME)";
11841191
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
1192+
SWIFT_VERSION = 5.0;
11851193
TARGETED_DEVICE_FAMILY = "1,2";
11861194
};
11871195
name = Release;
@@ -1194,6 +1202,7 @@
11941202
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
11951203
PRODUCT_BUNDLE_IDENTIFIER = kzaher.ExampleUITests;
11961204
PRODUCT_NAME = "$(TARGET_NAME)";
1205+
SWIFT_VERSION = 5.0;
11971206
TEST_TARGET_NAME = Example;
11981207
USES_XCTRUNNER = YES;
11991208
};
@@ -1208,6 +1217,7 @@
12081217
PRODUCT_BUNDLE_IDENTIFIER = kzaher.ExampleUITests;
12091218
PRODUCT_NAME = "$(TARGET_NAME)";
12101219
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
1220+
SWIFT_VERSION = 5.0;
12111221
TEST_TARGET_NAME = Example;
12121222
USES_XCTRUNNER = YES;
12131223
};

Examples/Example/Example2_RandomizedSectionsAnimation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class PartialUpdatesViewController: UIViewController {
3434

3535
let initialRandomizedSections = Randomizer(rng: PseudoRandomGenerator(4, 3), sections: initialValue())
3636

37-
let ticks = Observable<Int>.interval(1, scheduler: MainScheduler.instance).map { _ in () }
37+
let ticks = Observable<Int>.interval(.seconds(1), scheduler: MainScheduler.instance).map { _ in () }
3838
let randomSections = Observable.of(ticks, refreshButton.rx.tap.asObservable())
3939
.merge()
4040
.scan(initialRandomizedSections) { a, _ in

Examples/Example/Example5_UIPickerView.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ final class ReactivePickerViewControllerExample: UIViewController {
3434
}) { (_, _, items, row, _) -> NSAttributedString? in
3535
return NSAttributedString(string: items[row],
3636
attributes: [
37-
NSAttributedStringKey.foregroundColor: UIColor.purple,
38-
NSAttributedStringKey.underlineStyle: NSUnderlineStyle.styleDouble.rawValue,
39-
NSAttributedStringKey.textEffect: NSAttributedString.TextEffectStyle.letterpressStyle
37+
.foregroundColor: UIColor.purple,
38+
.underlineStyle: NSUnderlineStyle.double.rawValue,
39+
.textEffect: NSAttributedString.TextEffectStyle.letterpressStyle
4040
])
4141
}
4242
private let viewPickerAdapter = RxPickerViewViewAdapter<[String]>(components: [],

Examples/Example/Support/AppDelegate.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
1313

1414
var window: UIWindow?
1515

16-
17-
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
18-
// Override point for customization after application launch.
16+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
1917
return true
2018
}
2119

0 commit comments

Comments
 (0)