Post

Replies

Boosts

Views

Activity

Reply to safeAreaBar and the Fold
I did try this: ArrangementView { // View 1 .safeAreaBar(edge: .bottom) { Button("Continue") { // } } } secondary: { // View 2 } Or this(which somewhat works) ArrangementView { // View 1 } secondary: { // View 2 .safeAreaBar(edge: .bottom) { Button("Continue") { // } } } But ideally there is a way to set something like .followPrimaryVIew() or whatever, just wondering how you would do it 😊
Topic: SwiftUI SubTopic:
iPhone Duo SwiftUI Q&A
Sep ’26
Reply to Get now playing track Apple Music API
The closest thing to this is by observing the SystemMusicPlayer.shared this class gives you queue and state instance properties . With the currentEntry.item of the queue you can get a Song or MusicVideo ID so you can use that to fetch the right content More about SystemPlayer: https://developer.apple.com/documentation/musickit/systemmusicplayer EDIT: Just noticed this was about the Apple Music API and not MusicKit
Topic: Media Technologies SubTopic: General Tags:
Dec ’22
Reply to List of Genre IDs?
Fair enough! I ran it with let request = MusicCatalogResourceRequest<Genre>(matching: \.id, equalTo: MusicItemID(genreID)) and found some but feels like a lot are missing (compared to the ones I get from Song.genreNames)
Topic: Media Technologies SubTopic: General Tags:
Nov ’22
Reply to Getting WeatherKit error WeatherDaemon.WDSJWTAuthenticatorService.Errors
Not sure if you're having any other targets that use the WeatherKit data, but did you make sure you've enabled WeatherKit in Capabilities in your project and the App Services tap in the developer portal for all targets? Because I was fighting this issue for a while and then realized I didn't enable it for my widget Bundle ID in the developer portal, haha
Topic: App & System Services SubTopic: General Tags:
Aug ’22
Reply to SwiftUI with RoomPlan ?
You can use a UIViewRepresentable together with a singleton, not sure if this is the best way to do so but it works for me :) here's a quick example: Model (here you setup your RoomCaptureView) final class Model : ObservableObject, RoomCaptureViewDelegate { static var shared = Model() @Published var roomCaptureView : RoomCaptureView var captureSessionConfig : RoomCaptureSession.Configuration init() { roomCaptureView = RoomCaptureView(frame: .zero) captureSessionConfig = RoomCaptureSession.Configuration() } func startSession() { roomCaptureView.captureSession.run(configuration: captureSessionConfig) } func stopSession() { roomCaptureView.captureSession.stop() } func captureView(shouldPresent roomDataForProcessing: CapturedRoomData, error: Error?) -> Bool { return true } // Here you will get the final post-processed results. func captureView(didPresent processedResult: CapturedRoom, error: Error?) { if let error = error { print("Error: \(error)") } } } UIViewRepresentable struct RoomCaptureRep: UIViewRepresentable { func makeUIView(context: Context) -> RoomCaptureView { return Model.shared.roomCaptureView } func updateUIView(_ uiView: RoomCaptureView, context: Context) { } } Usage struct CoolRoomPlanView : View { @StateObject var model = Model.shared var body : some View { ZStack { RoomCaptureRep() Button { model.startSession() } label: { Text( "Start") } } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’22
Reply to safeAreaBar and the Fold
Or even better: .safeAreaBottom would simply put in the safeArea of the primary view by default when partly folded
Topic: SwiftUI SubTopic:
iPhone Duo SwiftUI Q&A
Replies
Boosts
Views
Activity
Sep ’26
Reply to safeAreaBar and the Fold
I did try this: ArrangementView { // View 1 .safeAreaBar(edge: .bottom) { Button("Continue") { // } } } secondary: { // View 2 } Or this(which somewhat works) ArrangementView { // View 1 } secondary: { // View 2 .safeAreaBar(edge: .bottom) { Button("Continue") { // } } } But ideally there is a way to set something like .followPrimaryVIew() or whatever, just wondering how you would do it 😊
Topic: SwiftUI SubTopic:
iPhone Duo SwiftUI Q&A
Replies
Boosts
Views
Activity
Sep ’26
Reply to Get now playing track Apple Music API
The closest thing to this is by observing the SystemMusicPlayer.shared this class gives you queue and state instance properties . With the currentEntry.item of the queue you can get a Song or MusicVideo ID so you can use that to fetch the right content More about SystemPlayer: https://developer.apple.com/documentation/musickit/systemmusicplayer EDIT: Just noticed this was about the Apple Music API and not MusicKit
Topic: Media Technologies SubTopic: General Tags:
Replies
Boosts
Views
Activity
Dec ’22
Reply to List of Genre IDs?
Fair enough! I ran it with let request = MusicCatalogResourceRequest<Genre>(matching: \.id, equalTo: MusicItemID(genreID)) and found some but feels like a lot are missing (compared to the ones I get from Song.genreNames)
Topic: Media Technologies SubTopic: General Tags:
Replies
Boosts
Views
Activity
Nov ’22
Reply to Getting WeatherKit error WeatherDaemon.WDSJWTAuthenticatorService.Errors
Not sure if you're having any other targets that use the WeatherKit data, but did you make sure you've enabled WeatherKit in Capabilities in your project and the App Services tap in the developer portal for all targets? Because I was fighting this issue for a while and then realized I didn't enable it for my widget Bundle ID in the developer portal, haha
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Aug ’22
Reply to SwiftUI with RoomPlan ?
You can use a UIViewRepresentable together with a singleton, not sure if this is the best way to do so but it works for me :) here's a quick example: Model (here you setup your RoomCaptureView) final class Model : ObservableObject, RoomCaptureViewDelegate { static var shared = Model() @Published var roomCaptureView : RoomCaptureView var captureSessionConfig : RoomCaptureSession.Configuration init() { roomCaptureView = RoomCaptureView(frame: .zero) captureSessionConfig = RoomCaptureSession.Configuration() } func startSession() { roomCaptureView.captureSession.run(configuration: captureSessionConfig) } func stopSession() { roomCaptureView.captureSession.stop() } func captureView(shouldPresent roomDataForProcessing: CapturedRoomData, error: Error?) -> Bool { return true } // Here you will get the final post-processed results. func captureView(didPresent processedResult: CapturedRoom, error: Error?) { if let error = error { print("Error: \(error)") } } } UIViewRepresentable struct RoomCaptureRep: UIViewRepresentable { func makeUIView(context: Context) -> RoomCaptureView { return Model.shared.roomCaptureView } func updateUIView(_ uiView: RoomCaptureView, context: Context) { } } Usage struct CoolRoomPlanView : View { @StateObject var model = Model.shared var body : some View { ZStack { RoomCaptureRep() Button { model.startSession() } label: { Text( "Start") } } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’22