Setting up Parse in iOS - ios

I am having some difficulties setting up the Parse framework in iOS. I have set up all the libraries, linked frameworks etc... The specific issue is that I cannot get the subclasses to autocomplete anything related to parse
I have included the libraries...
I have linked the frameworks in build phases...
I want autocompletion similar to this...
But I get nothing related to the Parse framework!!!!
Sorry if this is a dumb question. I have used parse before doing the same thing, but now its not working. Anyone know whats up?

Well, I finally figured out something that works...
Because parse recently split up their frameworks into multiple frameworks you need to include both Parse.framework and ParseUI.framework. This step I had done correctly. BUT, in addition, you need to import the ParseUI framework in the AppDelegate file to get visibility for auto completion of the ParseUI headers... hopefully this mistake on my part saves someone else a headache
I just did the #import <ParseUI/ParseUI.h>
in my AppDelegate.m file...

Related

Cannot find protocol declaration for *** in my 'MyApp-Swift.h'

I am working on a project that up to now, despite the mess, it was working ok. Today, believe it or not, I have been updating it to Swift 5.
The project has iOS and tvOS targets as well as frameworks, tests, and top selves extensions. The project also was started using Objective-C and over the years has become 90% Swift.
I am not sure at what point something went wrong but, when compiling, I get the following error for all my top self extensions (mostly all tvOS Targets).
I have found similar questions but I can't understand whats going on.
Any ideas?
You are probably missing an import StoreKit in the Swift files that define IAPHelper. Sometimes this gets imported transitively, and Swift doesn't necessarily need it, but the Swift bridging header does.
Ultimately you need to make sure there's an ObjC #import StoreKit; that is evaluated before this line of code.
First, I have to thank Rob for his tips. I wish he could get the points!
After troubleshooting with the tips provided:
Add StoreKit to your linked frameworks list. -> Didn't work
#import StoreKit; before #import <...-Swift.h> -> Showed error use of #import when modules are disabled
I also saw that "...-Swift.h" was only declared in the Build settings of my "...Topself" targets. Still quite unsure why as I would have thought the whole project still have ObjC dependencies... Still quite new to this challenge.
Furthermore, If I unfold the error I could see that there was some kind of error trying to find "...-Swift.h" file.
At this point, I remembered that I am using cocoapods (I don't like you, you don't like me relationship) and I hated to see the warning "...Overrides Enable modules (C - Objective-C)" so I set it to default for the whole project.
Turns out that that for all "...TopSelf" targets, the default value is NO.
By Overriding Enable modules (C - Objective-C) to YES, clean, and build, everything started working again.

iOS: #import AnyModule not found after editing class using cocoapods

I have an Obj-C/Swift project setup that imports modules using cocoapods. In any class where I am importing a framework using the #import function I get the error message SomeModule not found. However, when I build/run it compiles fine, and the framework works and functions as expected.
The problem here is that it messes me up when I'm trying to write code below the error (i.e., objects appear as ints because the error above messes up the compiler; function auto complete doesn't work, etc). What's weird, if I cmd+s to save the class, the error messages go away. Then the second I start typing again, they reappear.
I've gone as far as removing all of my cocoapods and reinstalling them, but to no avail. This has only been an issue since installing xcode 8.
Anyone have any insight into this?
Thanks in advance.
Sorry for super late response - the only way I found to get around this was to use the "old" style of framework import; i.e., ... it seems like some Frameworks just don't play nicely with the #import declaration. #pablo-martinez
If someone has a better solution please feel free to share.

Integrate Stripe SDK in iOS (Swift)

I added Stripe SDK to my iOS app (added PassKit.framework alongside the StripePublishableKey in AppDelegate) via manual installation, but I came across one of two issues when the import statement (tried both #import <Stripe/Stripe.h> and #import "Stripe.h") was added to the bridging header file:
1) With #import <Stripe/Stripe.h>, the bridging header no longer imports, despite having worked before. (I checked Swift Compiler under Build Settings and the file is correct. Plus once I removed elements of Stripe, the problems went away).
2) With #import "Stripe.h", I get errors that indicate that the SDK isn't picked up at all.
(I've checked the SO archive for relevant threads, which pointed to the aforementioned import statements as possible solutions. And, as a Swift learner, I'm not as familiar with implementing Obj-C solutions. I cobbled what I could from Stripe's documentation.)
Is this a Stripe problem? What am I missing in implementation?
This worked for me and hopefully this will be helpful for anyone who finds himself/herself in the same predicament. First, it's #import <Stripe/Stripe.h>. Next, adding turning on Passbook under Capabilities allowed Passkit.framework to be linked to the app (or recognized in the library).

Can't build Swift app including Objective-C Tesseract library

I am trying to utilize the features of Tesseract OCR for an iOS app, and cannot even seem to get it going. I have followed the installation instructions to the tee and have still been unable to get it built correctly.
I have used CocoaPods to integrate Tesseract into my project, and that seems to be working fine, but, I am unsure of exactly what to put into my bridging header. There are over 50 header files in the Tesseract portion of the project, and it doesn't seem like I should need to add each individually into the bridging header.
With copy and pasting the basic code from the instructions into my project, I get a few errors:
1) /Users/kade/Documents/tesseract/tesseract/ViewController.swift:19:30:
Type 'ViewController' does not conform to protocol 'G8TesseractDelegate'
corresponds with this line of code:
tesseract.delegate = self;
2) if I comment this line out, the build succeeds, but then breaks upon execution of the following line:
tesseract.charWhitelist = "01234567890";
I believe this to be a bridging header issue because I have imported a file and fixed a previous error, but I'm not sure which Objective-C header file will include all of them.
Rookie mistake, I just figured it out.
I needed to include: ", G8TesseractDelegate" at the class declaration.
Silly me!
I hope this helps anyone who may be experiencing something similar! :)

Generic implementation of 3rd party Libraries and Frameworks in Swift

I see there’s many libraries, open source, like Cocos2d, ShareKit, FormatterKit, etc. that seems up to date. (Check GitHub).
But still, implementation, snippets, samples and manual are intended to be written in Objective-C.
But, a method is a method… I think… If I get an instance of any framework/library of these and I call the method in a full Swift enviroment, would I be affected behind the scenes?
After June WWDC Swift gonna get serious, Apple is pushing hard, I’m just getting ready for the move and I don’t want my Apps to implement a soon-to-be deprecated library implementation in Objective-C.
I do not understand your question so much that I will regard your question as "Is it possible to use the Objective-C&Swiftin the same project?"
Yes, Apple claimed that developers can use Bridging-Header to implement double languages development, whatever your main developing language is ObjC or Swift. The specific details and theories about it you shall check from there.
Next I want to tell you some errors occurred in my project when I used Bridging-Header.
I always meet this kind of problem like import 'file not found'. 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.

Resources