width,height以外のminXなどちゃんと理解できていなかったので理解のために書きます
参考URL:https://developer.apple.com/reference/coregraphics/cgrect
ViewController.swift
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
var x:CGFloat = self.view.bounds.origin.x
var y:CGFloat = self.view.bounds.origin.x
var width:CGFloat = self.view.bounds.size.width
var height:CGFloat = self.view.bounds.size.height
var frame:CGRect = CGRect(x:x, y:y, width:width ,height:height )
var view = UIView(frame:frame)
view.backgroundColor = UIColor.green
self.view.addSubview(view)
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
ここからgoogle翻訳さんに頼って翻訳します
<img width="414" alt="Simulator Screen Shot 2017.04.08 17.15.30.png" src="https://qiita-image-store.s3.amazonaws.com/0/133940/36bc36bb-cdb5-032f-9404-16f59cc3b3b9.png">
var height: CGFloat
Returns the height of a rectangle.
長方形の高さを返します。
var width: CGFloat
Returns the width of a rectangle.
長方形の幅を返します。
var minX: CGFloat
Returns the smallest value for the x-coordinate of the rectangle.
長方形のx座標の最小値を返します。
var midX: CGFloat
Returns the x- coordinate that establishes the center of a rectangle.
長方形の中心を設定するx座標を返します。
var maxX: CGFloat
Returns the largest value of the x-coordinate for the rectangle.
長方形のx座標の最大値を返します。
var minY: CGFloat
Returns the smallest value for the y-coordinate of the rectangle.
長方形のy座標の最小値を返します。
var midY: CGFloat
Returns the y-coordinate that establishes the center of the rectangle.
長方形の中心を設定するy座標を返します。
var maxY: CGFloat
Returns the largest value for the y-coordinate of the rectangle.
長方形のy座標の最大値を返します。
ViewController.swift
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
var x:CGFloat = self.view.bounds.origin.x
var y:CGFloat = self.view.bounds.origin.x
var width:CGFloat = self.view.bounds.size.width
var height:CGFloat = self.view.bounds.size.height
x = self.view.bounds.midX
var frame:CGRect = CGRect(x:x, y:y, width:width ,height:height )
var view = UIView(frame:frame)
view.backgroundColor = UIColor.green
self.view.addSubview(view)
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
x座標を長方形の中心にしてしたため

こんな感じで行って行くと
最初値は0なので
x = self.view.bounds.minX

xを最大にすると見えなくなります。
x = self.view.bounds.maxX

y座標の最小値は最初の0と変わらないので同じ見え方
y = self.view.bounds.minY

y座標が中心になるので下半分が塗りつぶされます。
y = self.view.bounds.midY

yがマックスになってしまうので見えません
y = self.view.bounds.maxY

色々な使い方があるかもしれませんがとりあえず。
一回ちゃんと見ると頭で考えるより想像しやすくなったような。
そしてself.viewのバックカラーを何かにしとけば見えやすかったのかなーと少し悩んでます