How to import or refer to a framework from another project in Xcode 6? - frameworks

We heard that Xcode 6 support making your own framework and share with others. But maybe I missed the point on how to import a framework from another project, which I have the source locally.
Any tips will help!

Related

Swift package link with system framework

Can somebody tell me please how to link a system Framework to a Target in the Swift Package manager?
When I link it directly in Xcode it works perfectly, but I don't know how to specify that in the Package.swift file.
Thanks in advance,
Michael

How to build a custom Swift framework and how is it related to the SPM?

I am currently building code that I would really like to use as a framework by being able to import MyCustomFramework as I would with Apple frameworks (in the future I would also like to distribute them).
I have some questions about that :
What is the easiest way to build a framework as what I want? Is this possible to do it directly in Xcode or do I need to use command line tools in the Terminal?
Will this framework be compatible with multiple platforms (I am thinking about all Apple platforms but also about other platforms supported by Swift such as Linux).
What is exactly the link between Swift frameworks and the Swift Package Manager ? Do I need SPM to build my framework or is this two different tools?
Thank you.
Currently, Swift Package Manager (SPM) and Xcode Frameworks follow different paths. For Linux, you have to follow the SPM path since the only way to compile a Linux swift application is to use SPM. For macOS command line apps, you can follow the SPM path as well. For iOS apps and macOS UI apps, you have to follow the Xcode Frameworks path.
For the SPM path, you make the project of your framework SPM-enabled: add Package.swift file and set the file layout of your project according to SPM conventions. The project also has to be a git repository. Then the git repository of your project can be specified as a dependency to other SPM-enabled frameworks/applications. Each SPM-enabled project can be converted to an Xcode project any time by using swift package generate-xcodeproj command.
The Xcode Frameworks path is the standard, pre-SPM way of working with frameworks with Xcode, which is described elsewhere. You create an Xcode Project that will define your framework.
So, if you want your framework to be used both in SPM-enabled projects for Linux and macOS command line apps, and in Xcode-enabled projects for iOS and macOS UI apps, you have to follow the dual path. You make your project SPM-enabled and add an Xcode Project which will define your framework. You will have to maintain your project information twice - in Package.swift file and in the Xcode Project.
I gave a detailed answer on how to use Xcode to create a Framework target in an answer 2 weeks ago here. The question wasn't specifically related to Frameworks, so I can understand how it doesn't come up in a search. (I also believe if I copied/pasted it here that would be unwelcome, but if I'm wrong I'll do it.)
For now a Swift Framework target can be compatible across Apple platforms, provided you separate UIKit, Foundation, and core code into their own frameworks. (There may be a better way but that's the best way I know.
About Swift core code: Currently Swift is (still) evolving fast. Swift 3 is beginning to have production server-side use and some Linux use, but right now with no binary compatibility (that's part of Swift 4) I'd stick to Apple platforms.
I've heard conflicting things about Swift version compatibility between Swift 2 & 3. By this I mean you can use both in the same project, but there are hurdles if you do.

iOS Custom Framework Development?

I am trying to create a framework since I am developing a library.
I have Googled a lot, but didnt find any proper tutorial to create. Please give me some suggestions and steps to be followed to create a iOS framework.
I am Using iOS 6 and XCode 4.5.
I followed this framework tutorial with a lot of success. My callout from the tutorial is that it doesn't specifically mention (from what I recall) building the target, then the bundle before archiving the bundle. I also found it easier to directly copy the archived bundle from its source directory instead of relying on the script.

iOS FrameWork UnitTesting

I have created a iOS framework and want to use that framework in one of my application.
My question is about the UnitTesting of the framework.
I have read about the inbuilt xcode unittest framework, but not sure how to get started on testing the framework.
Or do I have to import the framework in one of my apps and then perform the testing of the framework via
Regards,
Nirav
Add a new target to your project, select Others -> Cocoa Touch Unit Testing Bundle, give it a name.
Add to the new target the Compile Sources and the Link Binary. And in your test class write the tests you need.

Implementing Cocoa XML-RPC framework for iphone

I have my drupal xml-rpc service setup, and now I want to retrieve content for my iphone app.
I'm attempting to use https://github.com/eczarny/xmlrpc, however I dont know where to begin. How do I add the project to my own project for use? I've added a static library before; is it the same process? Just drag the proj file to my project and add the xml-rpc library?
Any tips would be appreciated.
Try dragging the project file for xmlrpc framework into the code list in XCode for starters. Next make the framework target in the xmlrpc framework a build dependency. Finally add the xmlrpc.framework to your linked frameworks. Exactly how you do this depends on whether you are using XCode 3 or 4