Post

Replies

Boosts

Views

Activity

UICollectionViewCompositionalLayout incorrect item size on iOS 14
Hello, I'm currently facing an issue with compositional layout. (FB8812336) The item height is set to .estimated(100) and the width is set to .fractionalWidth(1.0). On the initial display the cell is not wrapping the label content. The layout of the cells are corrected after scrolling. The issue doesn't occurred on iOS 13 (screenshot) - https://www.icloud.com/iclouddrive/0I3N81VDpmlMOw7bbtogeVuJA#Screen_Shot_2020-10-19_at_16.16 and can also be seen in the Apple's sample code - https://developer.apple.com/documentation/uikit/views_and_controls/collection_views/implementing_modern_collection_views Do I miss a flag or a property introduced in iOS 14? Does someone know how to fix this issue? Thank you.
2
0
2.3k
Oct ’20
How to set foregroundColor/fontWeight for a ToolBarItem?
Hello, I presents a View inside a NavigationView. I use the .toolbar modifier to set a navigation bar items. One of them must be in red as it represents a destructive action. .toolbar(content: { ToolbarItem(placement: .navigationBarLeading) { Button { } label: { Text("Delete").foregroundColor(.red) } } } How can we set a foregroundColor/fontWeight for a Button in a ToolBarItem? I've tried to set a custom ButtonStyle, foregroundColor to the Text, foregroundColor to the Button.
4
0
859
Sep ’21
Single query to get weather for multiple dates
Hi, I try to fetch weather information for multiple dates through a single query but I only get information for the first day. let today = Date() let tomorrow = Calendar.current.date(byAdding: DateComponents(day: 1), to: today)! let forecast = try? await WeatherService.shared.weather(for: location, including: .daily(startDate: today, endDate: tomorrow)) Can we get weather information for a range of day?
0
0
1.3k
Jul ’22
LockedCameraCapture - Access to App Group User Defaults in a lock screen camera extension
From what I understood from watching the session LockedCameraCapture, the extension doesn't have access to the App Group User Defaults, so I'm wondering how I can synchronize preferences between the extension and the main app. From what I can see, the builtin iOS Camera app is able to synchronize its preferences. For example, the "Live Photo" mode toggle state is preserved whether in the main app or in the lock screen. Is there anything I'm not aware of?
2
0
672
Jun ’24
DisplayRepresentation.Image and custom SF Symbol
Hi, I have a AppEnum and I try to use a custom SF Symbol as DisplayRepresentation.Image but it's not working. I get a blank image when AppEnum picker appears. The custom SF Symbol is stored in the target's asset catalog and it works in the target (eg: Image(named: "custom_sfsymbol"). The issue occurs when I try to use it in a DisplayRepresentation static var caseDisplayRepresentations: [Self: DisplayRepresentation] = [ .sample : DisplayRepresentation(title: "sample_title", image: DisplayRepresentation.Image(named: "custom_sfsymbol")), Can we use a custom SF Symbol in a DisplayRepresentation.Image?
1
0
444
Jul ’24
Dependency between AssistantSchema.CameraEnum
Hi, I have some questions about the new AssistantSchema.CameraEnum.captureMode and AssistantSchema.CameraEnum.captureDevice introduced with iOS 18 beta 4. Here's the context. I create a intent: @AssistantIntent(schema: .camera.startCapture) struct StartCaptureIntent { var captureMode: CaptureMode var timerDuration: CaptureDuration? var device: CaptureDevice? func perform() async throws -> some IntentResult { .result() } } And these app enums: @AssistantEnum(schema: .camera.captureDevice) enum CaptureDevice: String { case front case back case ultrawide } @AssistantEnum(schema: .camera.captureMode) enum CaptureMode: String { case modeA case modeB } Some CaptureDevice cases are not available in some CaptureMode. e.g: CaptureMode.modeA only supports CaptureDevice.back and CaptureDevice.front. In a classic AppIntent, I would create an AppEntity to represent CaptureDevice and use @IntentParameterDependency<CapturePhotoIntent>( \.$captureMode) to create a dependency between the captureMode and the captureDevice parameters. How can we create this dependency between two @AssistantEnum? I'm not sure this is possible as @AssistantEnum creates AppEnum.
0
1
404
Jul ’24
Dynamic AssistantSchema.CameraEnum
Hi, I have some questions about the new AssistantSchema.CameraEnum.captureDevice introduced with iOS 18 beta 4. Here's the context. I create a intent: @AssistantIntent(schema: .camera.setDevice) struct SetDeviceIntent { var device: CaptureDevice func perform() async throws -> some IntentResult { .result() } } @AssistantEnum(schema: .camera.captureDevice) enum CaptureDevice: String { case front case back case ultrawide } Some CaptureDevice cases are not available on some devices. e.g: CaptureMode.ultrawide is only available on iPhone, not on iPad. How can we make CaptureDevice dynamic? I don't think AppEnum supports @Dependency or something else.
0
2
441
Jul ’24
Live Activity for Workout app on Apple Watch
Hi, We’ve developed a workout app with a Live Activity feature to help users launch the mirroring view on iPhone, similar to the built-in workout app for biking activities. While Live Activities are now available on watchOS 11, the integration feels a bit off for our Workout app. Is there a way to disable or exclude our Live Activity from appearing on watchOS? Currently, when a user starts a workout, the Live Activity appears at the bottom of the screen, requiring users to tap the screen before they can use our app. The built-in Workout app doesn’t have this issue. Additionally, our Live Activity appears in the Smart Stack, duplicating content with the built-in Workout Live Activity. We’re unsure if we missed any keys or settings to exclude Live Activity from watchOS.
6
1
714
Aug ’24