I am using the new pure SwiftUI App and Scene structs instead of an AppDelegate. Some of my views accept custom url schemes and user activities using onOpenURL(perform:). Everything works as expected. However, starting with Beta 6, Xcodes gives the following runtime warning: runtime: SwiftUI: Cannot use Scene methods for URL, NSUserActivity, and other External Events without using SwiftUI Lifecycle. Without SwiftUI Lifecycle, advertising and handling External Events wastes resources, and will have unpredictable results. What exactly am I doing wrong? What is *SwiftUI Lifecycle* referring to?
Search results for
swiftui
16,580 results found
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
What statements have been added to SwiftUI in visionOS development compared with the original SwiftUI?
Can I use Google MobileAds with SwiftUI? When I search on the web, I see that I need UIkit, but can I use SwiftUI only?
I want to complete the request method similar to Attrackingmanager in swiftui. Can I complete the Attrackingmanager request in swiftui without using OC bridging?
Hello, I have a standalone WatchOS project using SwiftUI for the interface. During the App's init (), I trigger a Swift function call, that does some background activity in a worker thread. By default, the SwiftUI View shows a single label with Hello World. The result of the worker thread will require an arbitary View to be shown, for eg., I want to show a View with four Labels now. In my use case, the layout for the View, can only be calculated at runtime. Is there a way to arbitrarily manipulate a SwiftUI based View from Swift code at runtime? Thanks!
I've got a MacOS app I'm converting to use SwiftUI. The UI uses NSOutlineView. Is there a SwiftUI equivalent for this?
I have had a suspicious crash in my app for a long time. I'm 95% using SwiftUI and have to use only one UIKit view that I embed into SwiftUI in my app. I don't understand why my app crashes when the CALayer position is set to Nan because I don't reference layers at all, including that UIKit view. Any ideas why it may happen and how can I reproduce it? Fatal Exception: CALayerInvalidGeometry CALayer position contains NaN: [nan nan]. Layer: <CAShapeLayer:0x303cd9600; position = CGPoint (0 0); bounds = CGRect (0 0; 0 0); delegate = _NoAnimationDelegate; allowsGroupOpacity = YES; anchorPoint = CGPoint (0 0); > Fatal Exception: CALayerInvalidGeometry 0 CoreFoundation 0x83f20 __exceptionPreprocess 1 libobjc.A.dylib 0x16018 objc_exception_throw 2 CoreFoundation 0x1826dc -[NSException initWithCoder:] 3 QuartzCore 0x7b28 CA::Layer::set_position(CA::Vec2<double> const&, bool) 4 QuartzCore 0x7a58 -[CALayer setPosition:] 5 SwiftUI 0x1a131d4 objectdestroy.10Tm 6 SwiftUI
Hello and thanks for reading my post. I have been trying hard to generate a PDF from a SwiftUI view on a button press. Looked at the PDFKit documentation, understood that PDFView, PDFDocument and PDFPage are important classes. However, I couldn't find any examples of how to use them in SwiftUI or Swift. Basically, given a SwiftUI view (or a Swift struct), how to create a new SwiftUI view that displays the generated PDF? The pdf can contain charts, layouts, etc.
When my SwiftUI based watch app responds to an WKSnapshotRefreshBackgroundTask, how do I change the navigation stack? Before using SwiftUI we'd just do this: if let root = WKExtension().shared.rootInterfaceController { ttroot.pushController(withName: Controller1, context: nil) ttroot.pushController(withName: Controller2, context: nil) } And now I'd have the screen I wanted. Not sure how to accomplish that same thing with SwiftUI
Hi all!Is there any sort of tutorials or documentation related to the tvOS specific things for SwiftUI?E.g. how to get more control over tvOS Focus engine?Also, is there canBecomeFocused-property analog for SwiftUI View and how to enable focusing for SwiftUI Image? Currently, I'm unable even make working parallax effect for my layered images.The only Focus-related thing that I see are:func onHover(perform: (Bool) -> Void) -> Viewfunc focusable(Bool, onFocusChange: (Bool) -> Void) -> ViewIs there something that I missed or SwiftUI currently not useful for tvOS production applications?
Is SwiftUI currently versioned like Swift the language or is treated more like UIKit where the version is attached to the OS release? So for example will the changes to SwiftUI found in Xcode 12, work on iOS 13? If not that means any new SwiftUI features/bug fixes will need to wait to be deployed until iOS 14 is released AND there is enough iOS adoption by the user base. Thanks.
How to add a custom button to the Edit Menu on both iOS and iPadOS natively using SwiftUI. I have seen many ways to implement custom button using UIKit but wondering how to use SwiftUI to achieve the same thing. I have never seen any modifiers or Menus about this. I guest there is no way to do that. Any idea about this? or is it a future update for SwiftUI ??
Whats new for Gamecenter with SwiftUI?
What is the SwiftUI equivalent to returnKeyType? How do we implement it?
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?