Skip to content

Commit 22d3225

Browse files
authored
Fix example project and hide mutations in autocomplete API (GitHawkApp#18)
* fix example building * safer API for registering autocomplete attributes
1 parent a7636d0 commit 22d3225

File tree

6 files changed

+144
-131
lines changed

6 files changed

+144
-131
lines changed

Examples/Examples/ViewController.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ class ViewController: MessageViewController, UITableViewDataSource, UITableViewD
4141

4242
// Set custom attributes for an autocompleted string
4343
let tintColor = UIColor(red: 0, green: 122/255, blue: 1, alpha: 1)
44-
messageAutocompleteController.autocompleteTextAttributes = ["@": [.font: UIFont.preferredFont(forTextStyle: .body), .foregroundColor: tintColor, .backgroundColor: tintColor.withAlphaComponent(0.1)]]
44+
messageAutocompleteController.registerAutocomplete(prefix: "@", attributes: [
45+
.font: UIFont.preferredFont(forTextStyle: .body),
46+
.foregroundColor: tintColor,
47+
.backgroundColor: tintColor.withAlphaComponent(0.1)
48+
])
4549

4650
messageAutocompleteController.delegate = self
4751

Examples/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ EXTERNAL SOURCES:
99
:path: ../MessageViewController.podspec
1010

1111
SPEC CHECKSUMS:
12-
MessageViewController: 619f0c8253f4eb36f69c906d5a38592de857a433
12+
MessageViewController: 3aa9b7b422677de3a8bc026ef39b0c0f83ccc185
1313

1414
PODFILE CHECKSUM: 74208e93c3daf191e681c80fcdf956f1603f9016
1515

16-
COCOAPODS: 1.4.0.rc.1
16+
COCOAPODS: 1.4.0

Examples/Pods/Local Podspecs/MessageViewController.podspec.json

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Examples/Pods/Manifest.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)