Skip to content

Commit

Permalink
Merge pull request #21 from Fueled/modernisation
Browse files Browse the repository at this point in the history
chore(project): Update Swift version and dependencies.
  • Loading branch information
Sissing authored Oct 5, 2018
2 parents ab9ccfa + 65ee7b3 commit 930805f
Show file tree
Hide file tree
Showing 14 changed files with 49 additions and 37 deletions.
2 changes: 1 addition & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "ReactiveCocoa/ReactiveCocoa" ~> 7.0
github "ReactiveCocoa/ReactiveCocoa" ~> 8.0
6 changes: 3 additions & 3 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
github "ReactiveCocoa/ReactiveCocoa" "7.0.1"
github "ReactiveCocoa/ReactiveSwift" "3.0.0"
github "antitypical/Result" "3.2.4"
github "ReactiveCocoa/ReactiveCocoa" "8.0.0"
github "ReactiveCocoa/ReactiveSwift" "4.0.0"
github "antitypical/Result" "4.0.0"
2 changes: 1 addition & 1 deletion Carthage/Checkouts/ReactiveCocoa
Submodule ReactiveCocoa updated 42 files
+1 −1 .swift-version
+6 −8 .travis.yml
+32 −0 CHANGELOG.md
+1 −1 Cartfile
+4 −4 Cartfile.resolved
+1 −1 Carthage/Checkouts/Nimble
+1 −1 Carthage/Checkouts/Quick
+1 −1 Carthage/Checkouts/ReactiveSwift
+1 −1 Carthage/Checkouts/Result
+5 −5 ReactiveCocoa.podspec
+85 −279 ReactiveCocoa.xcodeproj/project.pbxproj
+1 −3 ReactiveCocoa.xcodeproj/xcshareddata/xcschemes/ReactiveCocoa-iOS.xcscheme
+1 −3 ReactiveCocoa.xcodeproj/xcshareddata/xcschemes/ReactiveCocoa-macOS.xcscheme
+1 −3 ReactiveCocoa.xcodeproj/xcshareddata/xcschemes/ReactiveCocoa-tvOS.xcscheme
+1 −1 ReactiveCocoa.xcodeproj/xcshareddata/xcschemes/ReactiveCocoa-watchOS.xcscheme
+1 −3 ReactiveCocoa.xcodeproj/xcshareddata/xcschemes/ReactiveMapKit.xcscheme
+39 −0 ReactiveCocoa/AppKit/NSTextView.swift
+22 −13 ReactiveCocoa/NSObject+Intercepting.swift
+1 −0 ReactiveCocoa/NSObject+KeyValueObserving.swift
+13 −8 ReactiveCocoa/ObjC+Messages.swift
+1 −1 ReactiveCocoa/ObjC+RuntimeSubclassing.swift
+20 −0 ReactiveCocoa/UIKit/UIBarButtonItem.swift
+68 −7 ReactiveCocoa/UIKit/UINavigationItem.swift
+14 −0 ReactiveCocoa/UIKit/UIResponder.swift
+40 −0 ReactiveCocoa/UIKit/UIViewController.swift
+58 −3 ReactiveCocoa/UIKit/iOS/UIKeyboard.swift
+19 −0 ReactiveCocoa/UIKit/iOS/UISearchBar.swift
+19 −0 ReactiveCocoaTests/InterceptingSpec.swift
+38 −0 ReactiveCocoaTests/KeyValueObservingSpec.swift
+5 −0 ReactiveCocoaTests/MessageForwardingEntity.h
+35 −0 ReactiveCocoaTests/MessageForwardingEntity.m
+1 −0 ReactiveCocoaTests/ReactiveCocoaTests-Bridging-Header.h
+50 −33 ReactiveCocoaTests/SignalProducerNimbleMatchers.swift
+59 −0 ReactiveCocoaTests/UIKit/UIBarButtonItemSpec.swift
+150 −1 ReactiveCocoaTests/UIKit/UIKeyboardSpec.swift
+237 −16 ReactiveCocoaTests/UIKit/UINavigationItemSpec.swift
+20 −0 ReactiveCocoaTests/UIKit/UIResponderSpec.swift
+47 −0 ReactiveCocoaTests/UIKit/UISearchBarSpec.swift
+114 −0 ReactiveCocoaTests/UIKit/UIViewControllerSpec.swift
+2 −3 ReactiveMapKit.podspec
+26 −0 ReactiveMapKit/MKLocalSearchRequest.swift
+0 −2 ReactiveMapKit/MKMapView.swift
2 changes: 1 addition & 1 deletion Carthage/Checkouts/ReactiveSwift
Submodule ReactiveSwift updated 55 files
+1 −1 .swift-version
+24 −11 .travis.yml
+63 −4 CHANGELOG.md
+1 −1 Cartfile
+2 −2 Cartfile.private
+4 −4 Cartfile.resolved
+1 −1 Carthage/Checkouts/Nimble
+1 −1 Carthage/Checkouts/Quick
+1 −1 Carthage/Checkouts/Result
+1 −1 Carthage/Checkouts/xcconfigs
+5 −5 Documentation/APIContracts.md
+2 −2 Documentation/BasicOperators.md
+1 −1 Documentation/FrameworkOverview.md
+0 −24 Package.pins
+6 −6 Package.resolved
+14 −20 Package.swift
+1 −1 ReactiveSwift-UIExamples.playground/Pages/ValidatingProperty.xcplaygroundpage/Contents.swift
+4 −4 ReactiveSwift-UIExamples.playground/Pages/ValidatingProperty.xcplaygroundpage/Sources/UIKitExtensions.swift
+1 −1 ReactiveSwift.playground/Pages/Property.xcplaygroundpage/Contents.swift
+1 −1 ReactiveSwift.playground/Pages/Sandbox.xcplaygroundpage/Contents.swift
+6 −3 ReactiveSwift.podspec
+14 −14 ReactiveSwift.xcodeproj/project.pbxproj
+8 −0 ReactiveSwift.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
+4 −3 Sources/Action.swift
+9 −15 Sources/Atomic.swift
+23 −26 Sources/Bag.swift
+17 −26 Sources/Disposable.swift
+293 −26 Sources/Event.swift
+60 −25 Sources/EventLogger.swift
+241 −42 Sources/Flatten.swift
+1 −1 Sources/Info.plist
+7 −3 Sources/Lifetime.swift
+8 −48 Sources/Observer.swift
+46 −19 Sources/Property.swift
+1 −1 Sources/Reactive.swift
+4 −10 Sources/ResultExtensions.swift
+40 −4 Sources/Scheduler.swift
+81 −88 Sources/Signal.swift
+452 −88 Sources/SignalProducer.swift
+18 −19 Sources/UnidirectionalBinding.swift
+16 −0 Sources/UninhabitedTypeGuards.swift
+12 −12 Sources/ValidatingProperty.swift
+18 −0 Tests/ReactiveSwiftTests/BagSpec.swift
+18 −0 Tests/ReactiveSwiftTests/DisposableSpec.swift
+354 −25 Tests/ReactiveSwiftTests/FlattenSpec.swift
+1 −1 Tests/ReactiveSwiftTests/Info.plist
+17 −1 Tests/ReactiveSwiftTests/LifetimeSpec.swift
+74 −14 Tests/ReactiveSwiftTests/PropertySpec.swift
+61 −0 Tests/ReactiveSwiftTests/SchedulerSpec.swift
+182 −3 Tests/ReactiveSwiftTests/SignalProducerLiftingSpec.swift
+40 −30 Tests/ReactiveSwiftTests/SignalProducerNimbleMatchers.swift
+177 −31 Tests/ReactiveSwiftTests/SignalProducerSpec.swift
+534 −20 Tests/ReactiveSwiftTests/SignalSpec.swift
+32 −8 Tests/ReactiveSwiftTests/UnidirectionalBindingSpec.swift
+8 −3 script/validate-playground.sh
12 changes: 8 additions & 4 deletions FueledUtils.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,12 @@
02DE3C151D258C79002B58E2 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0900;
LastUpgradeCheck = 1000;
ORGANIZATIONNAME = Fueled;
TargetAttributes = {
02DE3C1D1D258C79002B58E2 = {
CreatedOnToolsVersion = 7.3.1;
LastSwiftMigration = 0900;
LastSwiftMigration = 1000;
};
};
};
Expand Down Expand Up @@ -246,12 +246,14 @@
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_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 @@ -302,12 +304,14 @@
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_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 @@ -360,7 +364,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -384,7 +388,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.fueled.FueledUtils;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand Down
8 changes: 8 additions & 0 deletions FueledUtils.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
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>
16 changes: 8 additions & 8 deletions FueledUtils/ButtonWithTitleAdjustment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,33 +23,33 @@ open class ButtonWithTitleAdjustment: UIButton {
self.updateAdjustedTitles()
}

