Saturday, July 13, 2024
HomeiOS Developmentios - Utilizing customized UIApplication subclass in SwiftUI

ios – Utilizing customized UIApplication subclass in SwiftUI


We now have an present app which is predominantly Goal-C with a minor quantity of conventional UIKit primarily based Swift. A lot of the code is organized in a bunch of inside frameworks overlaying the assorted functionalities or base modules. The app was inherited from one other workforce by way of an acquisition some time again.

We’re planning a brand new model of the app and want to “modernize” it and base it on SwiftUI and Mix (enterprise logic bits). In the end a lot of the UX/UI bits could be refactored/re-written in new SwiftUI / Swift (logic non UI) code.

However we have to protect the prevailing performance as we work on re-writing the assorted bits, so we wished to create a brand new SwiftUI primarily based app after which name the assorted present UIKit primarily based view controllers, and many others. We now have mechanisms in place to do that. However the app was organized with a customized UIApplication class and in depth App Delegate that the prevailing Goal-C code replies on for state, or functionalities, or initializes, or a number of different particular capabilities. A number of the prevailing UIViewControllers and enterprise logic modules depend on this underlying “framework” of code so we won’t simply use present SwiftUI strategies of interacting with UIKit with out with the ability to (briefly) drag this method alongside for the experience.

I have been attempting to see how we are able to get SwiftUI to work with this tradition UIApplication subclass within the interim till we have been in a position to refactor stuff (as we go, little by little) to not depend on this present code group. Up to now I’ve struck out. I have been in a position to work with a brand new AppDelegate, in order that half is solved, and I used to be in a position to substitute my UIApplication subclass in the primary() however then it would not soar into the SwiftUI code so the SwiftUI app content material by no means begins working.

Is there a option to get SwiftUI to make use of my customized UIApplication subclass (on an interim foundation) whereas we slowly refactor and rewrite the assorted UI to work by way of our new SwiftUI and Mix mannequin have been adapting?

(Once more that is simply an interim resolution we’re looking for whereas we get the assorted bits up and working of the alternative trendy code changing the traditional app code we have now in Goal-C (a few of which works again to early iOS after the App Retailer first got here out). The app is non-trivial so we’d like to have the ability to maintain utilizing present code till that bit comes up for rewriting).



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments