Closed shirakaba closed 6 years ago
Okay, I've solved it. In tutorialViewsToHighlight()
, I was returning []
rather than nil
when I wanted to specify "no UIViews to be highlighted".
func tutorialViews(toHighlight index: Int) -> [UIView]! {
switch(index){
case 0:
return []
case 1:
return [toolbarMimicStack.arrangedSubviews[0], toolbarMimicStack.arrangedSubviews[1]]
default:
return []
}
}
I've created pull request #11 to enable the user to enter either nil
or []
.
Version
1.3.1
Code
Expected behaviour
Should be able to click on any dark part of the screen to advance the tutorial.
Actual behaviour
Whether I return
true
orfalse
from the delegate, I must click in the highlighted area in order to advance the tutorial.This is true regardless of whether
tutorialViewsToHighlight()
has returned an empty or filled array of UIViews.Interestingly, if I comment-out the delegate completely, I am able to click anywhere at all to advance the tutorial.
Conclusion
The functionality to accept taps in all areas (including dark areas) works only if the delegate is not implemented. However, when the delegate is implemented, then
tutorialAcceptTapsOnHighlightsOnly()
ignores my return value, overriding it withreturn true
.