how to Fit image view in the Screen in all iPhoneScreens

Viewed 71

I have created image-view programmatically with constraints

let imgName = "2017-01-18-2.png"
    let image = UIImage(named: imgName)
    let imgView = UIImageView(image: image!)

    imgView.frame = CGRect(x: 0, y: 0, width: 365, height: 667)
    view.addSubview(imgView)

But when im running in iPhone 5s its coming with full view (Full view Image) If I'm running in iPhone 7 its coming lil bit up (LilbitUp Image) I have searched all previous questions but all people saying create constraints in storyboard but I want to do with programatically If any help It would be appreciated Thank you in Advance

2 Answers
Related