Skip to content

Commit

Permalink
Merge pull request #9 from RxSwiftCommunity/feature/migration-swift-4.2
Browse files Browse the repository at this point in the history
migration swift4.2 & ready for release 2.2.0
  • Loading branch information
GeekTree0101 authored Dec 2, 2018
2 parents ce036ab + 13b7a51 commit 82f9b5d
Show file tree
Hide file tree
Showing 13 changed files with 44 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0
4.2
8 changes: 4 additions & 4 deletions Example/RxCocoa-Texture.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -680,7 +680,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand All @@ -702,7 +702,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/RxCocoa-Texture_Example.app/RxCocoa-Texture_Example";
};
name = Debug;
Expand All @@ -721,7 +721,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/RxCocoa-Texture_Example.app/RxCocoa-Texture_Example";
};
name = Release;
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>
2 changes: 1 addition & 1 deletion Example/RxCocoa-Texture/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,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 {
window = UIWindow(frame: UIScreen.main.bounds) // create UIwindow
let viewController = RepositoryViewController()
let navigationController =
Expand Down
4 changes: 2 additions & 2 deletions Example/RxCocoa-Texture/ButtonTestNode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class ButtonTestNode: ASDisplayNode {
let url = URL(string: "https://koreaboo-cdn.storage.googleapis.com/2017/08/sana-1-1.jpg")
let touchRelay = PublishRelay<Void>()

let defaultAttr = [NSAttributedStringKey.foregroundColor: UIColor.black]
let disableAttr = [NSAttributedStringKey.foregroundColor: UIColor.gray]
let defaultAttr = [NSAttributedString.Key.foregroundColor: UIColor.black]
let disableAttr = [NSAttributedString.Key.foregroundColor: UIColor.gray]

override init() {
super.init()
Expand Down
2 changes: 1 addition & 1 deletion Example/RxCocoa-Texture/EditableTextTestNode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class EditableTextTestNode: ASDisplayNode {

lazy var textNode = ASEditableTextNode()
let disposeBag = DisposeBag()
static let attribute = [NSAttributedStringKey.foregroundColor: UIColor.gray]
static let attribute = [NSAttributedString.Key.foregroundColor: UIColor.gray]

override init() {
super.init()
Expand Down
24 changes: 12 additions & 12 deletions Example/RxCocoa-Texture/RepositoryListCellNode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -141,23 +141,23 @@ extension RepositoryListCellNode {
}

extension RepositoryListCellNode {
static var usernameAttributes: [NSAttributedStringKey: Any] {
return [NSAttributedStringKey.foregroundColor: UIColor.black,
NSAttributedStringKey.font: UIFont.systemFont(ofSize: 20.0)]
static var usernameAttributes: [NSAttributedString.Key: Any] {
return [NSAttributedString.Key.foregroundColor: UIColor.black,
NSAttributedString.Key.font: UIFont.systemFont(ofSize: 20.0)]
}

static var descAttributes: [NSAttributedStringKey: Any] {
return [NSAttributedStringKey.foregroundColor: UIColor.darkGray,
NSAttributedStringKey.font: UIFont.systemFont(ofSize: 15.0)]
static var descAttributes: [NSAttributedString.Key: Any] {
return [NSAttributedString.Key.foregroundColor: UIColor.darkGray,
NSAttributedString.Key.font: UIFont.systemFont(ofSize: 15.0)]
}

static var statusAttributes: [NSAttributedStringKey: Any] {
return [NSAttributedStringKey.foregroundColor: UIColor.gray,
NSAttributedStringKey.font: UIFont.systemFont(ofSize: 12.0)]
static var statusAttributes: [NSAttributedString.Key: Any] {
return [NSAttributedString.Key.foregroundColor: UIColor.gray,
NSAttributedString.Key.font: UIFont.systemFont(ofSize: 12.0)]
}

static var moreSeeAttributes: [NSAttributedStringKey: Any] {
return [NSAttributedStringKey.foregroundColor: UIColor.darkGray,
NSAttributedStringKey.font: UIFont.systemFont(ofSize: 15.0, weight: .medium)]
static var moreSeeAttributes: [NSAttributedString.Key: Any] {
return [NSAttributedString.Key.foregroundColor: UIColor.darkGray,
NSAttributedString.Key.font: UIFont.systemFont(ofSize: 15.0, weight: .medium)]
}
}
2 changes: 1 addition & 1 deletion Example/RxCocoa-Texture/RepositoryViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ extension RepositoryViewController: ASTableDelegate {
}

func tableView(_ tableView: UITableView,
commit editingStyle: UITableViewCellEditingStyle,
commit editingStyle: UITableViewCell.EditingStyle,
forRowAt indexPath: IndexPath) {

if editingStyle == .delete {
Expand Down
2 changes: 1 addition & 1 deletion Example/RxCocoa-Texture/TextTestNode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class TextTestNode: ASDisplayNode {

lazy var textNode = ASTextNode()
let disposeBag = DisposeBag()
static let attribute = [NSAttributedStringKey.foregroundColor: UIColor.gray]
static let attribute = [NSAttributedString.Key.foregroundColor: UIColor.gray]

override init() {
super.init()
Expand Down
2 changes: 1 addition & 1 deletion RxCocoa-Texture.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'RxCocoa-Texture'
s.version = '2.1.0'
s.version = '2.2.0'
s.summary = 'RxCocoa Extension Library for Texture'

s.description = 'This library is built on Texture with RxCocoa, RxCocoa is a framework that helps make Cocoa APIs used in iOS and OS X easier to use with reactive techniques.'
Expand Down
20 changes: 10 additions & 10 deletions RxCocoa-Texture/Classes/ASButtonNode+Rx.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ extension Reactive where Base: ASButtonNode {
}

// apply attributedText on targeted control state
public func attributedText(_ controlState: UIControlState) -> ASBinder<NSAttributedString?> {
public func attributedText(_ controlState: UIControl.State) -> ASBinder<NSAttributedString?> {

return ASBinder(self.base) { node, attributedText in
node.setAttributedTitle(attributedText, for: controlState)
}
}

// apply text with attribute on all control state
public func text(_ attribute: [NSAttributedStringKey: Any]?) -> ASBinder<String?> {
public func text(_ attribute: [NSAttributedString.Key: Any]?) -> ASBinder<String?> {

return ASBinder(self.base) { node, text in
guard let text = text else {
Expand All @@ -54,8 +54,8 @@ extension Reactive where Base: ASButtonNode {
}

// apply text with attribute on targeted control state
public func text(_ attribute: [NSAttributedStringKey: Any]?,
target: UIControlState) -> ASBinder<String?> {
public func text(_ attribute: [NSAttributedString.Key: Any]?,
target: UIControl.State) -> ASBinder<String?> {

return ASBinder(self.base) { node, text in
guard let text = text else {
Expand Down Expand Up @@ -145,7 +145,7 @@ extension Reactive where Base: ASButtonNode {
case disabled(Any?)
case selected(Any?)

var state: UIControlState {
var state: UIControl.State {

switch self {
case .normal:
Expand Down Expand Up @@ -187,17 +187,17 @@ extension Reactive where Base: ASButtonNode {
}
}

var attributes: [NSAttributedStringKey: Any]? {
var attributes: [NSAttributedString.Key: Any]? {

switch self {
case .normal(let attr):
return attr as? [NSAttributedStringKey: Any]
return attr as? [NSAttributedString.Key: Any]
case .highlighted(let attr):
return attr as? [NSAttributedStringKey: Any]
return attr as? [NSAttributedString.Key: Any]
case .disabled(let attr):
return attr as? [NSAttributedStringKey: Any]
return attr as? [NSAttributedString.Key: Any]
case .selected(let attr):
return attr as? [NSAttributedStringKey: Any]
return attr as? [NSAttributedString.Key: Any]
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion RxCocoa-Texture/Classes/ASEditableTextNode+Rx.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ extension Reactive where Base: ASEditableTextNode {
}
}

public func text(_ attributes: [NSAttributedStringKey: Any]?) -> ASBinder<String?> {
public func text(_ attributes: [NSAttributedString.Key: Any]?) -> ASBinder<String?> {

return ASBinder(self.base) { node, text in
guard let text = text else {
Expand Down
2 changes: 1 addition & 1 deletion RxCocoa-Texture/Classes/ASTextNode+Rx.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ extension Reactive where Base: ASTextNode {
}
}

public func text(_ attributes: [NSAttributedStringKey: Any]?) -> ASBinder<String?> {
public func text(_ attributes: [NSAttributedString.Key: Any]?) -> ASBinder<String?> {

return ASBinder(self.base) { node, text in
guard let text = text else {
Expand Down

0 comments on commit 82f9b5d

Please sign in to comment.