I have an NSMutableAttributedString that contains an NSMutableParagraphStyle, which sets the paragraphSpacing. When I preview this in UIKit, everything displays correctly (paragraph spacing is applied). However, when I wrap this into an AttributedString, use it in a Text view (SwiftUI), the paragraphSpacing is ignored. I looked into the documentation and noticed that AttributedString in SwiftUI does not yet support paragraphSpacing. For now, the only workaround I see is to keep this part in UIKit. Has anyone found a way to make this work in SwiftUI?
Search results for
swiftui
16,580 results found
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
How do I set the tooltip for an AppKit SwiftUI view?
What is the best practice to achieve popToRootViewController like functionality in SwiftUI? There are couple of ways to do it and one of them is described nicely here (https://stackoverflow.com/questions/57334455/swiftui-how-to-pop-to-root-view) via publish event but it losses the animation while popping to root. Please suggest.
What is the SwiftUI equivalent of TVLockupView, TVCaptionButtonView, and TVPosterView?
I'm trying to use Bluetooth in a SwiftUI on Playgrounds. I have a running sample using UIKit, but with SwiftUI, I ran into an interesting problem. I startet with the empty App-Sample and defined the ContentView like this: import SwiftUI struct ContentView: View { var body: some View { VStack { Text(Hello, world!) Button { print(hello) } label: { Text(press me) }.buttonStyle(.bordered) } } } The MyApp-code looks like this import SwiftUI import PlaygroundSupport import PlaygroundBluetooth @main struct MyApp: App { //private var centralManager: PlaygroundBluetoothCentralManager? var body: some Scene { WindowGroup { ContentView() } } } With this implementation, I can click on the Button and it prints the message. But if I uncomment the private var centralManager, the App does not run anymore. Any ideas? Thanks in advance Rainer
Hi, just some general questions on SwiftUI:1 . What is exactly swiftUi?2. How is swiftUI different from storyboards and from AppKit, UiKit etc…?3. Does SwiftUI allow you to drag and drop Objects like story boards?3. How does it relate/corrolate with storyboards?Also, how easy does it seems to migrate a current existing app to swiftui?Thanks.
Is there an equivalent of “touchUpInside” in SwiftUI?In UIKit, it was very easy to look for a touchUpInside event.With SwiftUI, we can attach a “tapAction”, but this will require re-training users to always be “quick and decisive” in their actions.Any hope for a more deliberative, slow-fingered user?
With SwiftUI's onOpenURL(perform:) view modifier (https://developer.apple.com/documentation/swiftui/outlinesubgroupchildren/onopenurl(perform:)), is there any mechanism for accessing the options dictionary? In UIKit, the UIApplicationDelegate it would be passed as a parameter to application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]).
HI,My project bypasses storyboards, I like to keep everything in code that I write myself. Can SwiftUI be used this way? Also, how powerful is SwiftUI? Is it just for writing simple user interfaces or can it be used to write highly customized ones that rival a programatic approach?ThanksBrian Duffy
can we use the new SwiftUI with ARKit and RealityKit and composer?thanks,Dale
Does SwiftUI now have a NavigationButton? And if not, what is it replaced by?
Hello, everybody I have a little problem I've finished learning swift and I've already know some SwiftUI, but I'm not really confident, also I had a break in my learning path. So I'm thinking about starting to learn SwiftUI one more time from zero, but I'm not sure where it can be better to do. My minimal iOS version - 17. I was thinking about apple tutorials https://developer.apple.com/tutorials/swiftui https://developer.apple.com/tutorials/develop-in-swift But is there any special order (of apple tutorials) or even other better tutorials? What can you recommend from your side? Thank you in advance
how do i connect the local json in SwiftUI?
Is there a way to use NSPathControl or something equivalent in SwiftUI on Mac?
I am trying to use PKToolPicker (from PencilKit) without a PKCanvasView by adopting PKToolPickerObserver in my own class. I am wondering how to deal with the FirstResponder required by PKToolPicker visibility set from a SwiftUI App when the view containing the PKToolPicker is a UIViewRepresentable embedded in a SwiftUI View that has control of gestures. Thanks in advance, Arshia