Last active
August 9, 2017 08:30
-
-
Save tonisuter/2f7899e76df0c0f71be5 to your computer and use it in GitHub Desktop.
SolutionLogger Example
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 Foundation | |
struct LogEntry: Codable { | |
let task: String | |
let solution: String | |
} | |
class ViewController: UIViewController { | |
// ...other code... | |
@IBAction func logSolution(_ sender: AnyObject) { | |
let solutionLogger = SolutionLogger(viewController: self) | |
solutionLogger.scanQRCode { code in | |
let entry = LogEntry(task: "Metalldetektor", solution: code) | |
solutionLogger.logSolution(entry) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment