Skip to content

Instantly share code, notes, and snippets.

@simrandotdev
Created July 20, 2020 06:53
Show Gist options
  • Select an option

  • Save simrandotdev/7d9ec5579083bbe401052c1dcc97d7ab to your computer and use it in GitHub Desktop.

Select an option

Save simrandotdev/7d9ec5579083bbe401052c1dcc97d7ab to your computer and use it in GitHub Desktop.
Setting a Custom UIView inside other UIView
func settingViewsFrames() {
let v1 = UIView(frame: CGRect(x: 113, y: 111, width: 132, height: 194))
v1.backgroundColor = UIColor(red: 1, green: 0.4, blue: 1, alpha: 1)
v1.clipsToBounds = true
let v2 = UIView(frame: CGRect(x: 10, y: 10, width: 112, height: 174))
v2.backgroundColor = UIColor(red: 0.5, green: 1, blue: 0, alpha: 1)
let v3 = UIView(frame: CGRect(x: 43, y: 197, width: 160, height: 230))
v3.backgroundColor = UIColor(red: 1, green: 0, blue: 0, alpha: 1)
self.view.addSubview(v1)
v1.addSubview(v2)
self.view.addSubview(v3)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment