Created
September 22, 2014 12:20
-
-
Save barrault01/db9f91b229ca93f29060 to your computer and use it in GitHub Desktop.
Some Implementation of LiveNibView Subclass
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
// | |
// InputView.swift | |
// abcdapp | |
// | |
// Created by Antoine Barrault on 21/08/2014. | |
// Copyright (c) 2014 Citrus Lab. All rights reserved. | |
// | |
import UIKit | |
class InputView: LiveNibView { | |
@IBOutlet weak var imageView: UIImageView! | |
@IBOutlet weak var textField: UITextField! | |
/* | |
// Only override drawRect: if you perform custom drawing. | |
// An empty implementation adversely affects performance during animation. | |
override func drawRect(rect: CGRect) | |
{ | |
// Drawing code | |
} | |
*/ | |
@IBInspectable internal var textFieldText: String = "" { | |
didSet { | |
self.proxyView().textField.text = textFieldText | |
} | |
} | |
@IBInspectable internal var textFieldPlaceholder: String = "" { | |
didSet { | |
self.proxyView().textField.placeholder = textFieldPlaceholder | |
} | |
} | |
@IBInspectable internal var iconImage: UIImage = UIImage() { | |
didSet { | |
self.proxyView().imageView.image = iconImage | |
} | |
} | |
override func nibName() -> String { | |
return "InputView" | |
} | |
private func proxyView() -> InputView { | |
return self.proxyView! as InputView | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment