I want to add this Side Menu without using POD or Carthage, How can i do this.
Doing a git clone and then copying the files from SideMenu/Pods/Classes in your project should be enough.
I checked the dependencies of the project and there are none. This means that cocoapods won't get you more projects so you should be safe.
You can always add libraries by manually adding the files required by the library . Here you can get the files inside the Pod/Classes. There are four files drag and drop them in your project , and import .h file in your bridging header. You will be able to import library in your files. Hope This helps you out .
Related
I am trying to install this library without using Pods. In their git, they explain that it's possible to do it by dragging the .xcodeproj file on the user project:
Yes you can copy it the classes like before. However it's more
comfortable to drag the xcodeproj to the project. It's not recommended
to drag the sources themselves, as this will make updating Chrats in
your project more difficult.
By dragging the project I get an error When I try to import the module:
No such module 'Charts'
I also selected my project -> Build Phases -> Link Binary With Libraries and added the Charts.framework. That didn't solved the problem.
I think to use any of the cocoa pods you have to build a header file as maybe the code that you are going to use might be in objective C and you might be using swift.
Simply create briding header file with named
"projectname-bridging-header.h" at root of your project.
Now got to build setting of project and in that do below changes:
Install objective-c compatibility header : YES
objective-C briding header : set path of your bridging header like
"projectname/briding header file name.h"
once its done import all your objective c file of pods which u want
use in swift app.
Note : if required then set the path as a recursive in the resource headers and Swift compiler search section.
let me know if any issues :)
I need to manage photos in my app and have read much about SDWebImage framework which seems to be the best way to go.
However I am finding it incredibly difficult to install. I dont know Ruby and have never used a podfile, so am installing it by downloading the latest SDWebImagefolder & framework and adding them to my project. However when I try to import into my viewcontroller using the suggested imports:
#import <SDWebImage/UIImageView+WebCache.h>
#import "UIImageView+WebCache.h"
I get a file not found with on the #import then if I change this to "SDWebImage/UIImageView+WebCache.h" as suggested I get a file not found on the: #import UIImageView+WebCache.h even though I can clearly see it when I open the SDWebImage folder in my project! I'm guessing that these errors also lead to a not found error when I try to use the sd_setImageWithUrl method.
Here's a screen shot of my project:
I hope I can get some help with this as the framework looks to have very good functionality. Any help very much appreciated. Thanks
When you add the SDWebImage folder in your project then select following option. To add copy of your folder to the destination project and Create groups.
and then you have to write just like
#import "UIImageView+WebCache.h"
And make sure that you are adding to all the targets that you want to use that library.
Documentation at Github :
Add the SDWebImage project to your project
Download and unzip the last version of the framework from the download page
Right-click on the project navigator and select "Add Files to "Your Project":
In the dialog, select SDWebImage.framework:
Check the "Copy items into destination group's folder (if needed)" checkbox
Or you can use cocoa pods as other answer suggested.
EDIT : EXAMPLE :
[self.imageView sd_setImageWithURL:[NSURL URLWithString:"yoururl.png"] placeholderImage:[UIImage imageNamed:#"placeholder.png"]];
You can use CocoaPods to manage libraries in your project.
To add SDWebImage to your project you should add this line to your pod file:
pod 'SDWebImage', '~>3.7'
UPD
To use CocoaPods, you should install it, to create it you can open Terminal and copy/paste this line:
sudo gem install cocoapods
On next step you should create Podfile in directory that contain your project file. Pods it is text file (you can create it by using xCode or other text editor (only do not use Writer, it uses not correct character for " ' ")).
After you've created Podfile, you should run in Terminal next line:
pod update
It command'll create a workspace file, this file you'll use to open your project.
All instructions present on the home page of CocoaPods.
I ran into this issue recently, and a less intrusive way to fix this problem is to add an entry to your Header Search Paths (all 3 instances) with the content ./SDWebImage/ (assuming that's where the framework is) so that it considers that folder when looking for includes.
I think you have to use a Cocoa Pod file for SDWebImage Library.
init the pod file.
install Pod file.
and then update that pod file.
platform :ios, '7.0'
source 'https://github.com/CocoaPods/Specs.git'
pod 'SDWebImage','3.7.1'
pod 'UIActivityIndicator-for-SDWebImage'
And then you can import the following file.
#import "UIImageView+UIActivityIndicatorForSDWebImage.h"
Trying to install SDWebImage into my Swift project. I am using the following instructions (https://github.com/rs/SDWebImage):
Download and unzip the last version of the framework from the download page
Right-click on the project navigator and select "Add Files to "Your Project":
In the dialog, select SDWebImage.framework:
Check the "Copy items into destination group's folder (if needed)" checkbox
So I git clone --recursive the project from GitHub, I drag the .xcodeproj file into my project (since there is no SDWebImage.framework file as far as I can tell, and this has always worked for other frameworks), I complete the rest of the instructions:
In you application project app’s target settings, find the "Build Phases" section and open the "Link Binary With Libraries" block
Click the "+" button again and select the "ImageIO.framework", this is needed by the progressive download feature:
Add Linker Flag
Open the "Build Settings" tab, in the "Linking" section, locate the "Other Linker Flags" setting and add the "-ObjC" flag
And then I add #import <SDWebImage/UIImageView+WebCache.h> in my bridging header. I build the project and I get: "SDWebImage/UIImageView+WebCache.h" not found. I've tried some variations on these steps and nothing seems to work. What am I doing wrong?
EDIT
Pretty sure this is happening because I'm not pulling in an SDWebImage.framework file, rather the .xcodeproj file. But I've downloaded from zip and cloned the repo, and there doesn't seem to be a .framework file in there...
UPDATE
So apparently I'm just supposed to download the compiled framework, which I found in another answer: https://stackoverflow.com/a/30545367/918065. Maybe? I have no clue. When I imported the .framework file my bridging header worked and recognized #import <SDWebImage/UIImageView+WebCache.h>, but it didn't recognize imageView.sd_.... So still workin on it.
Last compiled framework is 3.7.0 and you can find it in: https://github.com/rs/SDWebImage/releases
For easier access, the direct link to the framework is below: https://github.com/rs/SDWebImage/releases/download/3.6/SDWebImage-3.6.framework.zip
import "SDWebImage/UIImageView+WebCache.h"
For me it helped when I remove SDWebImage from import. So I have this in my project-Bridging-Header.h:
#import "UIImageView+WebCache.h"
more information about iOS bridging header:
https://developer.apple.com/library/ios/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html
I recommend using CocoaPods for dealing with dependencies.
CocoaPods is a dependency manager that is designed to solve problems like these.
Follow the installation guide on their website: https://cocoapods.org
So nothing was working for me until I finally realized that you're supposed to use not the main SDWebImage folder, but the SDWebImage folder inside of that into the project. Dragging in the .xcodeproj file, the folder as a whole, or the .framework file didn't work. Importing that sub SDWebImage folder, and then utilizing Libor Zapletal's answer: #import "UIImageView+WebCache.h" is what finally got this thing working for me.
This worked in my case:
Add #import <SDWebImage/UIImageView+WebCache.h> in your bridging header
In project Build Settings, set the path of the bridging header file in Objective-C Bridging Header. Ex. My Project/BridgingHeader.h
I downloaded MapBox example from github using the following
git clone --recursive https://github.com/mapbox/mapbox-ios-example.git
Which downloaded it including all dependencies. Now I'm trying to create a separate project and include MapBox DSK as it was in that example. I tried creating workspace then creating a single view project then add new file and select .xcodepro for the MapBox DSK but didn't work when I tried importing MapBox.h file. I never tried importing 3rd parties API before and a bit not sure how I can do that correctly. Any Idea how I can accomplish that ?
Thanks in Advance
Just try:
#import <Mapbox/Mapbox.h>
instead of just importing Mapbox.h as suggested here:
https://www.mapbox.com/blog/ios-sdk-framework
You simply drag the Mapbox-ios-sdk project file from Finder to the files pane in Xcode.
And then click the project in Xcode files pane, Target-->Build Settings. Search for "User Header Search Paths". Specify where the MapBox sdk is located.
What I do is I put the MapBox-iOS-sdk in my project directory. And I set the path as $(SRCROOT) and make sure to set it as recursive.
While you're at it also make sure -ObjC and -all_load are set in Other linker flags.
That only helps you reference the .h files, to link, also under Build Setting, Link Binary with Libraries you need libMapBox.a.
If there is a MapBox.bundle (as in the latest development branch) in the group and files pane, you want to drag that into Target->Build phases->Copy bundle resources as well. (The add button doesn't work for me.)
I think the best way is to look at mapbox-ios-example provided by MapBox and try to replicate all dependencies into your own project.
A bit late but I did it like it was explained here: http://mapbox.com/mapbox-ios-sdk/#binary.
Not messing around with git, just dragging things into your project, easy!
I think problem here is he couldn't find a specific 'file' that was titled "MapBox.Framework" inside the folder of resources downloaded from Map Box, however what you actually need to do is copy that whole folder, which is titled "MapBox.Framework" into the frameworks section. I think the confusion was that the main folder that needs to be copied doesn't look like the yellow framework icon until you copy that folder into Xcode's frameworks section.
I'm trying to add KKGridView to my project. I've followed thier description from github as best I can:
Create a new workspace in Xcode in the same directory as your existing *.xcodeproj.
Drag in your existing Xcode project
Locate your copy of KKGridView, drag KKGridView.xcodeproj into the
workspace so that it stays at the top of the hierarchy, just like
your original project.
In the Build Phases section of your original project, link your
project with libKKGridView.a.
Now, simply import KKGridView just like an Apple framework:
But libKKGridView appears in red in my project, and I am unable to import any of the code with
#import <KKGridView/KKGridView.h>
Any ideas?
Copy this file physically to your folder,and then add file to xcode from there.Drag and drop create this problem sometimes.
Hope this helps you.
You need to import the .h files as well