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
// Method use for logging for debugging | |
function autoFillGettingLog(message) { | |
window.webkit.messageHandlers.autoFillGettingShippingInfoLog.postMessage(message); | |
} | |
autoFillGettingLog("Beginning...."); | |
/// The configuration xpath will be replace before injected to IAB | |
/// format: [{xPath, key, value}] | |
var autoFillGettingConfigurationXPathsString = "checkout-configuration-xpaths"; |
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
function autoFillFillingLog(message) { | |
window.webkit.messageHandlers.autoFillFillingShippingInfoLog.postMessage(message); | |
} | |
autoFillFillingLog("Beginning...."); | |
/// The configuration xpath will be replace before injected to IAB | |
/// format: [{xPath, key, value}] | |
var autoFillFillingConfigurationXPathsString = "checkout-configuration-xpaths"; |
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
// MARK: - String | |
extension String { | |
func aes256ECBPKCS5(hexKey: String) throws -> Data { | |
let keyData: NSData = try Data(hex: hexKey) as NSData | |
let data: NSData = Data(utf8) as NSData | |
guard let cryptData: NSMutableData = NSMutableData(length: Int(data.length) + kCCBlockSizeAES128) else { | |
throw NSError(domain: "", code: 1234, userInfo: [NSLocalizedDescriptionKey: "Prepare crypt data failed"]) |
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
{ | |
"Simulator Target Bundle": "com.yourapp.YourAppName", | |
"aps": { | |
"alert": { | |
"body": "Testing Message", | |
"title": "Test Notification" | |
} | |
} | |
} |
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 USDZNode: SCNReferenceNode { | |
init?( | |
name: String, | |
position: SCNVector3? = nil, | |
scale: SCNVector3? = nil, | |
pivot: SCNMatrix4? = nil | |
) { | |
guard let usdzURL: URL = Bundle.main.url(forResource: name, withExtension: "usdz") else { return nil } | |
super.init(url: usdzURL) | |
if let scale: SCNVector3 = scale { |
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
open -a AppName FileName |
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 ObservableType { | |
func withPrevious() -> Observable<(previous: Element?, current: Element?)> { | |
return scan([]) { (previous, current) in | |
return Array(previous + [current]).suffix(2) | |
} | |
.map { array -> (previous: Element?, current: Element?) in | |
let previous = array.count > 1 ? array.first : nil | |
let current = array.last | |
return (previous, current) | |
} |
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 Reactive where Base: UIViewController { | |
var presenting: Observable<UIViewController> { | |
return sentMessage(#selector(Base.present(_:animated:completion:))) | |
.compactMap({ args -> UIViewController? in | |
return args.first as? UIViewController | |
}) | |
.do(onError: { error in | |
assertionFailure("\(error)") | |
}) | |
} |
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 UIView { | |
func setHidden(_ isHidden: Bool, animated: Bool, completion: (() -> Void)? = nil) { | |
if animated { | |
let startAlpha: CGFloat | |
let animatingAlpha: CGFloat | |
if isHidden { | |
startAlpha = 1 | |
animatingAlpha = 0 | |
} else { | |
startAlpha = 0 |
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 UIApplication { | |
static let classInit: () -> () = { | |
swizzle(UIApplication.self, #selector(openURL(_:)), #selector(swizzledOpenURL(_:))) | |
swizzle(UIApplication.self, #selector(open(_:options:completionHandler:)), #selector(swizzledOpen(_:options:completionHandler:))) | |
} | |
@objc func swizzledOpenURL(_ url: URL) { | |
print(">>>>>url", url) | |
} | |
NewerOlder