Swift:Avatar图片在swift代码中是必需的

时间:2017-05-24 02:51:11

标签: ios uiimageview uibutton swift2 uialertview

默认情况下,“no-profile-image”设置为imageview,用户应该在注册时强制上传个人资料图片,否则用户不应该允许导航到下一个屏幕。任何帮助都是值得的。 这是我的代码

lazy var profileLogo:UIImageView = {
        let profileLogo = UIComponentFactory.appImageView(UIImage(named: "no-profile-image")!, contentMode: .ScaleToFill, cornerRadius: LayoutService.width(15))
        profileLogo.userInteractionEnabled = false
        return profileLogo
    }()
 func nextButtonPressed() {
let noImage = UIImage(named: "no-profile-image")
            if self.mainView.profileLogo.image == nil && self.mainView.profileLogo.image == noImage{
                displayAlert("", message: "profile picture is mandatory, please upload it")
}
 }

0 个答案:

没有答案