Post

Replies

Boosts

Views

Activity

Reply to Best Way to Support Different Devices in SwiftUI?
Using ViewThatFits is definitely the recommended approach to getting a user interface that adapts to different devices and also different device orientations (e.g. landscape vs. portrait). As with many other aspects of Swift and SwiftUI, ViewThatFits takes a little time to get used to. The first view within ViewThatFits should be the largest view with progressively smaller views coming next. Use the in: parameter to specify whether the view should assess the size horizontally or vertically, as this example shows: ViewThatFits will choose the first child view that fits. While it can be used without the in: parameter, it usually doesn’t provide the required result unless it’s specified. ViewThatFits(in: .horizontal) { HStack { // Large View } HStack { // Medium View } HStack { // Small View } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Dec ’24
Reply to Share via Context Menu Button
It appears that the ShareLink can be added, alongside other buttons, within the .contextMenu as below. .contextMenu { Button(action: { debugPrint("Share") }) { Label("Share", systemImage: "square.and.arrow.up") } ShareLink(item: image, preview: SharePreview("image", image: image)) { Label("Share", systemImage: "square.and.arrow.up") } }
Topic: UI Frameworks SubTopic: SwiftUI
Dec ’24
Reply to storing AVAsset in SwiftData
I'm curious what experience others have had using .externalStorage to store videos, particularly quite large videos between 250mb to 500mb. Is there a substantial difference between using .externalStorage vs. using CKAsset directly. Are there other approaches when considering large AVAssets?
Topic: Media Technologies SubTopic: Audio Tags:
Jun ’25
Reply to MapKit with vision
The SwiftUI version of MapKit is supported on visionOS although it really should embrace 3D and let users explore maps horizontally that have contoured terrain and 3D roads, bridges and buildings etc.
Replies
Boosts
Views
Activity
Nov ’24
Reply to Wrong company name in TestFlight
This change needs to be made by Apple Developer Support. Give them a call and they can resolve this.
Replies
Boosts
Views
Activity
Nov ’24
Reply to Sync SwiftData via CloudKit on App Start
I think this maybe caused by the other two devices using the development container and the third device, which never had a development build, using the production container. All three are using an Apple ID from the internal testing group and so I would have thought all three should be on the same container.
Replies
Boosts
Views
Activity
Nov ’24
Reply to Sync SwiftData via CloudKit on App Start
I hadn't used CloudKit before and didn't realize the additional steps required to deploy the container into production. I should be able to resolve this issue now before the next TestFlight release.
Replies
Boosts
Views
Activity
Nov ’24
Reply to Sync SwiftData via CloudKit on App Start
If anyone else runs into this issue, I recommend looking at this article: Deploying an iCloud Container's Schema.
Replies
Boosts
Views
Activity
Nov ’24
Reply to Best Way to Support Different Devices in SwiftUI?
Using ViewThatFits is definitely the recommended approach to getting a user interface that adapts to different devices and also different device orientations (e.g. landscape vs. portrait). As with many other aspects of Swift and SwiftUI, ViewThatFits takes a little time to get used to. The first view within ViewThatFits should be the largest view with progressively smaller views coming next. Use the in: parameter to specify whether the view should assess the size horizontally or vertically, as this example shows: ViewThatFits will choose the first child view that fits. While it can be used without the in: parameter, it usually doesn’t provide the required result unless it’s specified. ViewThatFits(in: .horizontal) { HStack { // Large View } HStack { // Medium View } HStack { // Small View } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’24
Reply to Share via Context Menu Button
It appears that the ShareLink can be added, alongside other buttons, within the .contextMenu as below. .contextMenu { Button(action: { debugPrint("Share") }) { Label("Share", systemImage: "square.and.arrow.up") } ShareLink(item: image, preview: SharePreview("image", image: image)) { Label("Share", systemImage: "square.and.arrow.up") } }
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Dec ’24
Reply to storing AVAsset in SwiftData
I'm curious what experience others have had using .externalStorage to store videos, particularly quite large videos between 250mb to 500mb. Is there a substantial difference between using .externalStorage vs. using CKAsset directly. Are there other approaches when considering large AVAssets?
Topic: Media Technologies SubTopic: Audio Tags:
Replies
Boosts
Views
Activity
Jun ’25