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
// UIApplicationMain accepts Swift.String in Swift apps; a C forward declaration is needed | |
struct SwiftString { | |
uint8_t reserved[16]; | |
}; | |
typedef struct SwiftString SwiftString; | |
int (*orig_UIApplicationMain_objc)(int argc, char *argv[], NSString *_, NSString *delegateClassName) = nil; | |
int (*orig_UIApplicationMain_swift)(int argc, char *argv[], SwiftString _, SwiftString delegateClassName) = nil; | |
NSString *(*FoundationBridgeSwiftStringToObjC)(SwiftString str) = nil; |
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
# React Native Android | |
maven_aar( | |
name = "com_facebook_react_native", | |
artifact = "com.facebook.react:react-native:0.55.4", | |
settings = "//build:settings.xml", | |
deps = [ | |
"@androidsdk//com.android.support:appcompat-v7-25.0.0", | |
"@com_facebook_fbui_textlayoutbuilder//aar", | |
"@com_facebook_fresco_fresco//aar", |
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 { | |
static let log = OSLog(subsystem: "", category: "Log") | |
} | |
extension UIViewController { | |
public class func swizzleTracing() { | |
// make sure this isn't a subclass | |
if self !== UIViewController.self { | |
return |
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
// | |
public protocol ScannerPlugin { | |
var id: String { get } | |
var symbol: Barcode.Format { get } | |
func isApplicable(for code: Barcode) -> Observable<Bool> | |
func build(withCode code: Barcode, listener: ScannerPluginListener) -> ViewableRouting |
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
// | |
// Plugin.swift | |
// | |
// | |
import RIBs | |
import RxSwift | |
// MARK: - Plugin |
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
// | |
// Plugin.swift | |
// | |
// | |
import RIBs | |
import RxSwift | |
// MARK: - Plugin |
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
let initialDefaultValue = defaultValueIfIdle.takeUntil(originalObservable) | |
// |
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
let output = Observable.merge(initialDefaultValue, observableWithDefaultValue) | |
// OR | |
let output = Observable.merge(defaultValueIfIdle.takeUntil(originalObservable), observableWithDefaultValue) | |
// |
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
1. let originalObservable = getObservable().share() | |
2. let defaultValueAfterFiveSeconds = originalObservable.flatMapLatest { item in | |
return Observable<Int>.interval(5, scheduler: SerialDispatchQueueScheduler(qos: .background)) | |
.mapTo(“defaultValue”) | |
} | |
3. let initialDefaultValue = defaultValueIfIdle.takeUntil(originalObservable) | |
let finalOutput = Observable.merge(originalObservable, defaultValueAfterFiveSeconds, initialDefaultValue) |
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
let originalObservable = getObservable().share() | |
let defaultValueIfIdle = Observable<Int>.interval(5, scheduler: SerialDispatchQueueScheduler(qos: .background)) | |
.mapTo(“defaultValue”) | |
let observableWithDefaultValue = originalObservable | |
.flatMapLatest { item in | |
return Observable.of(.just(item), defaultValueIfIdle).concat() | |
} |
NewerOlder