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.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
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
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.
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"
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 ?