How to import chilikat classes to swift? - ios

I'm trying to use chilikat's ftp classes in my project. But when I tried to compile I got an error(shown below) from xcode. What reason of that error?
And my second question is: I used this import statement:#import "CkoFtp2/CkoFtp2.h" and I got the second error here?
Path of bridging header file:
P.S. I got the path by dragging the file into terminal.

You seem to be assuming that the problem is in the path of the bridging header. That path is fine (otherwise you wouldn't have gotten an error about the #import line inside the bridging header).
The problem appears to be the CkoFtp2/CkoFtp2.h header path. Looking at your directory listing, there is no CkoFtp2 subdirectory, but rather you appear to have copied it to your main project directory. That means that you should try:
#import "CkoFtp2.h"

Related

Importing a library in to an Xcode 7 project

So I am trying to add a static library to my project in order to interface with a scanner. I have linked the binary in build phases to the libCaptuvoSDK.a, put the Captuvo.h header file in the project folder, and finally set the project to always search the user paths and added $(BUILT_PRODUCTS_DIR) recursive to the user header search paths. After doing all this I am trying to use #import "Captuvo.h" in my ViewController.swift file and getting the 2 errors Expected identifier in import declaration, and Expected expression. I have tried different combinations of importing and none of them seem to make a difference so I am led to believe the issue is with my process of adding the library.
I am new to Xcode and have never used a third party library in an application before so I feel I may be making a simple mistake or just misinterpreting things. Any help is appreciated!
Okay so I managed to fix my issue! I had imported the static library properly but the real issue was the header file. I fixed my issue by creating a new file in my projects folder named Quick-Scan-Bridging-Header.h. Inside that file is where the #import "Captuvo.h" line belonged. Once that was done I opened the Quick Scan apps build settings and under Objective-C Bridging Header I added the path Quick Scan/Quick-Scan-Bridging-Header. I also added the Header Search Path $(BUILT_PRODUCTS_DIR)
After I did all this I am able to use the Captuvo classes in my ViewController.swift file.

Swift Compiler Error - failed to import bridging header

I'm trying to integrate Actor App for iOS. On compiling, I get this error :
I checked the path and the ActorClient-Bridging-Header.h is present there.
I have set the proper path to the header file in Build Settings
And this is the folder structure :
What might be the reason for this compilation error?
EDIT
I tried solving the same as mentioned here : Swift Bridging Header import issue and no luck.
Screenshot of the actual path on my disk :
Just go to your project's Framework Search Path,which I assume would be empty and add the path of your SDK folder there.
For adding the path correctly, you can just drag and drop your SDK folder here,the correct path from root will be added automatically.
Hope this will help!!
Bridging header file should be placed at root folder.

Objective-C cocoapod bridging issue

Followed this to a t:
https://medium.com/#kirualex/cocoapods-with-swift-e6f8ba8f0afc
Can't find these 2 header files though.
Set the bridging file in the settings:
I always meet this kind of problem. I think you can try to check your file&folder hierarchy.
Such as you have a root folder named Project, as is often the case, there is another Project in your previous Project, the root folder.
And Checking the Objective-C Bridging Header in the Build Setting. Sometime error can occurred for Project/Project/Bridging-Header.h. And the error can be corrected by changing the definition as Project/Bridging-Header.h.
If the location of Bridging-Header.h is not matching with the definition in the Build Setting, the error like import file not found will occur.
I just tell your my solution for Bridging issue I already met, I hope it can help you.

Stripe.h file not found

I am trying to use the Stripe SDK in my iOS App but there seems to be a problem. Whenever I try to import it like this:
#import "Stripe.h"
I get the following error:
Stripe.h file not found
But I have the file right here:
Thanks in advance,
Abdullah Shafique
The folders are blue in Xcode, indicating that the folders themselves have been added as resources, rather than the source files within them. You should remove the stripe-ios folder from your project, and re-add it, ensuring that you choose the option to "Make groups for any added folders"; this will ensure each source file is added to your project, rather than the folder being added to your resources.
I can only speculate what the problem is, but I guess the .h file is just in the wrong directory...
So, find a .h file in your project that you CAN import. In which directory is this file?
In which directory is the Stripe.h file? Is it even in a subdirectory of the project root?
In your bridging header file use this statement as it is #import <Stripe/Stripe.h> . If it does not work, clean your project several times, I had the same error and nothing else worked except what I specified above.

XCode header search paths

I am trying to use a third-party library in my ios project called ZXingObjC. I've added the library to my project by dragging the library's .xcodeproj file into my project. When I try to build, I get this error:
Lexical or Preprocessor Issue
'ZXingObjC/ZXAztecDecoder.h' file not found
This is the offending line of code:
#import <ZXingObjC/ZXAztecDecoder.h>
The actual path (on my Mac's filesystem) to the .h file is:
/Users/jalmberg/Documents/ios/projects/ZXingObjC/ZXingObjC/aztec/decoder/ZXAztecDecoder.h
I've added the path to the Header Search Path, using the following:
/Users/jalmberg/Documents/ios/projects/ZXingObjC recursive
I've tried several variations on this search path, but nothing works.
What am I doing wrong?
Your problem looks like your path. If you are using this:
/Users/jalmberg/Documents/ios/projects/ZXingObjC recursive
and the path is:
/Users/jalmberg/Documents/ios/projects/ZXingObjC/ZXingObjC/aztec/decoder/ZXAztecDecoder.h
Then you would could just use
#import <ZXAztecDecoder.h>
Note that it searches based on the relative path you defined in your import. So
#import <ZXingObjC/ZXAztecDecoder.h>
Is looking for a path that has the directory ZXingObjC which contains the file ZXAztecDecoder.h.
Not an answer per-say but have you looked at cocoa pods, makes working with 3rd party libs sooo much easier, made me like developing ios again.
Dead simple to setup
http://cocoapods.org/

Resources