Skip to content

dawmster/swiftuiwidgetswithobjc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

swiftuiwidgetswithobjc

This is a trivial example showing an Objective-C app, and example data model, with a SwiftUI widget designed for iOS 14.

Notes

  • Your Objective-C class prefix is not respected by Xcode when you add a Widget Extension target, so be prepared to manually add it to any instances of 'ConfigurationIntent' in the template
  • Once you add any Objective-C code into a Widget Extension, its Intent will automatically generate code in ObjC and not Swift and no longer compile by default, which means you must manually add an Objective-C Bridging Header and manually import the Configuration Intent's header file — which will not physically be in your project, and is based on a filename convention generated from the items in your intentdefinition file. See Swift-Bridging-Header.h

Screenshot

https://hccdata.s3.us-east-1.amazonaws.com/gh_objc_widget.jpg "Screenshot of ObjC-backed widget running in Xcode Preview Pane"

About

iOS 14 Widget Extension with Objective-C data model

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Objective-C 70.9%
  • Swift 29.1%