I am trying to make an ios app with a dylib as framework instead of the standard .framework or .xcframework structure.
Does the app store review work with such a shared library structure.
I see from here that it might not be supported.
https://developer.apple.com/library/archive/technotes/tn2435/_index.html#//apple_ref/doc/uid/DTS40017543-CH1-TROUBLESHOOTING-BUNDLE_ERRORS
https://developer.apple.com/forums/thread/125796
Has anyone tried an app with a dylib inside ? Or it has to be packaged as framework instead ?
From your first link:
Dynamic libraries outside of a framework bundle, which typically have
the file extension .dylib, are not supported on iOS, watchOS, or tvOS,
except for the system Swift libraries provided by Xcode.
That seems unambiguous in saying that you can't include a dynamic library outside a framework.
Related
In an iOS application that depends on ffmpeg, I'm faced with the issue that the App Store does not accept dylibs that are embedded directly in the app bundle. This technical note says
Dynamic libraries outside of a framework bundle, which typically have the file extension .dylib, are not supported on iOS, watchOS, or tvOS, except for the system Swift libraries provided by Xcode
But it's not obvious to me, does this mean that in the case of ffmpeg, I would need one framework per dylib, or am I allowed to package all ffmpeg dylibs into a single framework and use that in my app bundle?
I want to create a precompiled library to avoid distributing some proprietary source code. I followed a tutorial here:
https://medium.com/#paulsoham/how-to-make-universal-static-library-a-file-in-ios-using-xcode-42b4b5757075
This works partially, but the problem is that I'm not able to use Lipo to add both the Mac/x86 and iOS Simulator/x86 binaries to the output file. If I add the Simulator binary, then using the library in a Mac app fails. So my question is, what is the correct way to do this?
I also read somewhere that you cannot submit apps using libraries created in this manner to the App Store. Is this true?
To begin: I read the other questions here, but they are stating that e.g. Swift cannot be used in a Framework or/and Library or are outdated (5 years old).
What are the advantages and downsides of a Cocoa Touch Framework vs. a Cocoa Touch Static Library for achieving this?
I´m trying to share code between two iOS targets, e.g. an iPhone target and an iPad target (Universal target is not wanted here).
If I understand it correctly, the Static Library and the app code will be merged together into one Binary, while the combination of Framework and app code will be two binaries. I guess this means more signing and more DSYM files to upload to crash reporting tools?
Also, a Framework should/could also work standalone while a Static Library always needs other code.
What about Tests, Distribution to the App Store, Debugging (Breakpoints) and compile time? Which option performs better for what task?
Some clarifications of Static vs Dynamic Frameworks: iOS Static vs Dynamic frameworks clarifications
Language: As for the use of Swift, before you couldn't create a Static Library with it, but from Xcode 9 onwards you can. So I guess Swift vs. ObjC wouldn't be a problem. Haven't found any tutorials on creating Static Libraries with Swift, just for creating Frameworks (for example: https://www.raywenderlich.com/5109-creating-a-framework-for-ios). So maybe a Framework would be easier in terms of finding resources/references.
dSYM: Citing an answer from an Apple Staff: "If you are building the framework as a dependency of your app target, the dSYMs for the framework will be present in the archive you create when archiving the app for distribution. If you are using a framework provided by a vendor that is already compiled, you will need to contact the framework vendor about the dSYMs." (https://forums.developer.apple.com/thread/70716). As for Static Libraries, they would be less work in terms of the dSYMs you handle. (Why does not Xcode generate dSYM for static library)
Codesigning for Frameworks: "Developer is free to distribute iOS framework without codesigning it as Consumer will re-codesign it anyway, but Developer is forced by Xcode to codesign their framework when they build for iOS device" (Creating iOS/OSX Frameworks: is it necessary to codesign them before distributing to other developers?)
As for Tests, adding the Framework or the Static Library on your Unit Testing target's build phases should do the job.
Breakpoints:
Static Libraries: Debugging a static library in Xcode
Frameworks: Xcode 9 - Framework breakpoints
For what I've read in the links, although Static Libraries might be a little more efficient, Frameworks are a lot less work to set up.
I have very simple requirement for my iOS SDK
-Support iOS 7 and above.
-Include some swift code to my SDK
Problems:
-With iOS 8, Xcode allowed us to develop cocoa touch frameworks, but they can only be run on iOS 8 and above.
-If I create a static library, I cannot include swift code.
-I was using using Real Framework, but Real Framework does not get installed with Xcode 7.
So, What does a poor developer do ?
You can always have an alternative distribution method for your SDK for users that are targeting iOS 7.
You can offer an SDK in a single concatenated file, that is simply merging all your project source files, which user can drop into project tree and compile together with all the other source files. This applies only when you have either Swift-only or Objective-C only SDK
If SDK user uses workspaces, he may embed your SDKs .xcodeproj directly in his project
Anyway both methods require source code distribution as the user needs to compile the code from within his project. Dependency maintenance is also more difficult.
For a reference you can check how it is done in:
https://github.com/SwiftyJSON/SwiftyJSON
It is a Swift library, but integration with iOS 7 based projects is the same.
I could not find any solution for this. I compromised:
I am NOT using swift code.
I am distributing static library (.a file and a .h header file) instead of a framework. (this is to support iOS 7)
I have a proprietary, dynamic iOS framework targeting iOS 8.0 above and using Swift. I want to distribute this in a precompiled form.
I tried building for release, copying over the framework to another project and adding it under the Embedded Frameworks section. However, I get the following error:
ld: framework not found MyFramework
If I remove my framework from the Linked Frameworks and Libraries section, my app compiles, but I cannot use the framework in my code.
How can I solve my problem?