I created a framework writting on pure swift ,
but I cant find any .h file of public class . shouldn’t Xcode generate .h file automaticly?
here is project structure
- ProjectName
-- ProjectName.h
-- publicClass.swift
the final projectname.framework does not contails the publicClass.h ,neither any "publicClass" string
Xcode Version 13.1 (13A1030d)
I searched the internet but got little about this problem
2
Answers
After practice.
When import your framework in a project, import your framework in
a swift file, long press
command
then click your framework name in the file, Xcode will create a public interface file automatically, and you will see all your public classes functions.Below is not a right answer, please ignore it.
Headers png
In
TARGETS
, select your framework, then inBuild Phases
, there is aHeaders
section, you could put your public swift file underPublic
, then command + B, in your framework folder, headers file, you will see.Swift doesn’t use header files, you only get .swift files. If you want header file you have to use Objective-C.