Post

Replies

Boosts

Views

Activity

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
228
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.1k
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
793
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
807
Sep ’21