Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Example/RxCocoa-Texture.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
9B0E15FA210DA33F0013EC86 /* ASEditableTextNode+RxSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "ASEditableTextNode+RxSpec.swift"; sourceTree = "<group>"; };
9B0E15FB210DA33F0013EC86 /* ASNetworkImageNode+RxSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "ASNetworkImageNode+RxSpec.swift"; sourceTree = "<group>"; };
9B0E15FC210DA33F0013EC86 /* ASImageNode+RxSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "ASImageNode+RxSpec.swift"; sourceTree = "<group>"; };
9B0E161B210DAD540013EC86 /* RepositoryViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RepositoryViewController.swift; sourceTree = "<group>"; };
9B0E161B210DAD540013EC86 /* RepositoryViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.swift; path = RepositoryViewController.swift; sourceTree = "<group>"; tabWidth = 4; };
9B0E1620210DAD6C0013EC86 /* RepoProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RepoProvider.swift; sourceTree = "<group>"; };
9B0E1625210DAD7B0013EC86 /* Decoder+extension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Decoder+extension.swift"; sourceTree = "<group>"; };
9B0E1628210DAD880013EC86 /* Repository.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Repository.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -355,6 +355,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
Expand Down Expand Up @@ -667,6 +668,7 @@
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = JTEXWEH4CZ;
INFOPLIST_FILE = "RxCocoa-Texture/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
Expand All @@ -686,6 +688,7 @@
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = JTEXWEH4CZ;
INFOPLIST_FILE = "RxCocoa-Texture/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
Expand Down
2 changes: 1 addition & 1 deletion Example/RxCocoa-Texture/RepoProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct RepoProvider {
private static let repoRelay = BehaviorRelay<[Int: (repo: Repository, count: Int, updatedAt: Date)]>(value: [:])
private static let repoObservable = repoRelay
.asObservable()
.subscribeOn(SerialDispatchQueueScheduler(queue: queue, internalSerialQueueName: UUID().uuidString))
.subscribe(on: SerialDispatchQueueScheduler(queue: queue, internalSerialQueueName: UUID().uuidString))
.share(replay: 1, scope: .whileConnected)
private static let queue = DispatchQueue(label: "RepoProvider.RxMVVMTexture.com", qos: .utility)

Expand Down
43 changes: 21 additions & 22 deletions Example/RxCocoa-Texture/RepositoryViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import AsyncDisplayKit
import RxSwift
import RxCocoa

class RepositoryViewController: ASViewController<ASTableNode> {
class RepositoryViewController: ASDKViewController<ASTableNode> {

private var items: [RepositoryViewModel2] = []
private var context = ASBatchContext()

let disposeBag = DisposeBag()

init() {
override init() {
let tableNode = ASTableNode(style: .plain)
tableNode.backgroundColor = .white
tableNode.automaticallyManagesSubnodes = true
Expand Down Expand Up @@ -49,29 +49,28 @@ class RepositoryViewController: ASViewController<ASTableNode> {
func loadMoreRepo(since: Int?) {
_ = RepoService.loadRepository(params: [.since(since)])
.delay(.milliseconds(500), scheduler: MainScheduler.asyncInstance)
.subscribeOn(ConcurrentDispatchQueueScheduler(qos: .default))
.subscribe(on: ConcurrentDispatchQueueScheduler(qos: .default))
.map { $0.map { RepositoryViewModel2(repository: $0) } }
.observeOn(MainScheduler.instance)
.subscribe(onSuccess: { [weak self] items in
guard let `self` = self else { return }
guard let `self` = self else { return }

if since == nil {
self.items = items
self.node.reloadData()
self.context.completeBatchFetching(true)
} else {
// appending is good at table performance
let updateIndexPaths = items.enumerated()
.map { offset, _ -> IndexPath in
return IndexPath(row: self.items.count - 1 + offset, section: 0)
}

if since == nil {
self.items = items
self.node.reloadData()
self.context.completeBatchFetching(true)
} else {
// appending is good at table performance
let updateIndexPaths = items.enumerated()
.map { offset, _ -> IndexPath in
return IndexPath(row: self.items.count - 1 + offset, section: 0)
}

self.items.append(contentsOf: items)
self.node.insertRows(at: updateIndexPaths,
with: .fade)
self.context.completeBatchFetching(true)
}
}, onError: { [weak self] error in
self.items.append(contentsOf: items)
self.node.insertRows(at: updateIndexPaths,
with: .fade)
self.context.completeBatchFetching(true)
}
}, onFailure: { [weak self] error in
guard let `self` = self else { return }
self.context.completeBatchFetching(true)
})
Expand Down
8 changes: 4 additions & 4 deletions RxCocoa-Texture.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ Pod::Spec.new do |s|
s.author = { 'Geektree0101' => '[email protected]' }
s.source = { :git => 'https://github.com/RxSwiftCommunity/RxCocoa-Texture.git', :tag => s.version.to_s }

s.ios.deployment_target = '9.0'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @jjhyuk can you please pump the minor version?

s.ios.deployment_target = '10.0'
s.swift_version = '5.0'
s.source_files = 'RxCocoa-Texture/Classes/**/*'

s.dependency 'RxSwift', '~> 5.0'
s.dependency 'RxCocoa', '~> 5.0'
s.dependency 'Texture', '~> 2.7'
s.dependency 'RxSwift', '~> 6.0.0'
s.dependency 'RxCocoa', '~> 6.0.0'
s.dependency 'Texture', '~> 3.0.0'
end
4 changes: 2 additions & 2 deletions RxCocoa-Texture/Classes/ASControlNode+Rx.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ extension Reactive where Base: ASControlNode {

return Disposables.create(with: controlTarget.dispose)
}
.takeUntil(deallocated)
.take(until: deallocated)

return ControlEvent(events: source)
}
Expand Down Expand Up @@ -63,7 +63,7 @@ extension Reactive where Base: ASControlNode {

return Disposables.create(with: controlTarget.dispose)
}
.takeUntil(deallocated)
.take(until: deallocated)

let bindingObserver = ASBinder(base, binding: setter)

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 @@ -21,7 +21,7 @@ extension Reactive where Base: ASEditableTextNode {
let attrText = editableTextNode?.attributedText

let textChanged: Observable<NSAttributedString?> = editableTextNode?.rx.delegate.methodInvoked(#selector(ASEditableTextNodeDelegate.editableTextNodeDidUpdateText(_:)))
.observeOn(MainScheduler.asyncInstance)
.observe(on :MainScheduler.asyncInstance)
.map { _ in
return editableTextNode?.attributedText
}
Expand Down