Created
November 24, 2020 12:52
-
-
Save growvv/e58860c589d1a3658265dc77585ca23e to your computer and use it in GitHub Desktop.
创建一个页面:由于已经用storyboard绘制好,只需要给相应变量赋值即可
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
// | |
// DetailViewController.swift | |
// Swift-TableView-Example | |
// | |
// Created by Bilal ARSLAN on 12/10/14. | |
// Copyright (c) 2014 Bilal ARSLAN. All rights reserved. | |
// | |
import Foundation | |
import UIKit | |
class DetailViewController: UIViewController { | |
@IBOutlet var imageView: UIImageView! | |
@IBOutlet var nameLabel: UILabel! | |
@IBOutlet var prepTime: UILabel! | |
var recipe: Recipe? | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
if let recipe = recipe { | |
navigationItem.title = recipe.name | |
imageView.image = UIImage(named: recipe.thumbnails) | |
nameLabel.text = recipe.name | |
prepTime.text = "Prep Time: " + recipe.prepTime | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment