Post

Replies

Boosts

Views

Activity

Reply to Enum with a description
Just try enum DayOfTheWeek: String, CaseIterable, Identifiable{ var id: String {self.rawValue} case monday = "Monday" case tuesday = "Tuesday" var description: String { switch self { case .monday: return "it's a great day to have a coffee" case .tuesday: return "..." } } } // it's a great day to have a coffee let mondayDescription: String = DayOfTheWeek.monday.description
Topic: Programming Languages SubTopic: Swift Tags:
Dec ’22
Reply to `AVPlayerView` becomes not interactive in trimming mode.
I finally figure out the problem. It seems that applying .clipShape(...) on RecorderPlayerView will cause the problem. Just remove the line .clipShape(RoundedRectangle(cornerRadius: 8)) will solve this problem. RecorderPlayerView(playerView: playerViewModel.playerView) // .clipShape(RoundedRectangle(cornerRadius: 8)) <-- remove this line .onAppear { ... } Maybe there are some bugs in .clipShape and AVPlayerView in trimming mode.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’22
Reply to Can not register LaunchAgents on macOS 14.2.1
It seems that I should make my Agent also be sandboxed. Is it true the launch agent of a sandboxed app also should be sandboxed? And so as daemon?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’23
Reply to 'ID' is inaccessible due to '@_spi' protection level
Just declare your model as Identifiable will solve the problem.
Replies
Boosts
Views
Activity
Oct ’23
Reply to Enum with a description
Just try enum DayOfTheWeek: String, CaseIterable, Identifiable{ var id: String {self.rawValue} case monday = "Monday" case tuesday = "Tuesday" var description: String { switch self { case .monday: return "it's a great day to have a coffee" case .tuesday: return "..." } } } // it's a great day to have a coffee let mondayDescription: String = DayOfTheWeek.monday.description
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Dec ’22
Reply to `AVPlayerView` becomes not interactive in trimming mode.
I finally figure out the problem. It seems that applying .clipShape(...) on RecorderPlayerView will cause the problem. Just remove the line .clipShape(RoundedRectangle(cornerRadius: 8)) will solve this problem. RecorderPlayerView(playerView: playerViewModel.playerView) // .clipShape(RoundedRectangle(cornerRadius: 8)) <-- remove this line .onAppear { ... } Maybe there are some bugs in .clipShape and AVPlayerView in trimming mode.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’22
Reply to `AVPlayerView` becomes not interactive in trimming mode.
In fact, it can not triggered on all Mac.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’22