Does anyone know of a good way to write an iOS 8 share extension without the MainInterface.storyboard
that comes with the template?
When I delete the file or remove the NSExtensionMainStoryboard
from Info.plist
, the extension stops working (nothing happens when you tap on the button in the share pane). We tried replacing NSExtensionMainStoryboard
with NSExtensionPrincipalClass
which also didn't work.
Any ideas?
Add a Share Extension to your projectGo into the project section, click on the + button and select the Share extension from the list. Just call it Share or whatever name you prefer. The system asks you if you want to activate the Share scheme , just select Activate .
App Extensions are an iOS feature that allows developers to extend the functionality and content of their app beyond the app itself, making it available to users in other apps or in the main operating system.
Figured it out!
Turns out there's a weird module naming thing going on in Swift, so you can fix it by adding an @objc
name to the class:
@objc(PrincipalClassName) class PrincipalClassName: UIViewController { ...
and then set the NSExtensionPrincipalClass
key to PrincipalClassName
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With