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

Xcode 15 SwiftUI Preview layout #62

Closed
kimkyuchul opened this issue Mar 14, 2024 · 0 comments
Closed

Xcode 15 SwiftUI Preview layout #62

kimkyuchul opened this issue Mar 14, 2024 · 0 comments
Assignees
Labels

Comments

@kimkyuchul
Copy link
Owner

Xcode 15 이상부터 Preview에 Previewlayout 설정하는 방법

#Preview {
    CardView(scrum: DailyScrum.sampleData[1])
        .previewLayout(.fixed(width: 400, height: 60))
}
  • #Preview로 바뀌면서 previewLayout이 먹질 않음
  • 아래 방법으로 해야 함
#Preview(traits: .fixedLayout(width: 400, height: 60)) {
    CardView(scrum: DailyScrum.sampleData[1])
}
  • When using the #Preview macro, the settings that you would previously attach as modifiers are now added as traits to the macro declaration

[Xcode 15: SwiftUI preview layout: size that fits does not work](https://stackoverflow.com/questions/77167973/xcode-15-swiftui-preview-layout-size-that-fits-does-not-work)

@kimkyuchul kimkyuchul self-assigned this Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant