Install Swifter framework to Xcode - xcode

I'm trying to install Swifter framework to Xcode that provided by github here:
https://github.com/mattdonnelly/Swifter
but the installation is not clear enough, there is no folder had the extenssion .framework with header folder inside it
can someone please help me how to get this framework to my project
thank you

IF you are using Cocoapods, add the following line to your Podfile.
pod 'Swifter', :git => 'https://github.com/mattdonnelly/Swifter.git'
Run pod install then you should be set.

First of all you should clone the repo. After that drag and drop Swifter.xcodeproj to your project. Lastly add SwifteriOS.framework to linked frameworks and libraries of your project.

Related

Push Umbrella Framework to Git server

My problem is that I have developed a framework committed and pushed through Git server no problem, now I want to add a third party library like Alamofire to the framework, in order to generate a framework file that I can send or use anywhere.
So far my options are:
Cocoapods, but couldn't commit and push added cocoa pods and workspace.
Carthage, didn't know about it much
Swift package manager; played with it a bit, but couldn't push the package and other new .xcodeproject files.
any other failed ways like adding needed files only, or adding the product framework file from Alamofire to My Framework project which is useless.
So I still need help with adding 3rd party framework to My framework, push it correctly and completely to git server, so that I can clone it or download it from another mac.
Please help.
I suggest you to add Alamofire with Carthage, doing so:
install Carthage:
$ brew update
$ brew install carthage
at the root of your project, create the file Cartfile and add the following line:
github "Alamofire/Alamofire" ~> 4.5
run carthage update
drag and drop Alamofire.framework inside your project and that's it.
about Alamofire+Carthage, you can check the official documentation here: https://github.com/Alamofire/Alamofire#carthage
regarding how to integrate a framework with Carthage, check here:
https://github.com/Carthage/Carthage#adding-frameworks-to-an-application

No such module ZFDragableModalTransition in Swift

I have a xCode project. I am trying to run FolioReaderKit. I've installed the all project requirements such as CocoaPods and Carthage and I've fixed the errors except ZFDragableModalTransition.
I've downloaded it and added into my project over and over, I've added it as a Link Binary but I'm still getting same error. "No such module ZFDragableModalTransition in Swift"
I am very new in swift and Xcode therefore I might be make a mistake but I didn't manage it yet.
Do you have any suggestion?
You can see the error attached images.
If you want to run the FolioReaderKit Example project and you are new to Swift and Xcode I suggest you to use Cocoapods instead of Carthage. You don't have to run FolioReaderKit.xcodeproj.
Just go to Example folder and follow this steps:
Open the Terminal on Example folder;
Run pod install (you need Cocoapods installed);
Open Example.xcworkspace file on your Xcode and run;
To add this you your project using Cocoapods create a Podfile and add:
use_frameworks!
target 'MyApp' do
pod 'FolioReaderKit', '~> 0.7'
end
Then use pod install to install it to your project, the usage documentation is in the Example project.

Importing Alamofire 3.4 - No such module 'Alamofire'

