Skip to content

Commit

Permalink
Fix an issue with UITextField's _placeholderLabel
Browse files Browse the repository at this point in the history
> *** Terminating app due to uncaught exception 'NSGenericException',
> reason: 'Access to UITextField's _placeholderLabel ivar is prohibited. This is an application bug'
  • Loading branch information
bcylin committed Oct 9, 2020
1 parent adf5629 commit e41280c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class SearchAllViewController: UIViewController, UITableViewDataSource, UITableV
textfield.clipsToBounds = true
textfield.textColor = #colorLiteral(red: 0.2745098174, green: 0.4862745106, blue: 0.1411764771, alpha: 1)

if let label = textfield.value(forKey: "_placeholderLabel") as? UILabel {
if let label = textfield.value(forKey: "placeholderLabel") as? UILabel {
label.minimumScaleFactor = 0.8
label.adjustsFontSizeToFitWidth = true
}
Expand Down

0 comments on commit e41280c

Please sign in to comment.