constraintをつけていく

全ての制約を削除するのは下のclear constraints

control dragで制約をつけることも可能

インスペクターペインでconstraintを確認することも可能

equal height

なるほど

Equal Hights Constraintで高さの比率を1:2、2:1などに出来る

viewのlayoutの名称をつけていく

なるほど!!

tapすると日付を表示する

@IBAction func changeLabel(sender: AnyObject) {
        var date:NSDate = NSDate();
        let format = NSDateFormatter()
        format.dateFormat = "yyyy-MM-dd HH:mm:ss"
        myLabel.text = format.stringFromDate(date)
    }

うーむ、mac買い換えて〜

調子に乗って、一週間後を表示

@IBAction func changeLabel(sender: AnyObject) {
        let now = NSDate()
        var date1:NSDate = NSDate(timeInterval: 60*60*24*7, sinceDate: now);
        let format = NSDateFormatter()
        format.dateFormat = "yyyy-MM-dd HH:mm:ss"
        myLabel.text = format.stringFromDate(date1)
    }

はいはいはい、なるほど!

一分前なら、マイナスにすればOKですね。

var date1:NSDate = NSDate(timeInterval: -60, sinceDate: now);

preview -> mainstoryboardでプレビューが観れる

swiftでテキストを変更する

class ViewController: UIViewController {
    
    
    @IBOutlet weak var myLabel: UILabel!
    @IBAction func changeLabel(sender: AnyObject) {
        myLabel.text = "you changed me"
    }

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }


}

ああああ、mac買い換えて〜
誰か譲ってくれないかな

strtotime

echo date("Y/m/d h:i:s");
echo "<br>";
echo date("Y/m/d h:i:s", strtotime(" - 2 sec"));

echo "<br>";
echo "<br>";
$date = "2018/05/20 12:30:00";
echo date("Y/m/d h:i:s", strtotime("$date -1 day"));
echo "<br>";
echo date("Y/m/d h:i:s", strtotime("$date -10 sec"));

ヤフオクをつくろう 機能要件

まず必要な機能とDBのテーブル

ユーザー(ユーザー名、住所、連絡先、)
出品(商品名、説明文、最低価格、即決価格)
入札(入札者、入札価格)
落札(落札者、落札価格)
評価(評価対象者、評価)

ユーザー登録、出品、評価はいつものパターンですが、問題は入札のところですね。
順番につくっていきましょう。
まずは、残り時間からつくっていきます。

iOSでtopに戻る

ViewController.swift

class ViewController: UIViewController {
    
    @IBAction func unwindToTop(seque: UIStoryboardSegue){
        
    }

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }


}

Main.storyboard
control でexitにもっていき、unwindToTopを設定する