Using a modified PDFTron Tools Framework - ios

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.

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.

Basic Mechanics of iOS Frameworks and Xcode (and Swift)

I think I just must be stupid.
I'm having a lot trouble understanding very basic things concerning frameworks in Xcode/iOs/Swift. While I've certainly gotten some things to work, I've gotten more and more confused about what I'm actually doing. And the documentation on the web just confuses me more.
When I see discussions about how to import particular frameworks (e.g. https://github.com/danielgindi/Charts is the library I'm playing with, but I've seen this pattern repeated in other libraries) they seem to always tell me include the Xcode project file as a child project of my project, in addition to linking things as an embedded binary. This confuses me. Is it not possible to link an already compiled framework to my project without including all the source code of the project?
That is, can't I just take a library.framework file, and add it to my embedded libraries list and be done with it?
In the frameworks I've played with (again https://github.com/danielgindi/Charts is my primary example, but this is true in many others I've played with) I can't seem to use the framework without Carthage or CocoaPods. For me at this stage, that is just confusing... I accept that they are useful tools to automate a difficult process, but I'd really like to understand what that process actually is before I let a tool automate it for me. As I search the web I just seem to always be led back to these tools as being the correct way to do things.
So here are my questions.
If I find a framework library on the web... do I need its source code or can I somehow just link to a compiled version of the framework?
In my reading, it seems that libraries made with Swift are somehow second-class citizens because Swift is a newer thing. Is that still the case? (The articles I read about this seems to date from 2014-2015).
Is there are good place to understand how Apple expects me to add a framework to a project, without using CocoaPods or Carthage?
No need to add source code. Just add the framework to Target ->
General -> Linked Framework and Libraries -> Tap on + and select
your framework.
In my opinion, many new libraries are being written is Swift. So you won't be left behind for using swift.
Apple has documentation about adding frameworks to XCode. But I would suggest to use Cocoapods , as its easy to manage libraries.
Cheers :)

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.

Pure swift framework without giving the source code/xcodeproject

I have been following framework making tutorials for building my frameworks and one thing I noticed that after building the framework, the example states to use the .Xcodeproject along with other codes needs to be referenced to the example project to use the framework, that should not happen, if so happened, what is the need of the framework as there will be no security of the code?
can anyone throw some light on this to resolve the doubt?

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