I hava a project that need Alamofire imported and every aproach i took got me to same porblem
import Alamofire - No such module 'Alamofire'
Installed cocoapods
Edited Podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!
target 'my project name' do
pod 'Alamofire', '~> 3.4'
end
$ pod install
everything was smooth and had no errors in the proces from installing cocoapods to the end.
Opened project with projectname.xcworkspace
Even tried the manually and still the same problem - No such module 'Alamofire'
Thank you for the help in advance.
After adding a framework through CocoaPods, in most conditions you are supposed to clean and build the project right away.
That should take care of adding/building the new framework to your app and make it active for use
Also, please note that another copy of your project will be created upon addition with pods, called something like 'yourProjectName.xcworkspace' (You can find it in your directory). It will have a light blue color thumbnail. After adding your pods, you must start using that copy of your project instead of the normal project.
// Note : Generally with CocoaPods, when you add a pod to your Podfile, you just need to save the Podfile and type 'podinstall' in your terminal. Make sure to get to your project directory before that. That will import the frameworks automatically. However, you do need to write import statement in your file to use it obviously
You do not need to import Alamofire framework explicitly (if using Cocoa Pods) - Umair (in comments)
Do import Alamofire and then do Build. I think it's helpful.
I had a similar issue and solved it following the below listed steps:
Realized that <projectName>.xcworkspace is what you need to be using after adding a pod to your project
Deleted the pods folder and Podfile.lock and did a pod install
Set Architectures to Standard architectures (armv7, armv7s, arm64)
Set Build Active Architectures Only to Yes
I Faced the Same Issue During the Implementation
Step 1 :
Import Alamofire
Step 2 :
Keep on Pressing Build ( Cmd + B )
Step 3:
If Issue Continues then just close your program for a moment by
completely closing it(cmd + Q) and then Restart it and Follow Step
1 & 2
This will work
Thanks
If you install dependencies using Pods, and if you are working using .xcodeproj file, it will never build prompting no such module error. You should definetely switch to .xcworkspace and you will see everything's fine. If the error persists, you should clean the project or delete derived data.

Cocoa Pods without workspace?

I have read about a possibility to add CocoaPods to an XcodeProject without getting the xcworkspace file, instead you get a xcodeproj file that you can integrate into your current project. How can I do that? Would love to use the xcodeproj file instead of xcworkspace.. I'm programming in swift (if that makes any difference).
Yes, its possible. But, we need to do few steps to proceed.
Check this Github thread.
The below line in pod.file will not let the client integration process.
install! 'cocoapods', :integrate_targets => false
We can drag and drop the Pods.xcodeproj to the main project
Link the target dependencies and Link Binary with Libraries in Build phases.
Thats it.
You can not do this.
The CocoaPods website guide to using CocoaPods found here directs you to using the .xcworkspace it creates. Several other guides found across the Internet all direct you to use this file indicating that using the .xcodeproj file will now result in build errors.
There is simply no evidence that this is a possibility at all.
From the CocoaPods website guide on using CocoaPods:
Save your Podfile.
Run $ pod install
Open the MyApp.xcworkspace that was created. This should be the file you use everyday to create your app.
More from their website:
Now you can install the dependencies in your project:
$ pod install
Make sure to always open the Xcode workspace instead of the project
file when building your project:
$ open App.xcworkspace
And from the Ray Wenderlich guide regarding using CocoaPods with Swift:
Open the project folder using Finder, and you’ll see that CocoaPods
created a new IceCreamShop.xcworkspace file and a Pods folder in which
to store all the project’s dependencies.
And from an NSHipster article on CocoaPods:
CocoaPods will create a new Xcode project that creates static library
targets for each dependency, and then links them all together into a
libPods.a target. This static library becomes a dependency for your
original application target. An xcworkspace file is created, and
should be used from that point onward. This allows the original
xcodeproj file to remain unchanged.
In older versions of cocoapods it was possible to install and update pods with the option '--no-integrate'. It allows you to create a library project, which could be imported into an existing project (read more). But this option is missing now. I've build a Xcode project for a maven-build with this option earlier. Today I've updated the pods of this project with the newest cocoapods version (1.0.0) but without the '--no-integrate' option and it still works. So eventually there is a way...

How CocoaPods' install command works behind the scene to add files to my Xcode project?

I've started using CocoaPods. I like the way it adds files to my Xcode project but I'm curious about writing my own AppleScript to be able to add files to my Xcode project. How I can do that? Any reference would be appreciated?
The Xcode project file format is tough. There are 2 tools that CocoaPods can use to edit them. The Xcodeproj Ruby gem is the first. A lot of other projects such as slather also depend on this gem to deal with the project files. If you have it installed CocoaPods can also use xcproj to add things to your project. This can be installed with Homebrew with
brew install xcproj
It has to be recompiled each time you update Xcode. If you'd like to make a tool that manipulates your project I'd recommend these as your starting point.

Resources