I have developed a framework for my customer, thats a swift dyanmic framework. For code modularization i have divided this framework features in to multiple static libraries as shown in the diagram below. Currently we have on main swift dynamnic framework and it contains 2 static libraries too. Also the first static library here in turn nested with another static library, Key points to note here is
My static libraries contains other third party iOS frameworks My static libraries using CoccoaPods as the dependency for Alarmofire at the moment.
Is there any problem in the current architecture , because i heard nested libraries are not supported in iOS . but since we dont have frameworks nested here, all of our second level frameworks are static libraries only. What are link/libary search path guidance we needed to take care to make a successful build.
I don't know whether I'm completely correct, but I've always checked for type metadata accessors for types in the statically linked libraries. If I have more than one type metadata accessor for given type, might have a problem.
Example
Consider following files:
// % cat stat.swift
public struct MyFoo { public init() {} }
// % cat dyn.swift
import stat
public func dyna1foo() -> stat.MyFoo { .init() }
// % cat dyn2.swift
import stat
public func dyna1foo() -> stat.MyFoo { .init() }
// % cat main.swift
import dyn
import dyn2
let a = dyn.dyna1foo()
let b = dyn2.dyna1foo()
print(type(of: a) == type(of: b))
I have a problem, because there are two type metadata accessor for stat.MyFoo.
I might not be correct, tho. I would appreciate if anybody would correct me if I'm mistaken.
Edit:
And sometimes you can get warning, for example if you change MyFoo from struct to class you can get this warning: objc[93532]: Class _TtC4stat5MyFoo is implemented in both /path/libdyn2.dylib (0x1048180d0) and /path/libdyn.dylib (0x1048080d0). One of the two will be used. Which one is undefined.