gistlib
In order to create a UIView and set its background color to red, follow these steps:
main.swiftlet myView = UIView(frame: CGRect(x: 0, y: 0, width: 200, height: 200)) 72 chars2 lines
let myView = UIView(frame: CGRect(x: 0, y: 0, width: 200, height: 200))
main.swiftmyView.backgroundColor = .red 30 chars2 lines
myView.backgroundColor = .red
main.swiftview.addSubview(myView) 24 chars2 lines
view.addSubview(myView)
Here's the complete code:
main.swiftlet myView = UIView(frame: CGRect(x: 0, y: 0, width: 200, height: 200)) myView.backgroundColor = .red view.addSubview(myView) 126 chars4 lines
let myView = UIView(frame: CGRect(x: 0, y: 0, width: 200, height: 200)) myView.backgroundColor = .red view.addSubview(myView)
gistlibby LogSnag