I have a UIImage and i need to use voice over to read the accessibility label . Currently voice over does not detect the string accessibilityLabel and just says "image" instead of the string . I am having hard time voice over to read userName instead of just image This how i am doing:
//username i am using for accessibility string
var userName: String {
return "Ashton"
}
// the .image here is in the userNameModel is UIImage and not imageView
userNameModel.image.isAccessibilityElement = true
userNameModel.image.accessibilityLabel = userName
What am i doing wrong ?