Conversation
|
🎉 |
|
@kylef mate come down here i got infoz |
|
👍 |
|
Isn't there a comparable change in xcodeproj that we have to make? |
|
I don't think xcodeproj needs to be changed, the CocoaPods use of Xcodeproj needs to be changed. Instead of using static libraries, a framework should be made. There is also a |
|
Of course, to keep compatibility we need to support both static libraries and frameworks. |
|
we need to find out if frameworks are supported in iOS backwards |
|
@segiddins there do not appear to be any new constants added to the .pbxproj that would be relevant to Xcodeproj after some poking around. |
|
Okay real talk here we need to think about the architecture going forward. Swift needs .frameworks. I don't know if that's iOS 7 out the window. I assume it is. We can do things in two ways:
I'm leaning towards the first approach for simplicity. I had a go at it, Xcodeproj supports creating frameworks (undocumented). We need to make it do that, cut out the aggregate link phase and make the pods resources get bundled in the framework. HOW DO WE FACTOR THE LAST SENTENCE PROPERLY? |
|
Forgive my ignorance (I'm not a contributor yet nor understand this on your level), but it seems that leaving iOS 7 behind means Swift CP support being half-helpful (if even) pre-iOS 8 and not fully helpful until at least next April/May when most people start dropping iOS 7 support. Complexity++ sucks, but building a real iOS 8 app using Swift-only dependencies is currently a fantasy, so we probably just have to work toward assumption that there'll be a lot of Swift/ObjC intermixing. This will probably last for awhile seeing as Swift adoption may not be that fast once the initial excitement comes down and people realize Swift is still kind of raw. Dunno. It's English - nobody knows how to factor sentences properly. |
Swift is backwards compatible with iOS 7. It will not work with Xcode 5. So the discussion is how to support the new changes in Xcode 6/Swift, and still support Xcode 5 for those who can't upgrade. I've played around with the new frameworks stuff in 6, and most of what CP does can stay the same. We'll just be creating a We'll still need a |
|
Cool. Let's get this show on the road !! :) |
|
@gamenerds I didn't say Swift-only – I mean embedded frameworks only. And I meant "how to take that sentence and make a sensible OO solution to requirements expressed within". @mtitolo This still doesn't address the issue – can we have embedded frameworks in iOS 7? |
|
@swizzlr @mtitolo only thing related to this I could find is this: https://devforums.apple.com/message/977606#977606 So it seems, no is the answer. |
|
So, IMHO, in addition to frameworks, CP should also be able to generate a bridging header for all Pods, so that one can properly write Swift apps which support iOS 7. |
|
Can we make a static lib with Swift that's still importable? Somehow generate the mmap? But that's a question that's quite complex. For now I think we should have the MVP of adding a "Framework mode" which is enabled when using Swift pods or asked for. |
|
Really eager to see how this turns out, just thought I'd add some useful info for those who don't read compiler docs for fun. The following points only refer to exposing Obj-C modules to Swift / Obj-C code: The clang compiler finds these modules via a mod.modulemap file with syntax like this: The clang docs might be a useful basis for discussion for those who haven't read them: This module map functionality was originally intended for exposing Objective-C/C code as modules, to solve some of the horribleness of linking .h files in a backwards compatible way, and it works fine in XCode 5. As I understand it, a framework can be avoided, as @swizzlr mentioned all you need is a modulemap. Paths to including this could be (these might be wholly useless suggestions, just being constructive): Manually creating the module mapsAdd a config option like In this case the module author could specify the location of the module map or All module-related config in the Podspece.g. To specify all of the available options for the modulemap DSL |
|
@swizzlr Go ahead 👍. |
|
Can we do a google hangout session about this, so I can get up to speed about all this stuff and your thoughts? (Anyone that has info, not necessarily existing CP contributors.) I have a conference at the end of this week, so I can’t guarantee being up-to-speed before than, therefor I propose Monday the 23rd: http://www.timeanddate.com/worldclock/meetingtime.html?iso=20140623&p1=16, during working hours preferred. |
|
What about 4pm Amsterdam time, http://everytimezone.com/#2014-6-16,120,cn3 ? |
|
Sounds good to me! |
|
Cool, re-iteration, this is welcome to anyone whose either done some digging into support or knows about how obc/swift integrate, I'll put a hangout link in here 10ish minutes before. |
|
I’m available from 19:00 to 23:00 GMT. |
|
So will this be merged to add Swift support? |
|
Way too much work left to do. |
|
Hello, what was the result of the Hangout session? |
|
@danthorpe That's all outlined in #2272. |
Rather, wouldn't we want to identify (+ create if necessary) the bridging header and import a root header for each pod? |
|
There's something worth thinking about that bridging headers need to be user edited. I see two reasonable ways to handle it:
|
|
@orta @segiddins The bridging header should be the frameworks header which should exist most of the time, most frameworks/pods expose a single header to import. If there isn't one, we could generate one importing ever public header as @orta suggested. Example: https://github.com/QueryKit/QueryKit/blob/master/QueryKit/QueryKit.h |
|
@kylef this already needs another rebase |
|
I think this is superseded by @mrackwitz, but I have pushed this change incase it is needed to be cherry-picked elsewhere or merged |
|
@orta @segiddins Bridging headers are not supported in embedded frameworks, so that cuts the problem right away. Why not generate both Targets: Embedded Frameworks dynamically linkable (for usage in iOS8+) and static libs for the rest. Starting iOS 8, one should not rely on static linking as the recommended pattern involves dylibs for shared code between appExtensions and main app. Statically linked, that will produce ugly duplicates! That should make the development easier, and also can be based on the platform flag of the podfile no? |

💥
Incomplete, it adds the files but I think we need to create a module.