默认情况下,“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")
}
}