import RIBs
import RxSwift
import RxRelay
import ReactorKit
protocol FAQsRouting: ViewableRouting {
func routeToFAQ(_ faq: FAQ)
func detachFAQ()
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {"lastUpload":"2020-05-20T11:21:56.191Z","extensionVersion":"v3.4.3"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import RxSwift | |
| extension ObservableType { | |
| public func mapObject<T: Codable>(type: T.Type) -> Observable<T> { | |
| return flatMap { (data) -> Observable<T> in | |
| if let data = (data as? (HTTPURLResponse, Data))?.1 { | |
| return try self.mapObject(type: type, data: data) | |
| } else if let json = (data as? (HTTPURLResponse, Any))?.1 { | |
| return try self.mapObjectJSON(type: type, json: json) | |
| } else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Closures | |
| import Panda | |
| import RxCocoa | |
| import RxSwift | |
| import SnapKit | |
| import UIKit | |
| extension PandaChain where Object: UIView { | |
| @discardableResult | |
| func add(to parent: UIView) -> PandaChain { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extension OSLog { | |
| private static var subsystem = Bundle.main.bundleIdentifier! | |
| static let ui = OSLog(subsystem: subsystem, category: "UI") | |
| static let network = OSLog(subsystem: subsystem, category: "Network") | |
| } | |
| os_log("Contact selected", log: .ui) | |
| os_log("HTTP response: %@", log: .network, responseCode) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| onCreate() { | |
| if (Build.VERSION.SDK_INT >= 21) { | |
| windowInsetsRelay = PublishRelay.create(); | |
| RelativeLayout base = findViewById(R.id.navi_activity_base); | |
| base.requestApplyInsets(); | |
| base.setOnApplyWindowInsetsListener((v, insets) -> { | |
| windowInsetsRelay.accept(insets); | |
| return insets.consumeSystemWindowInsets(); | |
| }); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // ViewController.swift | |
| // RxToCombine | |
| // | |
| // Copyright © 2019 iamchiwon. All rights reserved. | |
| // | |
| import Combine | |
| import UIKit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // ViewController.swift | |
| // RxToCombine | |
| // | |
| // Copyright © 2019 iamchiwon. All rights reserved. | |
| // | |
| import Combine | |
| import UIKit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // ViewController.swift | |
| // RxToCombine | |
| // | |
| // Copyright © 2019 iamchiwon. All rights reserved. | |
| // | |
| import Combine | |
| import RxCocoa | |
| import RxSwift |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class CancelBag { | |
| private var bag: [Cancellable] = [] | |
| private var named: [String: Cancellable] = [:] | |
| func cancelAll() { | |
| bag.forEach { $0.cancel() } | |
| bag = [] | |
| named.forEach { $0.value.cancel() } | |
| named = [:] |