swift開發筆記21 - Pinterest

let frame = CGRect(x: xOffset[column], y: yOffset[column], width: columnWidth, height: height)swift

let insetFrame = frame.insetBy(dx: cellPadding, dy: cellPadding)spa

 

attributes.frame.intersects(rect)3d

 

ceil(rect.height)ip

 

Variable 'photos' passed by reference before being initializedit

var photos: [Photo]io

 

if let photo = photoclass

Class 'AnnotatedPhotoCell' has no initializerssed

Initializer for conditional binding must have Optional type,model

// 類方法方法

class func allPhotos() -> [Photo] {}

 

if let patternImage = UIImage.init(named: "Pattern") {
  view.backgroundColor = UIColor.init(patternImage: patternImage)
}

 

// model刷新UI;
var photo: Photo? {
didSet{
if let photo = photo {
imageView.image = photo.image
captionLable.text = photo.caption
commentLabel.text = photo.comment
}
}
}

DESIGNATED,CONVENIENCE 和 REQUIRED

 http://swifter.tips/init-keywords/

相關文章
相關標籤/搜索