I have to set autoresizingMask programmatically for UIView.
UIView
I don\'t know how to implement this.
Swift 4.1:
view.autoresizingMask = [.flexibleHeight, .flexibleWidth, .flexibleTopMargin, .flexibleRightMargin, .flexibleLeftMargin, .flexibleBottomMargin]