File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -261,19 +261,28 @@ In the method, provide a reason why you closed the tip:
261
261
- `.displayCountExceeded` - the tip has been shown the maximum number of times
262
262
- `.tipClosed` - the user has clearly closed the tip
263
263
264
- In UIKit, you need to add code for the cross. For `popover`- tip, close the controller:
264
+ In UIKit, you need to add code for the cross.
265
+ For `popover`- tip, close the controller:
265
266
266
267
```swift
267
- if presentedViewController is TipUIPopoverViewController {
268
- dismiss (animated : true )
268
+ if shouldDisplay {
269
+ ...
270
+ } else {
271
+ if presentedViewController is TipUIPopoverViewController {
272
+ dismiss (animated : true )
273
+ }
269
274
}
270
275
```
271
276
272
277
For the `inline`- tip, we remove the view:
273
278
274
279
```swift
275
- if let tipView = view.subviews.first (where : { $0 is TipUIView }) {
276
- tipView.removeFromSuperview ()
280
+ if shouldDisplay {
281
+ ...
282
+ } else {
283
+ if let tipView = view.subviews.first (where : { $0 is TipUIView }) {
284
+ tipView.removeFromSuperview ()
285
+ }
277
286
}
278
287
```
279
288
@@ -490,4 +499,4 @@ Add to AppDelegate:
490
499
try ? Tips.resetDatastore ()
491
500
```
492
501
493
- > Remember to remove `.resetDatastore `, otherwise the tips will be shown all the time in the release.
502
+ > Remember to remove `.resetDatastore `, otherwise the tips will be shown all the time in the release.
You can’t perform that action at this time.
0 commit comments