Today-Widget "Unable to load" error
Unable to load in today extension mostly appears when:
- You extension crash due to some reason
- It takes more memory than what is provided by the system. (Memory Limit : max 16MB approx.)
Debug your app extension to find out the exact problem.
Refer to Xcode's Debug Gauge for Memory and CPU utilization.
Edit:
Debugging today extension
You can debug your extension the same way you debug your main project. Just select that particular target scheme
in your Xcode and run the project.
Now try using the breakpoints and other print statements in the extension’s code and you are good to go. Happy coding..ð
I have faced the same issue where it wasn't showing anything. Even my debug option was not working. I found an article online which helped me a lot. I would like to recommend this here.
Most of the time it is the size of the content view that crashes the widget. in that case, use this code snippet in TodayViewController.
Code snippet
override func viewWillAppear(_ animated: Bool)
{
var currentSize: CGSize = self.preferredContentSize
currentSize.height = 200.0
self.preferredContentSize = currentSize
}
Link for further research.
REBOOT the device.
This saved me.
I have faced this error I used a custom view. But forgot to check Is initial viewController. Set an entry point form "show attribute inspector" as an initial view controller