Avatar ·

How to call Objective-C code from Swift in an Xcode project?

Hello everyone! I'm a beginner iOS developer writing in Swift, but I've encountered a situation where I need to use an old library written in Objective-C. I have a Swift 5 project. I added several `.m` and `.h` files with Objective-C code to it. For example, there is a class `OldCalculator` with a method `- (NSInteger)addNumber:(NSInteger)a toNumber:(NSInteger)b;`. I want to call this method from my Swift file `ViewController.swift`. I imported the files into the project, but when I try to write `OldCalculator().addNumber(5, toNumber: 10)`, Xcode gives an error: "Use of unresolved identifier 'OldCalculator'". I read that I need to create a bridging header, but I don't fully understand how to set it up correctly. Here's my Swift code (which doesn't work): ```swift import UIKit class Vie