0

I create a custom keyboard extension of main app. In the extension, i want to know if the main app is running?

Is there any way to make it work?

I have created the app group, and i share data with the UserDefaults

var share: UserDefaults? = UserDefaults(suiteName: "group.share.keyboard")
 

But i do not know how to realize if the main app is running, please help me, thank you very much! I have search many ways, but not work

badboy_tqj
  • 300
  • 2
  • 14
  • Try save a Bool vale in the User Defaults Group in App Delegate didFinishLaunchingWithOptions – Ridney Mar 19 '21 at 15:26
  • @Ridney when set the bool to false ? – badboy_tqj Mar 20 '21 at 01:24
  • this is the right place for set the bool at false ---> func applicationWillTerminate(_ application: UIApplication) // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. – Ridney Apr 01 '21 at 08:35

0 Answers0