@@ -37,7 +37,7 @@ Once you have your Swift package set up, adding as a dependency is as easy as ad
3737
3838``` swift
3939dependencies: [
40- .package (url : " https://github.com/htmlprogrammist/EmojiPicker" , .upToNextMajor (from : " 2.1.1 " ))
40+ .package (url : " https://github.com/htmlprogrammist/EmojiPicker" , .upToNextMajor (from : " 3.0.0 " ))
4141]
4242```
4343
@@ -59,8 +59,9 @@ Create `UIButton` and add selector as action:
5959
6060``` swift
6161@objc private func openEmojiPickerModule (sender : UIButton) {
62- let configuration = Configuration (delegate : self , sender : sender)
63- let viewController = EmojiPickerViewController (configuration : configuration)
62+ let viewController = EmojiPickerViewController ()
63+ viewController.delegate = self
64+ viewController.sourceView = sender
6465 present (viewController, animated : true )
6566}
6667```
@@ -77,11 +78,21 @@ extension ViewController: EmojiPickerDelegate {
7778
7879## Usage
7980
80- ### Required parameters
81+ ### Delegate
8182
82- - ` delegate ` : delegate for EmojiPicker to provide chosen emoji.
83+ Delegate for EmojiPicker to provide chosen emoji.
8384
84- - ` sender ` : a view containing the anchor rectangle for the popover. You can create any ` UIView ` instances and set them as the ` sender ` .
85+ ``` swift
86+ viewController.delegate = self
87+ ```
88+
89+ ### Source View
90+
91+ A view containing the anchor rectangle for the popover. You can create any ` UIView ` instances and set them as the ` sender ` .
92+
93+ ``` swift
94+ viewController.sourceView = sender
95+ ```
8596
8697Also, there is way more settings for configuration:
8798
@@ -90,47 +101,47 @@ Also, there is way more settings for configuration:
90101Color for the selected emoji category. The default value of this property is ` .systemBlue ` .
91102
92103``` swift
93- configuration .selectedEmojiCategoryTintColor = .systemRed
104+ viewController .selectedEmojiCategoryTintColor = .systemRed
94105```
95106
96107### Arrow direction
97108
98109The direction of the arrow for EmojiPicker. The default value of this property is ` .up ` .
99110
100111``` swift
101- configuration .arrowDirection = .up
112+ viewController .arrowDirection = .up
102113```
103114
104115### Horizontal inset
105116
106117Inset from the ` sourceView ` border. The default value of this property is ` 0 ` .
107118
108119``` swift
109- configuration .horizontalInset = 0
120+ viewController .horizontalInset = 0
110121```
111122
112123### Is dismiss after choosing
113124
114125Defines whether to dismiss emoji picker or not after choosing. The default value of this property is ` true ` .
115126
116127``` swift
117- configuration .isDismissAfterChoosing = true
128+ viewController .isDismissAfterChoosing = true
118129```
119130
120131### Custom height
121132
122133Custom height for EmojiPicker. The default value of this property is ` nil ` .
123134
124135``` swift
125- configuration .customHeight = 300
136+ viewController .customHeight = 300
126137```
127138
128139### Feedback generator style
129140
130141Feedback generator style. To turn off, set ` nil ` to this parameter. The default value of this property is ` .light ` .
131142
132143``` swift
133- configuration .feedbackGeneratorStyle = .soft
144+ viewController .feedbackGeneratorStyle = .soft
134145```
135146
136147## To Do
0 commit comments