0

I'm building an app in Swift 4 and now I am adding a today extension to the app. I want to access a class from the main app, a repository class, in the today extension view controller.

What do I need to do to be able to create an instance of my repository class in the today extension view controller?

The repository class is public, has a public init and has public methods.

The only solution I have found is to put the repository in a separate framework, but that seems like a big step for my small app.

Sebbo
  • 326
  • 4
  • 10

1 Answers1

13

Put the class inside a swift file , click it and check the today extension target

enter image description here

//

enter image description here

Shehata Gamal
  • 98,760
  • 8
  • 65
  • 87