override open func setTitleColor(_ color: UIColor?, for state: UIControlState) {
override open func setTitleColor(_ color: UIColor?, for state: UIControl.State) {
super.setTitleColor(color, for: state)
self.updateAdjustedTitles()
}

override open func setTitle(_ title: String?, for state: UIControlState) {
override open func setTitle(_ title: String?, for state: UIControl.State) {
super.setTitle(title, for: state)
self.updateAdjustedTitles()
}

private func updateAdjustedTitles() {
let states: [UIControlState] = [.normal, .highlighted, .selected, .disabled, [.selected, .highlighted], [.selected, .disabled]]
let states: [UIControl.State] = [.normal, .highlighted, .selected, .disabled, [.selected, .highlighted], [.selected, .disabled]]
for state in states {
self.setAdjustedTitle(self.title(for: state), for: state)
}
}

private func setAdjustedTitle(_ title: String?, for state: UIControlState) {
private func setAdjustedTitle(_ title: String?, for state: UIControl.State) {
let adjustedString = title.map { title -> NSAttributedString in
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.lineSpacing = self.adjustmentLineSpacing
var attributes: [NSAttributedStringKey: Any] = [
NSAttributedStringKey.paragraphStyle: paragraphStyle,
NSAttributedStringKey.kern: self.adjustmentKerning,
var attributes: [NSAttributedString.Key: Any] = [
NSAttributedString.Key.paragraphStyle: paragraphStyle,
NSAttributedString.Key.kern: self.adjustmentKerning,
]
if let titleColor = self.titleColor(for: state) {
attributes[NSAttributedStringKey.foregroundColor] = titleColor
attributes[NSAttributedString.Key.foregroundColor] = titleColor
}
return NSAttributedString(string: title, attributes: attributes)
}
Expand Down
16 changes: 8 additions & 8 deletions FueledUtils/KeyboardInsetHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,32 @@ open class KeyboardInsetHelper: NSObject {
nc.addObserver(
self,
selector: #selector(handleKeyboardNotification(_:)),
name: NSNotification.Name.UIKeyboardWillShow,
name: UIResponder.keyboardWillShowNotification,
object: nil
)
nc.addObserver(
self,
selector: #selector(handleKeyboardNotification(_:)),
name: NSNotification.Name.UIKeyboardWillHide,
name: UIResponder.keyboardWillHideNotification,
object: nil
)
}

deinit {
let nc = NotificationCenter.default
nc.removeObserver(self, name: NSNotification.Name.UIKeyboardWillShow, object: nil)
nc.removeObserver(self, name: NSNotification.Name.UIKeyboardWillHide, object: nil)
nc.removeObserver(self, name: UIResponder.keyboardWillShowNotification, object: nil)
nc.removeObserver(self, name: UIResponder.keyboardWillHideNotification, object: nil)
}

@objc fileprivate func handleKeyboardNotification(_ notification: Notification) {
guard let referenceView = referenceView,
let userInfo = (notification as NSNotification).userInfo,
let curve = userInfo[UIKeyboardAnimationCurveUserInfoKey] as? UInt,
let duration = userInfo[UIKeyboardAnimationDurationUserInfoKey] as? Double,
let keyboardFrameValue = userInfo[UIKeyboardFrameEndUserInfoKey] as? NSValue
let curve = userInfo[UIResponder.keyboardAnimationCurveUserInfoKey] as? UInt,
let duration = userInfo[UIResponder.keyboardAnimationDurationUserInfoKey] as? Double,
let keyboardFrameValue = userInfo[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue
else { return }
let keyboardFrame = referenceView.convert(keyboardFrameValue.cgRectValue, from: referenceView.window)
let curveOption = UIViewAnimationOptions(rawValue: curve << 16)
let curveOption = UIView.AnimationOptions(rawValue: curve << 16)
let animationOptions = curveOption.union(.beginFromCurrentState)
let inset = max(baseInset, referenceView.bounds.maxY - keyboardFrame.minY)
UIView.performWithoutAnimation {
Expand Down
4 changes: 2 additions & 2 deletions FueledUtils/LabelWithTitleAdjustment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ open class LabelWithTitleAdjustment: UILabel {
let attributedString = NSMutableAttributedString(attributedString: text)
attributedString.addAttributes(
[
NSAttributedStringKey.paragraphStyle: paragraphStyle,
NSAttributedStringKey.kern: self.adjustmentKerning,
NSAttributedString.Key.paragraphStyle: paragraphStyle,
NSAttributedString.Key.kern: self.adjustmentKerning,
],
range: NSRange(location: 0, length: attributedString.string.utf16.count))
super.attributedText = attributedString
Expand Down
4 changes: 2 additions & 2 deletions FueledUtils/RACExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Result
public func animatingContext(
_ duration: TimeInterval,
delay: TimeInterval = 0,
options: UIViewAnimationOptions = [],
options: UIView.AnimationOptions = [],
layoutView: UIView? = nil,
completion: ((Bool) -> Void)? = nil)
-> ((@escaping () -> Void) -> Void)
Expand All @@ -30,7 +30,7 @@ public func transitionContext(
with view: UIView,
duration: TimeInterval,
delay: TimeInterval = 0,
options: UIViewAnimationOptions = [],
options: UIView.AnimationOptions = [],
completion: ((Bool) -> Void)? = nil)
-> ((@escaping () -> Void) -> Void)
{
Expand Down
2 changes: 1 addition & 1 deletion FueledUtils/ReactiveLifetimeProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ open class Lifetimed: ReactiveLifetimeProvider {
}
}

public extension Reactive where Base: ReactiveLifetimeProvider {
public extension Reactive where Base: AnyObject, Base: ReactiveLifetimeProvider {
public var lifetime: Lifetime {
return Lifetime(self.base.lifetimeToken)
}
Expand Down
8 changes: 4 additions & 4 deletions FueledUtils/SignalingAlert.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ public final class SignalingAlert<T> {
public let signal: Signal<T, NoError>
fileprivate let observer: Signal<T, NoError>.Observer

public init(title: String?, message: String?, preferredStyle: UIAlertControllerStyle) {
public init(title: String?, message: String?, preferredStyle: UIAlertController.Style) {
(signal, observer) = Signal<T, NoError>.pipe()
controller = UIAlertController(title: title, message: message, preferredStyle: preferredStyle)
controller.reactive.lifetime.ended.observeCompleted { [observer] in
observer.sendInterrupted()
}
}

public func addAction(title: String, style: UIAlertActionStyle, event: Signal<T, NoError>.Event) {
public func addAction(title: String, style: UIAlertAction.Style, event: Signal<T, NoError>.Event) {
controller.addAction(UIAlertAction(title: title, style: style) { [observer] _ in
observer.send(event)
})
}

public func addAction(title: String, style: UIAlertActionStyle, value: T) {
public func addAction(title: String, style: UIAlertAction.Style, value: T) {
controller.addAction(UIAlertAction(title: title, style: style) { [observer] _ in
observer.send(value: value)
observer.sendCompleted()
Expand All @@ -35,7 +35,7 @@ public final class SignalingAlert<T> {
public static func producer(
title: String? = nil,
message: String? = nil,
preferredStyle: UIAlertControllerStyle,
preferredStyle: UIAlertController.Style,
presentingController: UIViewController,
sourceView: UIView,
configure: @escaping (SignalingAlert) -> () = { _ in })
Expand Down
2 changes: 1 addition & 1 deletion FueledUtils/UIExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public extension UITextField {
set {
if let color = newValue, let placeholder = self.placeholder {
attributedPlaceholder = NSAttributedString(string: placeholder, attributes: [
NSAttributedStringKey.foregroundColor: color
NSAttributedString.Key.foregroundColor: color
])
}
}
Expand Down

0 comments on commit 930805f

Please sign in to comment.