I am building an objective C framework that uses swift for a UI screen. I can not access an objective c header from my SwiftUI View file.
MyApi.h
#ifndef MyApi_h
#define MyApi_h
#import <UIKit/UIKit.h>
@interface MyApi : NSObject
- (NSDictionary *)getProfile;
#endif
ProfileView.swift
import SwiftUI
@available(iOS 13.0.0, *)
struct ProfileView: View {
var body: some View {
var instanceOfMyApi = MyApi()
var myJson = MyApi.getProfile()
Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/)
}
}
struct ProfileView_Previews: PreviewProvider {
static var previews: some View {
ProfileView()
}
}
MyApi.h is public of course.
I keep getting error: Cannot find 'MyApi' in scope.
I can not use a bridging header as it is a framework.
Any thoughts?