Created
March 2, 2016 01:05
-
-
Save vagmi/c995299f66c91d6f726d to your computer and use it in GitHub Desktop.
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
import UIKit | |
import React | |
import SnapKit | |
@objc(CustomRNView) | |
class CustomRNView : UIView { | |
var lblMessage:UILabel! | |
override init(frame: CGRect) { | |
super.init(frame: frame) | |
self.frame = frame | |
lblMessage = UILabel() | |
lblMessage.text = "initial message" | |
self.addSubview(lblMessage) | |
lblMessage.snp_makeConstraints { make in | |
make.top.equalTo(self.snp_top).offset(8) | |
make.left.equalTo(self.snp_left).offset(8) | |
} | |
} | |
required init?(coder aDecoder: NSCoder) { | |
fatalError("init(coder:) has not been implemented") | |
} | |
func setMessage(message: NSString) { | |
lblMessage.text = "\(message) Swifted" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment