Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add anchorPoint to ViewMapAnnotation #53

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Commits on Sep 7, 2023

  1. Configuration menu
    Copy the full SHA
    a3b276a View commit details
    Browse the repository at this point in the history

Commits on Oct 2, 2023

  1. Add anchorPoint on ViewMapAnnotation.

    This uses `anchorPoint` from `UIView` when available (iOS 16+), otherwise it relies on `MKAnnotationView` `centerOffset` and converts the `anchorPoint` percentages into pixel values.
    darronschall committed Oct 2, 2023
    Configuration menu
    Copy the full SHA
    0702773 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a6ef5ab View commit details
    Browse the repository at this point in the history
  3. Bring back clear background on annotations.

    After applying the frame fix in the previous commit, the annotations displayed on the map with a white background. This brings back the clear background they previously had.
    darronschall committed Oct 2, 2023
    Configuration menu
    Copy the full SHA
    ec95a3b View commit details
    Browse the repository at this point in the history
  4. Make anchorPoint a UnitPoint instead of CGPoint

    `UnitPoint` - https://developer.apple.com/documentation/swiftui/unitpoint - is more SwiftUI-y than `CGPoint`, and will allow the anchorPoint to use the constants like `.center` and `.bottom`.
    
    Extract extensions to make it trivial to convert the `UnitPoint` to a `centerOffset` within a rect, and to convert back to a `CGPoint` for the `UIView` `anchorPoint` property.
    darronschall committed Oct 2, 2023
    Configuration menu
    Copy the full SHA
    51240d6 View commit details
    Browse the repository at this point in the history
  5. Fix macOS build failure.

    The `#available(iOS 16)` wasn't preventing the `anchorPoint` from being set, but that is only available on `UIView`, not `NSView`. Ensuring `UIKit` is available fixes the error, and we fall back to `centerOffset` otherwise.
    darronschall committed Oct 2, 2023
    Configuration menu
    Copy the full SHA
    2d8951c View commit details
    Browse the repository at this point in the history