Beginning and Intermediate Core Data – YouTube

original source : https://www.youtube.com/watch?v=0kmQA0aBIfM&index=14&list=PL23Revp-82LImHA8jL2dLaN_67pABFcyJ

core data stack을 보통 app delegate부분에서 초기화작업을 하는데 이런경우 복잡해지고 다른 프로젝트에서 사용이 불가능하므로 따로 초기화 작업을 하는 class를 만드는 작업을 설명한다.

Swift 4: Discardable Result – Patrick – Medium

Implementing iOS 8 Auto Layout Constraints in Swift Code – Techotopia

my review point is 10/10

NSLayoutConstraint 사용법의 예시 (길이10분정도)

//  ViewController.swift

//  boundsAndFrame

//

//  Created by AJ Norton on 8/27/15.

//  Copyright © 2015 AJ Norton. All rights reserved.

//

import UIKit

class ViewController: UIViewController {

 override func viewDidLoad() {

   super.viewDidLoad()

   // Do any additional setup after loading the view, typically from a nib.

   let v1 = UIView(frame: CGRectMake(50, 50, 300, 200))

   v1.backgroundColor = UIColor.redColor()

   self.view.addSubview(v1)

   let v2 = UIView()

   v2.backgroundColor = UIColor.greenColor()

   v2.setTranslatesAutoresizingMaskIntoConstraints(false)

   v1.addSubview(v2)

   v1.addConstraint(

     NSLayoutConstraint(item: v2,

       attribute: NSLayoutAttribute.Left,

     relatedBy: NSLayoutRelation.Equal,

     toItem: v1,

     attribute: .Left,

     multiplier: 1,

     constant: 0))

   v1.addConstraint(

     NSLayoutConstraint(item: v2,

       attribute: NSLayoutAttribute.Right,

       relatedBy: NSLayoutRelation.Equal,

       toItem: v1,

       attribute: .Right,

       multiplier: 1,

       constant: 0))

   v1.addConstraint(

     NSLayoutConstraint(item: v2,

       attribute: NSLayoutAttribute.Top,

       relatedBy: NSLayoutRelation.Equal,

       toItem: v1,

       attribute: .Top,

       multiplier: 1,

       constant: 0))

   v1.addConstraint(

     NSLayoutConstraint(item: v2,

       attribute: NSLayoutAttribute.Height,

       relatedBy: NSLayoutRelation.Equal,

       toItem: v1,

       attribute: .Height,

       multiplier: 0.5,

       constant: 0))

 }

 override func didReceiveMemoryWarning() {

   super.didReceiveMemoryWarning()

   // Dispose of any resources that can be recreated.

 }

}

Swift NSLayoutConstraint programatically sample code – Knowledge Stack