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 request = self.paymentRepository.createPKRequest(order: order) | |
if self.paymentRepository.canSubmit(paymentRequest: request) { | |
group.enter() | |
let paymentController = PaymentAuthorizationController() | |
paymentController.present(paymentRequest: request) { [weak self] controller, payment, authCompletion in | |
self?.paymentRepository.createStripeToken(payment: payment, completion: { token, error in | |
defer { group.leave() } | |
guard let token = token, error == nil else { |
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 request = self.paymentRepository.createPKRequest(order: order) | |
if self.paymentRepository.canSubmit(paymentRequest: request) { | |
group.enter() | |
let paymentController = PaymentAuthorizationController() | |
paymentController.present(paymentRequest: request) { [weak self] controller, payment, authCompletion in | |
self?.paymentRepository.createStripeToken(payment: payment, completion: { token, error in | |
defer { group.leave() } | |
guard let token = token, error == nil else { |
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 request = self.paymentRepository.createPKRequest(order: order) | |
if self.paymentRepository.canSubmit(paymentRequest: request) { | |
group.enter() | |
let paymentController = PaymentAuthorizationController() | |
paymentController.present(paymentRequest: request) { [weak self] controller, payment, authCompletion in | |
self?.paymentRepository.createStripeToken(payment: payment, completion: { token, error in | |
defer { group.leave() } | |
guard let token = token, error == nil else { |
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 query: [String:Any] = [ | |
kSecClass as String: kSecClassGenericPassword, | |
kSecAttrSynchronizable as String: kCFBooleanFalse, | |
kSecAttrAccount as String: "accountName".data(using: .utf8)!, | |
kSecReturnData as String: kCFBooleanTrue | |
] | |
var result: AnyObject? | |
let status: OSStatus = withUnsafeMutablePointer(to: &result) { | |
SecItemCopyMatching(query as CFDictionary, UnsafeMutablePointer($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
let query: [String:Any] = [ | |
kSecClass as String: kSecClassGenericPassword, | |
kSecAttrSynchronizable as String: kCFBooleanTrue, | |
kSecAttrAccount as String: "accountName".data(using: .utf8)!, | |
kSecReturnData as String: kCFBooleanTrue | |
] | |
var result: AnyObject? | |
let status: OSStatus = withUnsafeMutablePointer(to: &result) { | |
SecItemCopyMatching(query as CFDictionary, UnsafeMutablePointer($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
let query: [String:Any] = [ | |
kSecClass as String: kSecClassGenericPassword, | |
kSecAttrSynchronizable as String: kCFBooleanTrue, | |
kSecAttrAccount as String: "accountName".data(using: .utf8)!, | |
kSecValueData as String: "data to store".data(using: .utf8)!, | |
] | |
let status: OSStatus = SecItemAdd(addQuery as CFDictionary, 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
func configureCalendar(_ calendar: JTAppleCalendarView) -> ConfigurationParameters { | |
formatter.dateFormat = "yyyy MM dd" | |
formatter.timeZone = Calendar.current.timeZone | |
formatter.locale = Calendar.current.locale | |
let startDate = formatter.date(from: "2017 01 01")! | |
let endDate = formatter.date(from: "2017 12 31")! | |
let parameters = ConfigurationParameters( | |
startDate: startDate, |
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
const animationConfigs = new Map([ | |
[AnimationType.spring, { | |
duration: 300, | |
update: { | |
type: LayoutAnimation.Types.spring, | |
springDamping: 0.5 | |
}, | |
}], | |
[AnimationType.linear, { | |
duration: 300, |
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
const PropertiesEnum = { | |
opacity: true, | |
scaleXY: true, | |
}; | |
const Properties = keyMirror(PropertiesEnum); |