I am trying to add FTUtils to my iOS project but even though I have added the "FTUtils.xcodeproj" project to my own custom project I am not able to make a reference to the
#import <FTUtils/FTAnimation.h>
I followed the setup from this link: http://ftutils.com/docs/setup
When I drag the FTUtils.xcodeproj into my own project it does not ask me anything. Also the documentation says that check mark the libFTUtils.a. What checkbox are they talking about?
This answer is a little bit late, but, the only thing that you have to do is to drag this files to your project :
FTUtils.h
FTAnimation.h
FTUtils+NSObject.h
FTAnimationManager.h
FTAnimation+UIView.h
FTUtils+UIGestureRecognizer.h
In Build Phases tag ---> Link Binary with libraries add:
libFTUtils-fat.a
Then you have to import to your class:
#import "FTAnimation.h"
#import "FTAnimation+UIView.h"
And use it like (with the effect/Animation you want to use, of course):
[self.view slideOutTo:kFTAnimationLeft inView:self.view duration:1.0 delegate:nil startSelector:nil stopSelector:nil];
I just dragged the .m and .h files into my project. I prefer to have the source instead of the library so I can edit it. I have added a number of my own animations to it.
But if you prefer to use the static library, I believe you open FTUtils.xcodeproj, build it then drag the .a file it will build and .h files into your project.
Related
To setup a SideMenu in my iOS project, I'm Using SWRevealViewController without pods and this create a bridging header file
SWRevealViewController.h
SWRevealViewController.m
MyProjectName-Bridging-Header.h
Now I want to remove these three files and add my custom SideMenu, but this cause a big problem
I trying some solutions which I found in stackoverflow and another websites like 1. go to Target > Build Settings > Swift Compiler - General > Objective-c Bridging Header and remove its value. but this case a lot of errors. 2. retrive just this file 'MyProjectName-Bridging-Header.h' but this again cause a lot of errors.
the project does not work successfully without the three file. although i don't use these three file in any part of my project.
when I delete the three files + clean the Objective-c Bridging Header I get this error.
Edit: I note that after I do the deletion step the 'import UIKit' disappears from most files in the project.
I solve the problem by the following steps
1- Delete these two files which caused in creating bridge file
SWRevealViewController.h
SWRevealViewController.m
2- remove #import "SWRevealViewController.h" from Bridging file and add #import <UIKit/UIKit.h>
and this solve the problem for me.
Are these only 3 OBJ-C files you use in your project?
Here are the steps you should follow:
1. Delete all the {{obj-c}}.h,.m,.xib along with AppName-Bridging-Header.h
Then go to Target > Build Settings > Swift Compiler - General > Objective-c Bridging Header and remove its value, as you saw in multiple stack overflow post.
Clean build and run the project to solve the errors
I'm trying to implement ARToolKit into an Objective-c iOS app.
I have downloaded the ARToolKit SDK and I see the following contents. The ARToolKit5 directory is for Mac OSX, so I have left this one closed. ARToolKit5iOS is the directory that I have tried to import into my Xcode project.
What I have tried so far...
Inside share > packaging, I ran the following command and this seemed to run correctly without any errors.
bash ARToolKit5iOS-bin.sh
Then I tried to import the lib and include directories into my Xcode project.
The problem
Here is the contents of my project > ViewController.m
#import "ViewController.h"
#import <AR/ar.h>
#interface ViewController ()
#end
#implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#end
As you can see in the following screenshot, the error occurs whilst trying to import the AR toolkit.
I am not an Objective-c developer, so what am I missing here?
Give the correct location of <AR/ar.h> file.
For example:
#import "../ARAppCore/EAGLView.h"
Here's what you do:
1. Download iOS SDK on ARToolKit's Download page
2. Unzip the archive and move the folder to where your Xcode project is in the file system
3. Open your project in Xcode
4. Drag the ARToolKit5iOS.xcodeproj into your project
5. Select your project on the left panel, click on your app target, then in Build Phase, add various AR targets as dependencies and link libraries
6. In Build Settings, under Search Paths, add "Library/ARToolKit/include/" and "Library/ARToolKit/include/ios7" to Header Search Paths. Also, add "Library/ARToolKit/lib" and "Library/ARToolKit/lib/ios7" to Library Search Paths. *
This path will differ depending on where you put the ARToolKit sdk and how you name the folder. As you can see in the phone in Step 2. I add Library folder and put everything under the folder "ARToolKit". Plus, the Library folder is at the same level as the ARExperiment.xcodeproj file. Thus, when referencing them, I have to put "Library/ARToolKit/" first.
I also integrate ARToolKit library to new iOS project after long research.
Need to add lib, include and ARAppCore to our project. Please note the following image when we add the folders to your project
You can fix the issue by adding 'Header search path' on target of your new app.Please go through the following image.
You can create a framework target and separately build a framework that you will later put into your application (which will also work with a swift app). To do this you will need to start as follow:
Download ARToolKit5-bin-5.3.2-iOS.tar.gz and unpack it.
Open ARToolKit5iOS.xcodeproj
In Xcode go to File -> New -> Target
Choose Cocoa Touch Framework, enter Product Name, set language to Objective-C, set Embeed in Aplication to None
Go to ARFramework target Build Phases, you will configure it according to ARApp target that is:
in Build Phases in Target Dependencies add: AR, ARICP, ARvideo, ARgsub_es2
in Compile Sources add: ARAppCore/EAGLView.m, ARApp/ARViewController.m, ARView.m
in Link Binary With Libraries add: Accelerate.framework, libAR.a, libARICP.a, libARvideo.a, libARgsub_es2.a
Go to Build Settings and set Automatic Reference Counting to No
Create new PCH File (prefix header) for you Framework target
In Build Settings set Precompile Prefix Header to YES and in Prefix Header set path to PCH file that you have created
In created PCH file add imports: #import <Foundation/Foundation.h> and #import <UIKit/UIKit.h>
If your framework need to be bitcode enabled then set Enable Bitcode in Build Settings of you framework target and targets: AR, ARICP, ARvideo, ARgsub_es2
Your framework target should now Build successfully so you can check Product -> Build on your framework target
Note that in ARViewController.m from ARApp that you added to the framework there are two hardcoded paths to camera_para.dat and hiro.patt files which are needed in this example to detect hiro marker. To solve this you can for example add those two files to you application and edit ARViewController.m to search them in main bundle so for example edit lines that load them in the ARViewController.m to:
char *patt_name = [[NSBundle mainBundle] pathForResource:#"hiro" ofType:#"patt"].UTF8String;
and
char *cparam_name = [[NSBundle mainBundle] pathForResource:#"camera_para" ofType:#"dat"].UTF8String;
or implement some custom reading depending on your needs. In your app on storyboard set viewcontroller class to ARViewController and thats it, framework should now work fine and scan hiro marker in your custom app and show a cube on top of it. Also note that this is just an example of how to copy ARApp functionality into framework that can be attached in your app and this framework will not have any visible interfaces so this is just the basic work you will need to do to integrate it with basic single marker detection functionality.
When I used a third-party SDK, I followed the guide to import the SDK package into my project by drawing the floder into the project navigator.
The guide show I can use it by adding:
#import "package.h"
but I got an error 'package.h' file not found.
Then I found using #import "SDK/a/package.h" is OK.
The sample project given with the SDK also just use the name without path.
Am I use the wrong way to import the Code? or did I miss some steps before using them?
You need to enable "Target membership" option in project navigator for header file, under "Utility view".
If that does not work, make sure your ".h" file it's added on Build phases -> Headers -> Public.
I am trying to include SBJsonlibrary in my project that does not use ARC. Since I cannot include source files, I've followed the steps described: here. However I end up with the same problems described in this SO question.
When I add libsbjson-ios.a to my project, it is shown in red, which I assume means the library is missing.
Although the compiling of the project goes fine, when I try to add #import "SBJson.h" I get
"SBJson.h: no such file or directory" error.
How do I solve this? My project is too large and I cannot change everyting to use ARC.
you simply need to drag all the files into your project rather than importing the library. i suggest to see https://github.com/stig/json-framework/ and follow the read me file to install in your project.
to use this in your projects
download the zip file from above link.
In the Finder, navigate into the src/main/objc folder.
Select all the files and drag-and-drop them into your Xcode project.
Tick the Copy items into destination group's folder option.
Use #import "SBJson.h" in your source files.
As an aside, a project can use ARC for just some files, so you could have compiled SBJson's classes with ARC and the rest of the project without.
A better way would be to just use SBJson from CocoaPods if you need to support iOS4. Or just switch to NSJSONSerialisation if you don't.
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