0

My xcode project was working fine. I was working on XML and Json parsing. After some time , I found out that Im getting these errors on all the successful projects.

LaunchOptionsKey' is not a member type of 'UIApplication'

'normal' is unavailable: use [] to construct an empty option set

Is my xcode corrupted?

//AppDelegate 
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        // Override point for customization after application launch.
        return true
    }


//Button Pressed

 @IBAction func buttonPressed(_ sender: Any) {
    let title = (sender as AnyObject).title(for:.normal)
        var plainText : String?
        if title != nil {
            plainText = title! + " button pressed"
        }
        label.text = plainText
        print(plainText ?? "no text available")
    }
Sulthan
  • 128,090
  • 22
  • 218
  • 270
Reena
  • 1
  • 2

1 Answers1

0

Your code looks correct. I'd recommend you to check for your swift version. (as suggested in the comment section) And try to clean the build folder and start Xcode again.

Or, can you try to create an empty project and see if it compiles successfully? This way, we can easily diagnose where the issue is (your Xcode or the specific project).

Sometimes build error arises from changes in the Build Settings properties. Try examine those project properties. Look for the library versions.