Xcode 12.0 (12A7208) MacOS 10.15.6 (19G2021)
- Create an new SwiftUI project.
- Add Capability App Groups.
- Create an new Target Widget Extension, add Capability App Groups.
- In Main App use
UserDefaults(suiteName:).setto save an Int data. - In Widget, Under
getTimeline(for:in:completion:)function just callUserDefaults(suiteName:).value,cannot get the Int Data. But in Main App can.
suiteName is started with group., and it is same in Widget and Main App.
quite confused...