Skip to content

Instantly share code, notes, and snippets.

@vagmi
Created March 2, 2016 01:05
Show Gist options
  • Save vagmi/c995299f66c91d6f726d to your computer and use it in GitHub Desktop.
Save vagmi/c995299f66c91d6f726d to your computer and use it in GitHub Desktop.
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