I am developing an application in swift. I have 9 buttons in my storyboard and i set the content mode of the button images in viewDidLoad() function. But it takes a few seconds to set content modes, so my page is opening a little late. Is there any way to open my page without waiting.
override func viewDidLoad() {
super.viewDidLoad()
sizeBtn1.imageView?.contentMode = .scaleAspectFit
sizeBtn2.imageView?.contentMode = .scaleAspectFit
sizeBtn3.imageView?.contentMode = .scaleAspectFit
sizeBtn4.imageView?.contentMode = .scaleAspectFit
sizeBtn5.imageView?.contentMode = .scaleAspectFit
sizeBtn6.imageView?.contentMode = .scaleAspectFit
sizeBtn7.imageView?.contentMode = .scaleAspectFit
sizeBtn8.imageView?.contentMode = .scaleAspectFit
sizeBtn9.imageView?.contentMode = .scaleAspectFit
}
You can try in storyboard :
It may helps you. Thank you