Skip to content

Instantly share code, notes, and snippets.

@morteza2128
Last active April 17, 2019 19:44
Show Gist options
  • Save morteza2128/5cd843c4776318f374c0ce681202c132 to your computer and use it in GitHub Desktop.
Save morteza2128/5cd843c4776318f374c0ce681202c132 to your computer and use it in GitHub Desktop.
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