Skip to content

Instantly share code, notes, and snippets.

@squarefrog
Forked from zcrowe/AmigoHelper.swift
Created January 5, 2018 10:35
Show Gist options
  • Save squarefrog/a1b9bdf7e5b74a034bf26197673c34b3 to your computer and use it in GitHub Desktop.
Save squarefrog/a1b9bdf7e5b74a034bf26197673c34b3 to your computer and use it in GitHub Desktop.
struct AmigoHelper: Codable {
var username: String? = nil
var name: String? = nil
var userID: String? = nil
var email: String? = nil
//var customData: Array<Any>? = nil
init (username: String? = nil,
name: String? = nil,
userID: String? = nil,
email: String? = nil
//customData: Array<Any>? = nil
) {
self.username = username
self.name = name
self.userID = userID
self.email = email
//self.customData = customData
}
func updateData () {
let encoder = JSONEncoder()
let data = try! encoder.encode(self)
print(String(data: data, encoding: .utf8)!)
}
func getData () {
print("Get Data")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment