Skip to content
This repository has been archived by the owner on May 18, 2021. It is now read-only.

Commit

Permalink
support swift4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
marty-suzuki committed Feb 9, 2019
1 parent 89f5e17 commit d313fb4
Show file tree
Hide file tree
Showing 32 changed files with 156 additions and 104 deletions.
28 changes: 15 additions & 13 deletions Examples/Flux+MVVM/FluxCapacitorSample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -456,18 +456,18 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0830;
LastUpgradeCheck = 0900;
LastUpgradeCheck = 1010;
ORGANIZATIONNAME = "marty-suzuki";
TargetAttributes = {
370102481F4B329D004EFCC7 = {
CreatedOnToolsVersion = 8.3.3;
LastSwiftMigration = 0900;
LastSwiftMigration = 1010;
ProvisioningStyle = Manual;
TestTargetID = 37C8BA4D1F2C9DB8003AFBD7;
};
37C8BA4D1F2C9DB8003AFBD7 = {
CreatedOnToolsVersion = 8.3.3;
LastSwiftMigration = 0900;
LastSwiftMigration = 1010;
ProvisioningStyle = Manual;
};
};
Expand Down Expand Up @@ -731,13 +731,13 @@
"$(PROJECT_DIR)/Carthage/Build/iOS",
);
INFOPLIST_FILE = FluxCapacitorSampleTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "jp.marty-suzuki.FluxCapacitorSampleTests";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FluxCapacitorSample.app/FluxCapacitorSample";
};
name = Debug;
Expand All @@ -755,12 +755,12 @@
"$(PROJECT_DIR)/Carthage/Build/iOS",
);
INFOPLIST_FILE = FluxCapacitorSampleTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "jp.marty-suzuki.FluxCapacitorSampleTests";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FluxCapacitorSample.app/FluxCapacitorSample";
};
name = Release;
Expand All @@ -779,13 +779,15 @@
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_DOCUMENTATION_COMMENTS = YES;
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 @@ -836,13 +838,15 @@
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_DOCUMENTATION_COMMENTS = YES;
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 @@ -883,13 +887,12 @@
"$(PROJECT_DIR)/Carthage/Build/iOS",
);
INFOPLIST_FILE = FluxCapacitorSample/Resources/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "jp.marty-suzuki.FluxCapacitorSample";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -904,13 +907,12 @@
"$(PROJECT_DIR)/Carthage/Build/iOS",
);
INFOPLIST_FILE = FluxCapacitorSample/Resources/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "jp.marty-suzuki.FluxCapacitorSample";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
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 = "0920"
LastUpgradeVersion = "1010"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,7 +26,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
Expand Down Expand Up @@ -56,7 +55,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Original file line number Diff line number Diff line change
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 {
// Override point for customization after application launch.
return true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ import NoticeObserveKit
struct UIKeyboardInfo: NoticeUserInfoDecodable {
let frame: CGRect
let animationDuration: TimeInterval
let animationCurve: UIViewAnimationOptions
let animationCurve: UIView.AnimationOptions

init?(info: [AnyHashable : Any]) {
guard
let frame = (info[UIKeyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue,
let duration = info[UIKeyboardAnimationDurationUserInfoKey] as? TimeInterval,
let curve = info[UIKeyboardAnimationCurveUserInfoKey] as? UInt
let frame = (info[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue,
let duration = info[UIResponder.keyboardAnimationDurationUserInfoKey] as? TimeInterval,
let curve = info[UIResponder.keyboardAnimationCurveUserInfoKey] as? UInt
else {
return nil
}
self.frame = frame
self.animationDuration = duration
self.animationCurve = UIViewAnimationOptions(rawValue: curve)
self.animationCurve = UIView.AnimationOptions(rawValue: curve)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import NoticeObserveKit

struct UIKeyboardWillHide: NoticeType {
typealias InfoType = UIKeyboardInfo
static let name: Notification.Name = .UIKeyboardWillHide
extension Notice.Names {
static let keyboardWillHide = Notice.Name<UIKeyboardInfo>(UIResponder.keyboardWillHideNotification)
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import NoticeObserveKit

struct UIKeyboardWillShow: NoticeType {
typealias InfoType = UIKeyboardInfo
static let name: Notification.Name = .UIKeyboardWillShow
extension Notice.Names {
static let keyboardWillShow = Notice.Name<UIKeyboardInfo>(UIResponder.keyboardWillShowNotification)
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ final class FavoriteViewController: UIViewController {

private var showRepository: AnyObserver<Void> {
return Binder(self) { me, _ in
guard let webview = RepositoryViewController() else { return }
guard let webview = RepositoryViewController(()) else { return }
me.navigationController?.pushViewController(webview, animated: true)
}.asObserver()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ final class RepositoryViewController: SFSafariViewController {
favoriteButtonItemTap: self.favoriteButtonItem.rx.tap)
}()

init?(entersReaderIfAvailable: Bool = true) {
init?(_: Void) {
guard let url = RepositoryViewModel.selectedURL() else { return nil }
super.init(url: url, entersReaderIfAvailable: entersReaderIfAvailable)
super.init(url: url, configuration: .init())
hidesBottomBarWhenPushed = true
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ final class SearchViewModel {
viewWillAppear
.subscribe(onNext: { [weak self] in
guard let me = self else { return }
UIKeyboardWillShow.observe { [weak self] in
NotificationCenter.default.nok.observe(name: .keyboardWillShow) { [weak self] in
self?._keyboardWillShow.onNext($0)
}
.disposed(by: me.pool)
.invalidated(by: me.pool)

UIKeyboardWillHide.observe { [weak self] in
NotificationCenter.default.nok.observe(name: .keyboardWillHide) { [weak self] in
self?._keyboardWillHide.onNext($0)
}
.disposed(by: me.pool)
.invalidated(by: me.pool)
})
.disposed(by: disposeBag)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ final class UserRepositoryViewController: UIViewController {

private var showRepository: AnyObserver<Void> {
return Binder(self) { me, _ in
guard let webview = RepositoryViewController() else { return }
guard let webview = RepositoryViewController(()) else { return }
me.navigationController?.pushViewController(webview, animated: true)
}.asObserver()
}
Expand Down
9 changes: 7 additions & 2 deletions Examples/Flux+MVVM/Pods/Pods.xcodeproj/project.pbxproj

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Examples/Flux/Cartfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github "marty-suzuki/GithubKitForSample"
github "marty-suzuki/NoticeObserveKit" "0.4.0"
github "marty-suzuki/NoticeObserveKit" "0.10.1"
10 changes: 5 additions & 5 deletions Examples/Flux/Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github "0x73/SwiftIconFont" "2.7.2"
github "ReactiveX/RxSwift" "4.1.1"
github "kean/Nuke" "5.2"
github "marty-suzuki/GithubKitForSample" "0.2.3"
github "marty-suzuki/NoticeObserveKit" "0.4.0"
github "0x73/SwiftIconFont" "3.0.0"
github "ReactiveX/RxSwift" "4.4.0"
github "kean/Nuke" "7.5.2"
github "marty-suzuki/GithubKitForSample" "0.3.0"
github "marty-suzuki/NoticeObserveKit" "0.10.1"
Loading

0 comments on commit d313fb4

Please sign in to comment.