The following code is throwing a warning for me after project is upgraded to Swift 5. Why is that? Can anyone tell me? why did they make it optional?
let attributes:[NSAttributedString.Key: Any] = [NSAttributedString.Key.font: self.userBioTextLabel.font]
- Coercion of implicitly unwrappable value of type 'UIFont?' to 'Any' does not unwrap optionally
- Provide a default value to avoid this
- warning Force-unwrap the value to avoid this warning
- Explicitly cast to 'Any' with 'as Any' to silence this warning