Hello,
I am trying to create and use a static library. All code is Swift only. I have two projects:
1)
A simple library project "Component2" from the "Cocoa Touch Static Library" template. It has one swift file in it:
public class RoundButton: UIButton { ... }
It compiles correctly into this file structure:
Debug-iphoneos
+- Component2.swiftmodule
+- libComponent2.a
2)
A simple iOS app project where I want to use "RoundButton" in a view controller. If I manually write
import Component2
...
let c = RoundButton()
it compiles and runs fine, but I cannot get "import Comp" to auto-complete. In Interface Builder, the custom class/module fields do not complete to RoundButton or Component2 either. Interestingly, the RoundButton(...) constructor does complete and I can option click it to see the definition. But the missing interface builder usage hinders me from creating @IBDesignables. Also, we want to create a larger library hierachy for multiple teams working together and this seems unintuitive since you have to "know" the import name.
What am I doing wrong? It clearly does compile but xcode seems unable to identify my static library. I tried using Xcode 10.1 and 10.2 and with Swift 4 and Swift 5. Of course I have cleaned out all derived data and restarted Xcode. In the app project I set my paths correctly or else it would not build or run.
Any help appreciated
Andreas Pardeike