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
{ | |
"General": { | |
"BaseCurrency": "BTC", | |
"BuyStrategy": "EMASPREAD", | |
"BuyValue": "-0.3", | |
"Cost": "2.5", | |
"DcaEnabled": "-1.5", | |
"DcaMaxBuySpread": "1.5", | |
"DcaMaxBuyTimes": "5", | |
"DcaMaxCost": "0", |
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
//: Playground - noun: a place where people can play | |
import Foundation | |
protocol EventType { | |
var name: String { get } | |
var info: [ String : Any ] { get } | |
} | |
protocol TimedEventType { |
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
//: Playground - noun: a place where people can play | |
import Foundation | |
protocol EventType { | |
var name: String { get } | |
var category: String? { get } | |
var info: [ String : Any ] { get } | |
} | |
enum SBTEvents:EventType { |
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
module.exports = { | |
body: { | |
email: Joi.string().email().required(), | |
password: Joi.string().regex(/[a-zA-Z0-9]{3,30}/).required() | |
} | |
}; |
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 ObjectiveC | |
fileprivate struct Keys { | |
static var notificationActive = "lp_notificationActive" | |
static var notificationDeffered = "lp_notificationDeferred" | |
} | |
fileprivate extension NotificationCenter { |
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
if let userInfo = launchOptions?[.remoteNotification] as? [AnyHashable : Any], | |
let notification = notificationFactory(userInfo: userInfo) { | |
NotificationCenter.default.post(notification) | |
} |
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
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], | |
fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) { | |
if let notification = notificationFactory(userInfo: userInfo) { | |
NotificationCenter.default.post(notification) | |
} | |
completionHandler(.noData) | |
} |
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
fileprivate func notificationFactory(userInfo: [AnyHashable : Any]) -> RemoteNotificationType? { | |
guard let type = userInfo["type"] as? String else { return nil } | |
if type == Notifications.openUserProfile.name.rawValue { | |
return Notifications.openUserProfile(userInfo: userInfo) | |
} | |
return nil | |
} |
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
extension Notifications { | |
struct openUserProfile: RemoteNotificationType { | |
var userId:String | |
var title: String? | |
var alert: String? | |
static var name: Notification.Name { | |
return Notification.Name("LP_openUserProfile") | |
} |
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 RemoteNotificationType: NotificationType { | |
var title:String? { get } | |
var alert:String? { get } | |
init?(userInfo: [AnyHashable : Any ]) | |
} |
NewerOlder