Post

Replies

Boosts

Views

Created

How to truncate text from head with multi line?
I want to truncate text from head with max 2 lines. I try the following code import SwiftUI struct ContentView: View { @State var content: String = "Hello world! wef wefwwfe wfewe weweffwefwwfwe wfwe" var body: some View { VStack { Text(content) .lineLimit(nil) .truncationMode(.head) .frame(height: 50) Button { content += content } label: { Text("Double") } .buttonStyle(.borderedProminent) } .frame(width: 200, height: 1000) .padding() } } #Preview { ContentView() } It show result like this, this is not what I want.
0
0
249
Mar ’25
where is macOS APIs including user space file system support?
Hi there, From "Platforms State of the Union" Video macOS section I know macOS has new API of user space file system and iPhone mirroring, and delivers new APIs including user space file system support and major improvements to MapKit. But I lookup the API diff, I don't find any added API. Where can I find the user space file system API ? I really want to develop an APP which need user space file system API. Platforms State of the Union Video corresponding timeline detail: https://youtu.be/YJZ5YcMsgD4?t=3153
7
1
1.2k
Jun ’24
How to request "System Audio Recording Only" permission?
I notice from macOS Sonoma System Settings, we have "Screen & System audio Recording". I'm an macOS app developer and want to request only Audio permission, I browse the document for a while and WWDC code demo, but still have no idea of how to request "System Audio Recording Only" permission? All the demo and doc I can find is request "Screen Recording & System Audio"
1
1
858
Jan ’24
NSTextView retain text
When I set Window backgroundColor = .clear, disable NSTextView draw background, then I change NSTextView.string as you can see in the picture, preview text retain in the background. POC code is here SingleView How can I clear the background text (Foo1245 in the image background) when change NSTextView.string ?
Topic: UI Frameworks SubTopic: AppKit Tags:
2
0
843
Sep ’21
How to truncate text from head with multi line?
I want to truncate text from head with max 2 lines. I try the following code import SwiftUI struct ContentView: View { @State var content: String = "Hello world! wef wefwwfe wfewe weweffwefwwfwe wfwe" var body: some View { VStack { Text(content) .lineLimit(nil) .truncationMode(.head) .frame(height: 50) Button { content += content } label: { Text("Double") } .buttonStyle(.borderedProminent) } .frame(width: 200, height: 1000) .padding() } } #Preview { ContentView() } It show result like this, this is not what I want.
Replies
0
Boosts
0
Views
249
Activity
Mar ’25
where is macOS APIs including user space file system support?
Hi there, From "Platforms State of the Union" Video macOS section I know macOS has new API of user space file system and iPhone mirroring, and delivers new APIs including user space file system support and major improvements to MapKit. But I lookup the API diff, I don't find any added API. Where can I find the user space file system API ? I really want to develop an APP which need user space file system API. Platforms State of the Union Video corresponding timeline detail: https://youtu.be/YJZ5YcMsgD4?t=3153
Replies
7
Boosts
1
Views
1.2k
Activity
Jun ’24
Is there any API to check if app is authorized?
I'm developing an app which use "System Audio Recording Only" API to capture system audio. Is there any API to check if app is authorized? So I can instruct user to give my app with this permission. Thanks.
Replies
2
Boosts
0
Views
763
Activity
Jun ’24
How to request "System Audio Recording Only" permission?
I notice from macOS Sonoma System Settings, we have "Screen & System audio Recording". I'm an macOS app developer and want to request only Audio permission, I browse the document for a while and WWDC code demo, but still have no idea of how to request "System Audio Recording Only" permission? All the demo and doc I can find is request "Screen Recording & System Audio"
Replies
1
Boosts
1
Views
858
Activity
Jan ’24
NSTextView retain text
When I set Window backgroundColor = .clear, disable NSTextView draw background, then I change NSTextView.string as you can see in the picture, preview text retain in the background. POC code is here SingleView How can I clear the background text (Foo1245 in the image background) when change NSTextView.string ?
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
2
Boosts
0
Views
843
Activity
Sep ’21