Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Code reviewing in iOS app development

Code reviewing in iOS app development

Code reviewing in iOS app development
@Kansai Mobile Conference #2

yashigani

May 20, 2015
Tweet

More Decks by yashigani

Other Decks in Programming

Transcript

  1. class ViewController: UIViewController { @IBOutlet weak var textView: UITextView! {

    didSet { textView.textContainerInset = UIEdgeInsets(top: 16, left: 16, bottom: 16, right: 16) } } }
  2. @IBDesignable class BorderedLabel: UILabel { @IBInspectable var borderColor: UIColor? {

    get { return UIColor(CGColor: self.layer.borderColor) } set { self.layer.borderColor = newValue?.CGColor ?? nil } } @IBInspectable var borderWidth: CGFloat = 1.0 { didSet { layer.borderWidth = borderWidth } } @IBInspectable var cornerRadius: CGFloat = 0.0 { didSet { layer.cornerRadius = cornerRadius layer.masksToBounds = cornerRadius > 0.0 } } }
  3. @IBDesignable class BorderedLabel: UILabel { @IBInspectable var borderColor: UIColor? {

    get { return UIColor(CGColor: self.layer.borderColor) } set { self.layer.borderColor = newValue?.CGColor ?? nil } } @IBInspectable var borderWidth: CGFloat = 1.0 { didSet { layer.borderWidth = borderWidth } } @IBInspectable var cornerRadius: CGFloat = 0.0 { didSet { layer.cornerRadius = cornerRadius layer.masksToBounds = cornerRadius > 0.0 } } }
  4. class BookmarkManager { let manager: UserManager init(_ manager: UserManager) {

    self.manager = manager } } class ViewController: UIViewController { var userManager: UserManager! var bookmarkManager: BookmarkManager! override func viewDidLoad() { bookmarkManager = BookmarkManager(userManager) } }
  5. class BookmarkManager { let manager: UserManager init(_ manager: UserManager) {

    self.manager = manager } } class ViewController: UIViewController { var userManager: UserManager! lazy var bookmarkManager: BookmarkManager = BookmarkManager(self.userManager) }