So I'm pretty new to iOS Apps.
I found that placing a view in my app and sizing it to my needs is pretty similar to divs in HTML. Should I be using them this way?
Here's an example of a place I want to use a view.
I want to fill that in, should I be using a view here? or something more semantical?
end result with a view:
If you want to set a rectangle somewhere you could definitely use an
UIView(), If you´re using your storyboard make sure to set the right constraint and if you´re doing it programmatically you could do the following to get it work with all phone sizes:
let screen = UIScreen.main.bounds let anotherView = UIView(frame: CGRect(x: 0, y: 0, width: screen.width, height: 45)) anotherView.backgroundColor = UIColor.blue view.addSubview(anotherView)
let screen = UIScreen.mainScreen().bounds let anotherView = UIView(frame: CGRect(x: 0, y: 0, width: screen.width, height: 45)) anotherView.backgroundColor = UIColor.blueColor() view.addSubview(anotherView)