Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a variable to disable highlight attributes #128

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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