iOS Swift Today Extension: import class from container app?
Asked Answered
S

1

20

I have an app with a Today widget. I would like to use a model class from the container app in the TodayViewController.swift.

Is such a thing possible?

I copied the file into the Today Extension folder and tried to import it. No dice.

I can't find an answer in the documentation or online.

Thanks

Sibley answered 3/2, 2015 at 14:44 Comment(0)
S
35

You need to include the file in the target membership. Select the file and then, in the right hand pane, tick the correct target.

enter image description here

Shipowner answered 3/2, 2015 at 14:51 Comment(1)
No worries, just make sure you continue to add all assets that you retire to both targets. Some APIs aren't available to a Today extension so test regularly.Shipowner

© 2022 - 2024 — McMap. All rights reserved.