Xcode won't recognize a new Swift class

前端 未结 5 1393
时光说笑
时光说笑 2021-01-03 22:40

I have created a new Swift class in a new file

import Foundation

class RecordedAudio: NSObject{
    var filePathUrl: NSURL!
    var title: String!
}
         


        
5条回答
  •  礼貌的吻别
    2021-01-03 23:14

    In the Project Navigator on the left, select the file where you declared RecordedAudio.

    Now, in the File inspector on the right, look at the Target Membership. The app target (not the Test target) should be checked, similar to this:

    enter image description here

    If not, check it! And now all will be well.

提交回复
热议问题