So i found the solution! If we want to customize our button or view or something else view gradient background
if we use only layout and don't use CGRect for button or UIView doesn't matter frame of our UIView is gonna be 0, 0, 0, 0
therefore
gradient.frame = (0, 0, 0, 0)
but its only in ViewDidLoad method:)
if we will use viewDidLayoutSubviews() method, we will get updated size of our button or view
and therefore we have to do
override func viewDidLayoutSubviews()
{
super.viewDidLayoutSubviews...
gradient.frame = view.bounds
}