Skip to content

Commit

Permalink
Make highlight attributes the same size as the font
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianeEnnaji committed Jun 21, 2018
1 parent 97cb555 commit a7c6db7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions SearchTextField/Classes/SearchTextField.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ open class SearchTextField: UITextField {
/// Set your custom visual theme, or just choose between pre-defined SearchTextFieldTheme.lightTheme() and SearchTextFieldTheme.darkTheme() themes
open var theme = SearchTextFieldTheme.lightTheme() {
didSet {
highlightAttributes = [.font: UIFont.boldSystemFont(ofSize: theme.font.pointSize)]
tableView?.reloadData()

if let placeholderColor = theme.placeholderColor {
Expand Down Expand Up @@ -78,6 +79,7 @@ open class SearchTextField: UITextField {
open var userStoppedTypingHandler: (() -> Void)?

/// Set your custom set of attributes in order to highlight the string found in each item
/// Set it after setting the theme
open var highlightAttributes: [NSAttributedStringKey: AnyObject] = [.font: UIFont.boldSystemFont(ofSize: 10)]

/// Start showing the default loading indicator, useful for searches that take some time.
Expand Down

0 comments on commit a7c6db7

Please sign in to comment.