Creating Cocoa Touch Frameworks in Swift?

82 views
Skip to first unread message

Bernd Plontsch

unread,
Sep 15, 2014, 1:34:03 PM9/15/14
to berlin-c...@googlegroups.com
I am having a hard time creating a custom Cocoa Touch Framework using Swift or mixed Swift/Objective-C in order to share code with a Today Extension. 

Has anyone had any luck with this so far? Could it be that currently only Objective-C is supported for creating custom Frameworks? Hmm …

I'd appreciate any thoughts on this.

Romain B.

unread,
Sep 16, 2014, 4:40:03 AM9/16/14
to berlin-c...@googlegroups.com
Hey,

I'm also having a painful time with this...
I managed to fix my problem by switching 'EMBEDDED_CONTENT_CONTAINS_SWIFT' (in the target's build options) to YES.

Does it help?

Romain.

Claus Höfele

unread,
Sep 16, 2014, 5:07:11 AM9/16/14
to berlin-c...@googlegroups.com
If you use the framework in a Today Extension, you also need to enable the build setting Require Only App-Extension-Safe API (see https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/ExtensibilityPG/ExtensionScenarios.html).

Because the overhead of duplicating binary code isn't such a big deal for my app, I will probably not use a framework at the moment. But this is just a personal preference (mixed Swift/Objective-C apps are complex enough already).

-Claus

--
Sie erhalten diese Nachricht, weil Sie in Google Groups E-Mails von der Gruppe "Berlin CocoaHeads" abonniert haben.
Wenn Sie sich von dieser Gruppe abmelden und keine E-Mails mehr von dieser Gruppe erhalten möchten, senden Sie eine E-Mail an berlin-cocoahe...@googlegroups.com.
Wenn Sie in dieser Gruppe einen Beitrag posten möchten, senden Sie eine E-Mail an berlin-c...@googlegroups.com.
Gruppe besuchen: http://groups.google.com/group/berlin-cocoaheads
Weitere Optionen finden Sie unter https://groups.google.com/d/optout.

Alexey Denisov

unread,
Sep 22, 2014, 4:39:48 AM9/22/14
to berlin-c...@googlegroups.com
I've managed to get this stuff done, but it took toooooo much time (spent a few days).
And it's really painful to get to worked. Also, due to ABI incompatibility you should have a build for the easy Xcode' version.
If you still interesting you can take a look at the makefile for iOS: https://github.com/railsware/Sleipnir/blob/master/Frameworks/Makefile.ios
Reply all
Reply to author
Forward
0 new messages