Skip to content

Commit

Permalink
Bk/improve overlay documentation (#264)
Browse files Browse the repository at this point in the history
* Fix example project

* Update overlay documentation
  • Loading branch information
bryankeller authored Sep 5, 2023
1 parent 937f2a9 commit 1e42185
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ final class TooltipView: UIView {

super.init(frame: .zero)

isUserInteractionEnabled = false
addSubview(backgroundView)
addSubview(label)
}
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,8 @@ final class TooltipView: UIView {

init(backgroundColor: UIColor, borderColor: UIColor, font: UIFont, textColor: UIColor) {
super.init(frame: .zero)

isUserInteractionEnabled = false

backgroundView.backgroundColor = backgroundColor
backgroundView.layer.borderColor = borderColor
Expand Down Expand Up @@ -515,6 +517,8 @@ final class TooltipView: UIView {
}
```

Note: An overlay view will have a size that closely matches the `bounds.size` of the calendar. To prevent your overlay view from intercepting touches, set `isUserInteractionEnabled` to `false`.

Next, we need a type that conforms to `CalendarItemViewRepresentable` that knows how to create and update instances of `TooltipView`. To make things easy, we can just make our view conform to this protocol:
```swift
import HorizonCalendar
Expand Down

0 comments on commit 1e42185

Please sign in to comment.