swift3 - Swift 3: how to get the width&height of imageview after loading view? -




i want width , height of image view after set image of imageview after view loading. used below source, failed them. got original width & height (50, 50). destination image loaded on imageview successfully.(size: 1050x890)

var photoname: string?  override func viewdidload() {     if let photoname = photoname {         imageview.image = uiimage(named: photoname)     } }  fileprivate func updateminzoomscaleforsize(_ size: cgsize) {     let width = imageview.frame.size.width     let height = imageview.frame.size.height     let widthscale = size.width / width     let heightscale = size.height / height     let minscale = min(widthscale, heightscale)      scrollview.minimumzoomscale = minscale      scrollview.zoomscale = minscale }  override func viewdidlayoutsubviews() {     super.viewdidlayoutsubviews()      updateminzoomscaleforsize(view.bounds.size) } 

where fault? please me! thank reading question.





wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -