Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
younatics authored May 7, 2017
1 parent dcd0a2a commit e08cfd3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ github "younatics/Highlighter"
## Usage
Set object(`Any`), text (`String`), attributes (`[String : Any]?`). This method will find every text in your `[UILabel]` and highlight them
```swift
Highlighter.highlight(object: Any, at: String, attributes: [String : Any]?)
Highlighter.highlight(object: Any, at: String, normal: attributes, highlight: attributes)
```

or you can also set type(`HighlighterType`)
```swift
Highlighter.highlight(object: Any, at: String, attributes: [String : Any]?, type: HighlighterType)
Highlighter.highlight(object: Any, at: String, normal: attributes, highlight: attrib, type: HighlighterType)
```

## Examples
Expand All @@ -53,7 +53,7 @@ func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> U
guard let cell = self.ynSearchListViewDelegate?.ynSearchListView(tableView, cellForRowAt: indexPath) as? SearchViewCell else { return UITableViewCell() }

if let changedText = ynSearchTextFieldText {
Highlighter.highlight(object: cell, at: changedText, attributes: [NSBackgroundColorAttributeName: UIColor.yellow])
Highlighter.highlight(object: cell, at: changedText, normal: nil, highlight: [NSBackgroundColorAttributeName: UIColor.yellow])
}
return cell
}
Expand Down

0 comments on commit e08cfd3

Please sign in to comment.