Search results for

swiftui

16,580 results found

Post

Replies

Boosts

Views

Activity

ParagraphSpacing in swiftui
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?
1
0
480
Oct ’24
popToRootViewController in SwiftUI
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.
10
0
6.8k
Sep ’19
PlaygroundBluetooth with SwiftUI
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
4
0
1.3k
Jan ’23
SwiftUi basic questions
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.
4
0
3.8k
Jun ’19
SwiftUI touchUpInside ?
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?
1
0
3.8k
Jul ’19
SwiftUI OpenURLOptions
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] = [:]).
0
0
541
Aug ’21
SwiftUI Programatically?
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
2
0
1.6k
Jun ’19
Learning SwiftUI
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
2
0
580
Oct ’24
PKToolPicker in SwiftUI
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
0
0
875
Jul ’20