jordibruin / jordibruin/visionOS-Examples

Xcode 15.2 Compile Errors: `attachmentAnchor` argument of `ornament` modifier now demands UnitPoint instead of Alignment

Open
#2 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
235
Forks
14
PR merge metrics
No merged PRs in 30d

Description

## Error description

In Xcode15.2, compile errors occur because `attachmentAnchor` argument of [`ornament` modifier](https://developer.apple.com/documentation/SwiftUI/View/ornament(visibility:attachmentAnchor:contentAlignment:ornament:)) now demands [UnitPoint](https://developer.apple.com/documentation/swiftui/unitpoint) instead of [Alignment](https://developer.apple.com/documentation/swiftui/alignment):

```
Cannot convert value of type `Alignment` to expected argument type 'UnitPoint'

Extraneous argument label 'alignment:' in call Remove 'alignment: '
```

## Screenshots

截屏2024-01-14 20 10 30
截屏2024-01-14 20 10 42

## Solution

Change Alignment with UnitPoint, like creating a new computed property `unitPoint` in the struct 'OrnamentAlignment'

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.