On the subject of MacApp, is there a way to change it with the SwiftUI App on Xcode12?
I know how to change it with AppKit App Delegate.
Related
using swiftUI i have a lot of Buttons which i need to make only one can be clicked at the same time.
By default in swiftUI you have two or more buttons on a view you can click them all at once
I tried adding the following:
UIButton.appearance().isMultipleTouchEnabled = false
UIButton.appearance().isExclusiveTouch = true
With UIKit we had exclusiveTouch and MultiTouchEnabled but how do we do this with swiftUI?
What is the correct way to solve this application wide?
Update: The use case is simple there is a view with a login button and a register button and now the user can tap both at the same time which i don't want
I have a SwiftUI view which was originally only used for an iOS widget. I would like to re-use this view now for a watchOS app.
#Environment(.widgetFamily) var widgetFamily
The widgetFamily surprisingly was set to ".accessoryCircular". Is this some kind of strange default? This happens within the context of the main watchOS app - no widgets and no complications involved at this stage.
I would like to distinguish between the "accessoryCircular" iOS widget and the main watchOS app. How can I achieve this?
I have a project in which I have run into a limitation of SwiftUI on the Apple Watch. My proposed solution was to instantiate a WKInterfaceController to perform the needed functionality, and then return to using SwiftUI views. Is this possible? I tried to wrap my controller in a WKInterfaceObjectRepresentable object, but there doesn't seem to way to instantiate the interface controller from a Storyboard, as is possible on iOS according to this similar case:
How to add Storyboard ViewController into SwiftUI Project?
But Xcode tells me, "Cannot find UIStoryboard in scope"
Is there a way to create an InterfaceController from SwiftUI? Or perhaps I need to use a WKHostingController for my whole Watch project, so as to have access to the option of using InterfaceController objects?
Thanks.
You can navigate to an existing interface controller defined in a watchOS storyboard from SwiftUI by using NavigationLink with the destinationName:label: arguments, see here.
destinationName is the identifier used in the storyboard for that interface controller, eg:
NavigationLink(destinationName: "MyInterfaceControllerIdentifier") {
Text("Go")
}
I am trying to add an AppDelegate to a standalone watchOS SwiftUI app (no companion iOS app) as indicated in here, but I can't seem to resolve the issue Cannot find type 'UIApplicationDelegate' in scope
Explicitly adding an import UIKit does not help.
Any clues?
https://developer.apple.com/documentation/uikit/uiapplicationdelegate
UIApplicationDelegate seems to only work with Catalyst, iOS and TvOS. Per WatchKit documentation it using the WKExtensionDelegate that has all the same methods.
https://developer.apple.com/documentation/watchkit/working_with_the_watchos_app_life_cycle
https://developer.apple.com/documentation/watchkit/wkextensiondelegate
I have requirement to open HTML content on iOS application. Currently I am using Qt for iOS which does not have support for QtWebKitsWidgets. So now I am planning to open UIWebView using UIViewController of iOS from Qt application. I have tried to open UIViewController from dummy UIViewController using presentViewController method but it is not opening anything on QMainWindow.
Let me know whether such thing is possible or not. If possible then guide me through some suggestions. Let me know if more detail is required. I am modifying example given by Qt for iOS only. Note that I am using Qt5.2.0 for iOS.
The Qt documentation points to this example of how to integrate a native iOS controller with a QML application.
https://github.com/richardmg/qtdd13_qmlapp
It implements bringing up UIImagePickerController over a QML display.
So, while you can't integrate a UIWebView with QML content, you can push a new controller on containing it or maybe even can super-impose a UIWebView on top of the QML view.
It’s possible (with the Qt4iOS iOS plugin) to use UIWebView from QWidget based apps, but not QML apps. The Digia iOS plugin does not support using UIWebView in any way (and won’t any time soon).