iOS 8 Beta Today extension widget not showing in a Swift app?
You can comment out the supplied init method.
// init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) {
// super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
// // Custom initialization
// }
This will allow your extension to run properly. The issue seems to be caused by differing initializer behavior between Swift and Objective-C. Removing the above initializer will inherit all of the required initializers from the superclass.
Found that solution on the apple developer forums for your reference.
Note: You may have to Clean and Build
your project after doing this before the changes will have any effect
The extension is actually crashing, with an error like:
fatal error: use of unimplemented initializer 'init(coder:)' for class 'com_blabla_blabla_MyTodayExtension.TodayViewController'
This indicates that another option would be to implement:
init(coder aDecoder: NSCoder!) {
super.init(coder: aDecoder)
// Custom initialization here
}
if you want to retain the ability to do custom initialization.
iOS 8 beta - Today extension doesn't recognize embedded framework
Actually you are adding the framework in Target Dependencies. That's wrong. Target Dependencies is the place where we should specify some other targets which should get compile in order to run our main target.
Add your framework in to Link Binary With Libraries , if necessary set framework search path in build settings
Today Extension not working
To debug the extension, you need to manually attach the widget to the debugger.
From the Xcode menu "Debug" -> "Attach to process" -> "your extension bundle id"
Today Widget has no content on iOS 8 device
After a couple of days of searching I finally found the solution:
My project (the containing app of the widget) and the widget itself did not include the arm64 architecture. As the Apple docs describe this is not a valid configuration:
A containing app that links to an embedded framework must include the
arm64 (iOS) or x86_64 (OS X) architecture build setting or it will be
rejected by the App Store. (As described in Creating an App Extension,
all app extensions must include the appropriate 64-bit architecture
build setting.)
When x64 is missing the app will not only be rejected but also prevents the widget from showing up in the first place.
I added the widget to an existing projects which was not configured for x64 yet and it seems that the same build settings have been applied to the widget automatically. It would have avoided a lot of work if Xcode would have shown any warning or hint about this problem...
I did the following to solve the problem:
- Click on the project entry in the Project Navigator and select the apps target.
- Choose the
Build Settings
Tab and navigate to theArchitectures
section. - Set
Architectures
toStandard architectures (armv7, arm64)
- Set
Valid Architectures
toarmv7 armv7s armv8 arm64
- Set
Build Active Architectures Only
toNo
- Apply the same settings to the Widget Target
After this the widget works correctly both in the simulator and on my test devices.
Related Topics
Avaudioengine Crashes When Plug Headphones in or Out
Swift - Firebase Search in Database
How to Avoid Nested Navigation Bars in Swiftui
Could Not Find an Overload for '/' That Accepts the Supplied Arguments
Swift Error: Missing Return in a Function Expected to Return 'String'
How to Include Assets/Resources in a Swift Package Manager Library
How to Hide Labels in iOS-Charts
How to Open Settings App Programmatically
How to Make Keyboard Dismiss When I Press Out of Searchbar on Swift
Convert String to Bool in Swift - via API or Most Swift-Like Approach
How to Make a Swift Enum with Uicolor Value
Initializer for Conditional Binding Must Have Optional Type, Not 'String'
How to Create Nsradiobutton Group in Xcode 7 Osx
Showing Cells in Demands in Uicollectionview with Vertical Infinite Scroll