This file contains 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
public struct ModalSegue<FromViewControllerType: UIViewController, | |
ToViewControllerType: UIViewController, ContextType>: SegueType { | |
public typealias E = ContextType | |
public typealias T = FromViewControllerType | |
public typealias U = ToViewControllerType | |
public weak var fromViewController: T? | |
public let toViewControllerFactory: (sender: T, context: E) -> U | |
public let animated: Bool |
This file contains 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
public protocol SegueType: ObserverType { | |
/** | |
Type of the view controller from which navigation will appear | |
*/ | |
typealias T | |
/** | |
Type of the target view controller | |
*/ | |
typealias U |
This file contains 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 PackageDescription | |
let package = Package( | |
name: "Test", | |
dependencies: [ | |
.Package(url: "https://github.com/qutheory/vapor.git", majorVersion: 0) | |
], | |
exclude: [ | |
"Public", | |
"Resources" |
This file contains 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 RxCocoa | |
class SomeTableViewController:UITableViewController { | |
let disposeBag = DisposeBag() | |
let items:[Item] ... | |
lazy var itemDetailsSegue:Segue<Item> = { | |
return Segue(fromViewController: self, | |
toViewControllerFactory: { context -> UIViewController in |
This file contains 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 UIKit | |
import RxSwift | |
class Segue<T> { | |
private(set) weak var fromViewController:UIViewController? | |
let toViewControllerFactory:(context:T) -> UIViewController | |
init(fromViewController:UIViewController, | |
toViewControllerFactory:(context:T) -> UIViewController) { |
This file contains 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 Argo | |
struct HeroAPI { | |
private static let decodeScheduler = SerialDispatchQueueScheduler(internalSerialQueueName: "com.FunctionalMarvel.HeroAPI.decode_queue") | |
typealias HeroListResult = (heroes:Decoded<[Hero]>, batch:Decoded<Batch>) | |
private static func recursiveHeroList(offset:Int = 0, | |
limit:Int, |
This file contains 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 JsonGET { | |
static func getData(endpoint:EndPoint)(parameters:[String: AnyObject]?) -> Observable<AnyObject> | |
} | |
struct Marvel { | |
//MARK:Private | |
private struct Keys { | |
static let privatKey = "9597bcd0e2339d5874d9913140b581ed0b55a921" | |
static let publicKey = "be23153c199affa766dc9fe6f34fd524" |
This file contains 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 HeroAutoLoading { | |
static func getItems(offset:Int, limit:Int, loadNextBatch:Observable<Void>) -> Observable<[Hero]> | |
static func searchItems(offset:Int, limit:Int, search:String, loadNextBatch:Observable<Void>) -> Observable<[Hero]> | |
} |
This file contains 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 UITableView { | |
var rxex_nextPageTriger:Observable<Void> { | |
return self | |
.rx_contentOffset | |
.flatMapLatest { [unowned self] (offset) -> Observable<Void> in | |
let shouldTriger = offset.y + self.frame.size.height + 40 > self.contentSize.height | |
return shouldTriger ? just() : empty() | |
} |