Last active
April 17, 2019 19:44
-
-
Save morteza2128/5cd843c4776318f374c0ce681202c132 to your computer and use it in GitHub Desktop.
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 AppComponentConfig: ComponentConfig, Decodable { | |
var identifier: String = "" | |
var componentName: String = "" | |
var launchOnInit: Bool = false | |
var acceptPush: Bool = false | |
var urlScheme: String = "" | |
private enum CodingKeys: String, CodingKey { | |
case identifier | |
case componentName | |
case launchOnInit | |
case acceptPush | |
case urlScheme | |
} | |
required init(from decoder:Decoder) throws { | |
let container = try decoder.container(keyedBy: CodingKeys.self) | |
identifier = try container.decode(String.self, forKey: .identifier) | |
componentName = try container.decode(String.self, forKey: .componentName) | |
launchOnInit = try container.decode(Bool.self, forKey: .launchOnInit) | |
acceptPush = try container.decode(Bool.self, forKey: .acceptPush) | |
urlScheme = try container.decode(String.self, forKey: .urlScheme) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment