Importing VLCKit (after c59cb1b) in a Swift based project - objective-c

So I get the latest VLCKit to compile and I see in the xcode project it has it's Defines Module set to Yes in the project Build Settings, and it has the Product Module Name set to VLCKit.
I run make VLCKit to build the framework, everything builds and I get my VLCKit.framework file.
I embed that framework into my Swift based app.
If I use the bridging header, it complains that it can't find the VLCKit/VLCKit.h
from the swift side import VLCKit is also an error.
Anyone get this to work?

Well I managed to fix the issue by just creating a new project VLCKit won't play in my swift bridged project, which is another issue entirely. It will play in a purely obj-c project though.

Related

Xcode workspace with iOS and macOS

I have an iOS app which I need to build a supporting app for macOS. I was hoping to share code between them, specially the DataModel.
As the iOS app was using Pods, there was already a workspace.
I pulled in the macOS project into the workspace, and I can see all its files with no problem. But I don't seem to be able to figure out how to 'use' the class files from the iOS project in the macOS project. Would it have anything to do with Modules?
Or should I just make a new Target that is a macOS application?
I'm using Xcode 8.3.3 at the moment, and the projects are in Swift.
Select the source files you want to use and tick the "Target Membership" for your macOS target in the Inspector:
Update:
To use common code in different projects, make an extra project for your common code which builds as a Framework and include this framework in the iOS and in the macOS.
This tutorial might be helpful.

Cocoapods Obj-C framework with Swift doesn't work

I have installed an obj-c framework in my swift project using cocoapods. In my bridging header file I have imported the framework which works fine.
#import "libPhoneNumber_iOS/NBPhoneNumberUtil.h"
#import "libPhoneNumber_iOS/NBPhoneNumber.h"
However I can't seem to use the classes in my project
let phoneUtil = NBPhoneNumberUtil()
This gives an error that I am using an unresolved identifier.
In my podfile I have use_frameworks!, but I can't import the classes directly in a swift class. In my build settings also I have already set the configuration to use the pod-config file.
The framework works fine if I add it manually to my project (not using cocoapods) and import in my bridging header.
Is this problem a problem with cocoapods or am I doing something wrong? Can't seem to find a way for this to work. Any help would be appreciated. Thanks!

xCode 7.1: Could not build Objective-C module 'GoogleMaps'

I am using the GoogleMaps iOS SDK in my app and added it with cocoapods. However, after updating xCode from 7.0 to 7.1 I'm suddenly getting the following error: Could not build Objective-C module 'GoogleMaps'
In addition xCode also gives me an error in the GoogleMaps.h file in the GoogleMaps.framework:
Include of non-modular header inside framework module 'GoogleMaps'
I already deleted my DerivedData folder, updated cocoapods, reinstalled the GoogleMaps iOS SDK and cleaned and build the framework's scheme and my app's scheme. But nothing helped so far.
Answered in this similar question: xCode 7 error: include of non-modular header inside framework module with Google Maps
...but essentially you'll need to create an Objective-C bridging header file whereas you may not have needed one with Xcode 7.0. The why still eludes me.
you should open the .xcworkspace not .xcodeproj
once you added cocoa pods your project folder will contain the .xcworkspace file

Can't import Firebase framework into iOS 8 Swift-based *framework*

I am trying to create a swift-based iOS 8 framework, and wanted to include Firebase framework into it. The instructions on Firebase site are only for importing Firebase into iOS apps, which uses bridging headers. Per Apple's instructions, bridging headers don't seem to apply to a Swift framework importing an Objective-C framework. I was looking at the Importing External Frameworks section on the Apple link. It specifies that: "When you import an external framework, make sure the Defines Module build setting for the framework you’re importing is set to Yes."
Despite that, I tried to manually create bridging header and adjusted Swift Compiler - Code Generation Building Settings, to no avail.
Would you know if the Firebase framework has Defines Module build setting set to Yes? If it does, then I'll keep digging into why I get "Use of unresolved identifier Firebase" after explicitly following Firebase instructions a few times. I am using Xcode 6 Beta 5. Any other suggestions and work-arounds are also deeply appreciated.
Here is a work-around I tried, that did not work:
In Xcode 6 Beta 5, I created a new Objective-C framework - SwiftFirebase. In it, I
imported Firebase framework, and the other five frameworks
set the -ObjC flag
copied references of all the .h files in Firebase Headers folder into the new framework - SwiftFirebase.
made those references from Project to Public
imported into the SwiftFirebase umbrella header
ensured that Defines Modules was enabled. It was, by default.
Build for Running.
Created a new Swift-based Framework: TestFramework to test the above SwiftFirebase, where I
Added SwiftFirebase from Debug-iphonesimulator into the new library
Created a new swift class
Imported SwiftFirebase
Added an init method, where I put in the sample swift code from Firebase quick-start.
Build for Running
Got an error compiling: "Firebase/Firebase.h not found"
My guess is that copying references of header files from a Firebase into another Objective-C framework and making them public is not an effective way of manipulating files. :)
Hate to wait for Apple's fix. Anything else I could try? Did I miss something in the above steps that you could think of? Many thanks!

building a project with RhoStudio and then extending it with using xcode

I have created a simple application using rhoStudio for iphone and then converted that project to xcode compatible.
I can see all my project in Xcode.
Now I want to add more functionality to the project and I want it to be done using the objective C i.e in Xcode, not form RhoStudio
How can I do it.
Is this possible that we can do half of the development using RhoStudio and half of it using Xcode.
I got my answer but in a different way, we can extend the rhomobile project further using xcode, but the thing is we cannot change the code that was created by the rhoStudio.
Now for the extension i found this wonderful tutorial at rhoMobile website.
http://docs.rhomobile.com/rhodes/extensions#rewriting-the-generated-native-extension-source-code-for-iphone