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 Foundation | |
enum Nullable<Value: Codable>: Codable { | |
case some(_ value: Value) | |
case null | |
init(from decoder: Decoder) throws { | |
let container = try decoder.singleValueContainer() | |
if container.decodeNil() { | |
self = .null |
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 Alamofire | |
extension Single { | |
static func make<T>(from resultFn: @escaping (@escaping (Result<T>) -> Void) -> Void) -> Single<T> { | |
return Single<T>.create { sub in | |
resultFn { result in | |
switch result { | |
case .success(let value): | |
sub(SingleEvent.success(value)) |
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
- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate | |
{ | |
if (scrollView.scrollDirectionX == ScrollDirectionRight) { | |
//Do something with your views etc | |
} | |
if (scrollView.scrollDirectionY == ScrollDirectionUp) { | |
//Do something with your views etc | |
} | |
} |
NewerOlder