CocoaPods 'auto property synthesis' error in installed library - ios

The project I am working in is a Swift project. I needed to import a Objective C library and installation was only available (advertised) through 'CocoaPods'. I proceeded and installed the required library and built a bridging header.
Now for some reason I have a single random error deep in one of the files in the library. I'm 99% sure this is a problem with my set up as I can't find anyone else using Braintree (a rather popular payment service by PayPal) with the same problem.
Any ideas?

This looks like a consequence of overriding NSObject's description whose definition changed in iOS 8. (See http://www.redwindsoftware.com/blog/post/2014/08/20/NSObject-has-some-new-properties-in-iOS-8.aspx). Is there a more recent release of this library available for you to use?

Related

How to compile `.framework` file?

I searched through existing Stackoverflow questions related to this problem but didn't find any help to solve it.
So here's the problem:
I am trying to integrate .framework file into the project but it's giving me an error saying that module compiles with 4.0.3 can't be imported by swift 5.0 compiler.
I wanted to know how to compile that.framework file? so that it will become compilable to swift 5.0
Please help if you come across such a problem.
Note: .framework file is created by a third-party developer
If the framework you're trying to integrate is binary only, then your best option is to check with the 3rd party developer regarding their support for Swift 5.0.
In case there are sources available, you can try checking if there is any work being done in their repository (usually a separate branch), or you can try forking the sources yourself.
Note that with the source option, you'll have access to possibly unstable and untested code, and depending on the experience I'd be very careful in this case.

Using a modified PDFTron Tools Framework

I'm working on a iOS Framework (using CocoaPods) that, as of today, uses PDFNet.framework as its only dependency.
Everything works as expected when I use the resulting framework in another "top level" project.
Now I'm trying to make this same Framework use the Tools.framework, as I intend to use the annotations from the Tools library.
Is there a common approach in doing so?
I've tried building the Tools source code but it fails as the dependency isn't found.
Everything you need should be in the following guide.
https://blog.pdftron.com/2016/11/14/getting-started-with-pdfnet-for-ios/
If that guide does not help, then please answer my comment above.

How to create framework with other frameworks and library dependency?

I know, there are so many same questions but I didn't get answer for my requirement.
First time I am creating framework. I have created test framework using Raywenderlich example. But my requirement is little bit different. I used so many different frameworks and also used SQLCipher in my project. Now, I want to convert this project into framework. I followed all the steps but the problem is occur when I am trying to build. Getting an error for SQLCypher because I didn’t add to my framework to avoid conflicts. Finally, I have added SQLCypher library to create build without error and it worked but now I am getting linker error when I am using that framework to test in testProject. I didn’t find any example with third parties. Please help me to solve this issue.
I had the same issue.
One solution is to change all method names of other frameworks or libs, but some lib is not open source.
Another solution is work for me which is to use cocoapods. But the user
who wants to use your framework will be forced using cocoapods, depending iOS 8.0 or above, depending the same version of 3rd libs. I have nothing to do with this restriction.
Seems the best way is do not depend 3rd libs in a framework.

Using CommonCrypto in Swift generates not safe for use in extensions warning

I've created a simple lib to use HMAC digest for Swift called "SweetHMAC". This lib is so simple, basically is a wrapper to CommonHMAC.h in Swift.
I can build and deploy any iOS project using SweetHMAC correctly but, seems by some security issue, my approach is not safe. There is the warning I receive after run the iOS tests for example.
warning: linking against dylib not safe for use in application extensions
This code is not safe enough to put in iOS AppStore, and the app can be rejected by that. For OSX, there is no problems.
I know, there are HMAC ports for Swift, but my challenge is to try to enable Swift to use CommonCrypto safely.
I have implemented this project using this approach and works fine!
My question is, how possible is to create and use use modules like CommonCrypto in Swift frameworks safely for iOS?
Looking at the documentation from Apple, the suggestion for said error is to make sure that the option of using "Require Only App-Extension-Safe API" is checked.
To configure an app extension target to use an embedded framework, set the target’s “Require Only App-Extension-Safe API” build setting to Yes. If you don’t, Xcode reminds you to do so by displaying the warning “linking against dylib not safe for use in application extensions”.
Here's the full documentation on extensions
It is also worth noting that parts of the CommonCrypto API might not be available, as per this discussion

Whirlyglobe private API complain during app submission

I have a simple app which uses whirlyglobe framework (2.2). Otherwise, it is pretty basic program with Apple frameworks.
When I tried to validate the app (and during the distribution, Xcode complains that my app is using private API; specifically it calls "rootElement", and "attributeForFont:". I suspect these functions are part of WhilyGlobe component distribution.
What is the easiest way to remove those files from the framework? Do I need to have the source and compile the framework myself? Or is there a simpler way?
Solved. Here is what I did:
1) Searched in github repository of WhirlyGlobe and found the file that uses the functions which caused issue.
2) I did not need the functionality provided by the file that had the functions.
3) Removed the references (class instantiation) to the file from my project.
That's actually part of the KissXML framework and the implementation is in there. I suspect Apple's test is in error.
In any case, if you're not using the WMS functionality, you can probably drop it out just fine.

Resources