1

I have a project based on Objective-C. I have created bridging headers for Swift and can successfully call Objective-C files there. However I can not import AppDelegate.h in the new Swift file. Here what I try:

import Foundation
import UIKit
#import "AppDelegate.h";

it returns error:

Expected identifier in import declaration

How to import that?

Cœur
  • 37,241
  • 25
  • 195
  • 267
birdcage
  • 2,638
  • 4
  • 35
  • 58
  • 2
    Did you check [How do I call Objective-C code from Swift?](https://stackoverflow.com/q/24002369/1187415) – Martin R Jan 23 '20 at 16:08

1 Answers1

0

You don't need to import any Obj-C files/headers in Swift. All Swift types will be able to see all Obj-C files that were added to the bridging header.

Dávid Pásztor
  • 51,403
  • 9
  • 85
  • 116