How to insert framework into repo lib create by CocoaPods? - ios

I had a framework named TCXXXXX.framework can only be added to project by manual.
In addition, I had created a Share repo by CocoaPods's command pod lib create STShare.
I had try to add TCXXXX.framework and TCXXXX.bundle into STShare's Classes document. However, it work wired. TCXXXX.framework and TCXXXX.bundle changed to a document view in Xcode( The bundle and framework icon just disappeared).
By the way, it couldn't build succeed because STShare couldn't found the class in TCXXX.framework.
I want to know how to add framework to STShare repo by manual?

Sorry, I answer by myself. (Too much time for answer, and I found by myself)
I can fulfill the requirement by specify s.framework line in STShare.podspec file.

Related

How to add a reference (instead of copy) of a custom iOS framework in a project

I try to add a custom made framework in a project of me but as a reference.
The reason for this is that I want making changes in the framework and see them in the project without need of delete old framework - copy new one.
But something i am missing since i got the below error
No such module
The way I add the framework as a reference is to "untick" the "copy if needed" when I drag and drop it.
I am adding the framework inside the "frameworks" folder of the project.
Any help would be appreciated, thanks!
You should be linking external libraries in the menu by going to the Target’s “Build Phases” and add the library with “link binary with libraries”. This should fix your problem.
An alternative suggestion is to use CocoaPods, which are very widely used in iOS development. If you aren't familiar with Cocoapods, its sort of like web development's npm. You turn your custom framework into a Pod and add a Podfile to your iOS app. The Podfile is just a list of external dependencies. If you push a change to your custom framework, all you have to do is run
pod update
in your command line it will automatically handle the update. This would solve your problem and also keeps your project neat and organized so you don't have to juggle drag and dropping new libraries. CocoaPods also can handle a lot of the other major external libraries you may be using. See the following very easy to follow tutorials:
creating a pod,
getting started with cocoapods

Adding a GitHub framework to an XCode Project using Swift

Sorry if this is too basic, I'm a kind of a rookie on app development.
I've been trying to add this GitHub framework for SpriteKit easing to my XCode project. The only steps for installation (that doesn't require CocoaPods) the framework provides are: 1: Drag the Pod/Classes folder into your project. 2: Import the frameworks in the _Archive folder.
However, it doesn't seem to work after doing this. I can't import the framework into my swift files, and I can't use the actions. I may've done the 2nd step wrong, I may not have done it as it's supposed. I've searched all over the internet for ways to import a GitHub framework into XCode, but every answer seems to be different and specific for each case.
I think you may have missed the second step (you say there is 'only step'). The second step is to drag the framework from the _Archive folder. You can find it in the clone of the project folder. Also, try the sample project and see how it's organized. Make sure that you add the framework to the Link Binaries... section in the project Build Phases.

Adding an Xcode subproject: Shouldn't all the source files get copied?

I am manually adding the SQLite.swift subproject to my project. As the directions indicated, I copied the .xcodeproj file to my project. This allows me see all the source files (unlike this SO question).
Everything seemed like it was working fine. However, I discovered that the source files of that subproject were not copied to my project. They are still in original location where I downloaded them. Is this by design? What if I want to share my project source code with other people in the future? They won't have the subproject source that is necessary for my project to work.
If I do need to copy the subproject source to my project, then how do I do that?
Add it to your filesystem-structure first. For example by pressing "Show in Finder" on the "Chimee"-project which will lead you to the folder it's located in. Then copy the SQLite-project structure in there.
Afterwards you can then drag&drop the xcodeproj into your project which will then still link to its original path, but as it's now inside your project-structure isn't a problem anymore.
I guess that this is by design, because when you try it via Add files to "YourProject" you can select the Copy items if needed-option but it will still not get copied (only with .xcodeproj-files, it works with all other filetypes)
After doing more research, I now feel that using a dependency manager (like CocoaPods or Carthage) is a better option than manually adding the framework to the project.
This will allow easier updating in the future.
Github source code sharing and App Store submission issues have already been considered.
Using Carthage is not too difficult if you follow this excellent guide: Carthage Tutorial: Getting Started
Notes
Delete the framework files that you manually copied in before installing the framework with Carthage.
I will leave #TMob's answer as accepted for now, but I am no longer pursuing that route.

Integrating CocoaLumberjack into iOS Project via Drag-and-Drop

I'm trying to integrate CocoaLumberjack into my iOS project by dragging-and-dropping the Lumberjack.Xcode file into my project. That works fine, but now my project has 9 new targets. I don't need all of that overhead. So my question is, how do I cut down on the number of targets to just the needed stuff for iOS?
It seems every time I drag over only the mobile project that it is missing needed files. Upon my research, it seems that there are no up-to-date tutorials related to integrating Lumberjack specifically to iOS, which seems like a tool that would be commonly used so that is odd. Being new to all of this, it is troublesome and I would love some help.
Other information: I'm doing a manual installation since Cocoapods is not an option for me. I am following their Installation Guide:
Installation Guide
The very first line in the manual installation guide is
git submodule add git#github.com:CocoaLumberjack/CocoaLumberjack.git
I do not want to add yet another submodule to my project, so I'm dragging and dropping Lumberjack.Xcode into my project.
Before I learned how to use CocoaPods, I used to just clone the repo and copy all of the .h and .m files into my project, ensuring they're added to the correct target.
The only issue you have to make sure to avoid is missing one or more files. Not 100% sure with CocoaLumberjack, but I'd look at just adding everything from here:
https://github.com/CocoaLumberjack/CocoaLumberjack/tree/master/Classes
Instead of adding it as a submodule, you can simply clone the repo and add it to your project. The rest of the instructions remain the same. So replace the line you quoted above with:
git clone git#github.com:CocoaLumberjack/CocoaLumberjack.git
rm -r CocoaLumberjack/.git/
Then follow the rest of the instructions in the install guide.
Instructions from CocoaLumberJack
https://github.com/CocoaLumberjack/CocoaLumberjack/blob/master/Documentation/GettingStarted.md

How to install projects without cocoa pods?

I have seen various libraries on GitHub that look useful, but only list CocoaPods as an install method. I'm not sure I want to be dependent on CocoaPods, because I'm wary of Apple breaking it in some future OS X/Xcode update. Is there a way to get these libraries into my Xcode project without using CocoaPods?
Role of CocoaPods is to automate and simplify the process, but you don't need to use CocoaPods if you don't want to.
In case of "manual installation", usually it would be:
download the project from GitHub
add the files to Xcode
import headers
But there is no universal recipe for every project, it may slightly differ from case to case, but usually it boils down to previously mentioned.
The best way if you don't want to use CocoaPods is to read the project documentation, and study examples if there are any.
Of course there is. Basically you need to download the library project, drag the project into your own project, do some library dependency setup and you're done.
For details, check out https://github.com/Alamofire/Alamofire for manually adding a Swift library. And https://github.com/jverkoey/ObjQREncoder for manually adding a Objective-C library to your project.
The only way to install things without Cocoapods is to just drag the source code of other projects into your class. For example, most Github projects can be installed via Cocoapods, or you can just drag the relevant source code into your projects. You don't need to drag in all of the project resources, all you need is usually class files

Resources