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
| git_url "這邊放置你剛剛所建立的 git repo url" | |
| type "development" | |
| app_identifier ["這邊放置你在 App IDs 裡頭新建好的 Bundle Ifentifier"] | |
| username "這邊放置你所要來處理 Certificate 相關的帳號名稱" |
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
| drop.get("/") { | |
| request in | |
| return "Hello World!" | |
| } |
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
| drop.get("/name", ":name", handler: { | |
| request in | |
| if let name = request.parameters["name"]?.string { | |
| return "Hello \(name)!" | |
| } | |
| return "Error retrieving parameters." | |
| }) |
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
| drop.get("/view") { request in | |
| return try drop.view("demoView.html") | |
| } |
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
| { | |
| "name": "Archie", | |
| "address": { | |
| "zipCode": "12345" | |
| } | |
| } |
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 ViewController: UIViewController { | |
| @IBOutlet private weak var nameTextField: UITextField! | |
| @IBOutlet private weak var passwordTextField: UITextField! | |
| @IBOutlet private weak var addressTextField: UITextField! | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| setUpView() | |
| } | |
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 ViewController: UIViewController { | |
| @IBOutlet private weak var nameTextField: UITextField! { | |
| didSet { | |
| nameTextField.placeholder = "給值" | |
| } | |
| } | |
| @IBOutlet private weak var passwordTextField: UITextField! { | |
| didSet { | |
| passwordTextField.placeholder = "給值" | |
| } |
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
| struct User { | |
| var id: String | |
| var name: String | |
| var age: Int | |
| } | |
| struct UserViewModel { | |
| var title: String | |
| var content: String | |
| init(user: User) { |
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
| protocol UITableViewCellRepresentable { | |
| associatedtype CellType: UITableViewCell | |
| func cell(_ tableView: UITableView, indexPath: IndexPath) -> Self.CellType | |
| } |
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
| func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { | |
| return viewModels[indexPath.row].cell(tableView, indexPath: indexPath) | |
| } |