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 | |
import UIKit | |
class ListingListViewController: UIViewController { | |
let contentView: ListingListView | |
let service: ListingService | |
let disposeBag: DisposeBag | |
init(service: ListingService) { | |
self.contentView = ListingListView() |
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 | |
class LocalListingService: ListingService { | |
var events: Observable<ListingServiceEvent> { | |
return eventsPublishSubject.asObservable() | |
} | |
private let eventsPublishSubject: PublishSubject<ListingServiceEvent> | |
// ... |
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
protocol ListingService: class { | |
var events: Observable<ListingServiceEvent> { get } | |
func filteredEvents(listing: Listing) -> Observable<ListingServiceEvent> | |
func create(params: ListingServiceCreateParams, | |
completion: ((Result<Listing, ListingServiceCreateError>) -> ())?) | |
func update(listing: Listing, | |
params: ListingServiceUpdateParams, | |
completion: ((Result<Listing, ListingServiceUpdateError>) -> ())?) | |
func delete(listing: Listing, |
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 Foundation | |
import CocoaLumberjack | |
import Crashlytics | |
class CrashlyticsLogger : DDAbstractLogger | |
{ | |
static let sharedInstance = CrashlyticsLogger() | |
private var _logFormatter : DDLogFormatter? | |
override var logFormatter: DDLogFormatter? { |
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 SequenceType { | |
func upcast<T, U where Self.Generator.Element == T>() -> [U] { | |
return flatMap {$0 as? U} | |
} | |
} |