Issues adding libraries to xCode Project manually - ios

I have been trying to add SwiftyJSON and SWXMLHash to my Swift project, however when I add them the files have many (40+) compile errors?
I have read the instructions on there git projects carefully and both projects say I can just drag the .swift file to my project, and this is what I have been doing.
I can't use CocoaPods or Cartage as I am targeting iOS 7

Related

Generate Package.swift from Xcode

I've added some dependencies to my project using Xcode and I need to generate a Package.swift file for Travis-CI.
Is there a solution other than manually add all my dependencies to this file?
You are looking at the problem the wrong way.
Package.swift should be the basis of your framework, not the Xcode project. You can generate an Xcode project from a Package file, but you cannot generate a package file from an Xcode project.
The main reason behind this is that Xcode projects support many things that Swift Package Manager (and hence Package.swift files) do not support - such as mixed language targets or signing & capabilities.
So if your project setup is fully supported by SPM, you should simply throw away the Xcode project and rely on the Package.swift file completely, otherwise you'll need to keep using Xcode projects and shouldn't use SPM until it supports your requirements.

Convert swift Xcode project into importable cocoapods

I have a Xcode project and it's running well.
But now I want to convert my Xcode project into importable cocoapods, so I can import same cocoapods in multiple Xcode project and create new separate app with same features. (by changing some UI configuration only)
(Basically, I want to move whole app/project into cocoapods, including storyboards, assets and all files. so I can create another similar app by just re-branding UI)
Can someone please help me how to configure and setup for this kind of structure?
Thanks.

Realm: bcsymbolmap is missing from working copy

I'm trying to include Realm 2.0.3 and RealmSwift 2.0.3 iOS Swift 2.3 as dynamic framework binaries in my project. I find that they take too long to compile.
I'm able to build my project and run it in the simulator just fine, but when I archive I'm receiving this error:
This is how I'm including the frameworks (simply drag and drop into project):
Help!
Per #TiM's suggestion, in the target's Build Phases I made sure that the two dynamic frameworks are added in in these sections:
Link Binary with Library
Embed Frameworks
Dragging and dropping the frameworks in the project does NOT automatically add them to Embed Framworks

How to install CocoaAsyncSocket library into Swift?

There are a lot of information on how to use GCDAsyncSockets with Objective-C but so few with Swift, and almost no information on how to actually install it into the Xcode environment. I tried adding files in the zip file one at a time with File | Add Files to ... Project menu option but still I cannot use the added files with "import GCDAsyncUdpSocket" statement. It says "No such module". There's gotta be an easier way of doing this, right?
Install using CocoaPods by adding this line to your Podfile:
use_frameworks! # Add this if you are targeting iOS 8+ or using Swift
pod 'CocoaAsyncSocket'
CocoaAsyncSocket is Carthage compatible. To include it add the following line to your Cartfile
Carthage/Build/iOS/CocoaAsyncSocket.framework
Carthage/Build/tvOS/CocoaAsyncSocket.framework
Carthage/Build/Mac/CocoaAsyncSocket.framework
Select the correct framework(s) and drag it into your project.
Manual
You can also include it into your project by adding the source files directly, but you should probably be using a dependency manager to keep up to date.
Importing
Using Objective-C:
#import CocoaAsyncSocket; When using iOS 8+ frameworks
or
#import "CocoaAsyncSocket.h" When not using frameworks, targeting iOS 7 or below
Using Swift:
import CocoaAsyncSocket
I following this steps successful use the AsyncSocket class by CocoaAsyncSocket
copy CocoaAsyncSocket project source on github
click CocoaAsyncSocket.xcodeproj file open CocoaAsyncSocket project
copy iOS version AsyncSocket.m AsyncSocket.h AsyncUdpSocket.m AsyncUdpSocket.h file to your use CocoaAsyncSocket project
xcode will tell you create a Bridging-head file,create it
edit the xxx-Bridging-head.h(xxx is your project name)file add #import "AsyncSocket.h"

Add a framework to an existing project without using cocoapods

I've got an existing project where i want to add the framework called CoreActionSheetPicker from
https://github.com/skywinder/ActionSheetPicker-3.0
The problem is i cant seem to add the framework to my project? when i pull the framework over to my existing project none of the files below is added and when i try to import it says it does not exist
import CoreActionSheetPicker
I want to do this without cocoaPods. What is the steps in order to do such? i'm using swift. Do i first need to create a WorkSpace?
I've just cloned it, and it appears the project file is invalid. You can see this by trying to open it. You should raise the issue with the owner on GitHub, which is how you're supposed to ask questions about projects there. Then you will get feedback directly from the creator or at least someone else who knows about that project.
As for adding a project,
Download the source
Drag the .xcodeproj into your project within Xcode
Add the framework in Build Phases / link binary with libraries
Add it as a Build Phase / target dependency.
Note that at the moment, you should always builds 3rd part libraries with your swift project, and not just include the binary. See here about binary compatibility of frameworks:
https://developer.apple.com/swift/blog/?id=2

Resources