I can't find UIKit.framework anywhere: it's nowhere in my /System/Library/Framework and I can't add it via Build Phase because it's not there to select. I have installed and re-installed xcode and it's not showing up. It doesn't seem to be directly downloadable either. Any ideas?
You should import it into every file that uses UIKit. That should be your View and Controller classes. Model classes should almost never use UIKit. They should generally import Foundation.
Mac Catalyst, also refereed to as "UIKit for Mac", allows you to build [iOS and iPadOD](iOS projects to run natively on the Mac, while still being utilizing the UIKit and other iOS specific APIs and design paradigms. Applications build for this mode can also mix in AppKit and other macOS-specific frameworks.
Is 2022 is the year when you start your iOS journey? It's a great time to start building and learning iOS development. As of right now you still have to learn UIKit and SwiftUI, especially if you want to land a job sooner rather than later.
Starting with iOS 13, Apple is using the new SwiftUI framework. It is gradually replacing UIKit, which was actively used earlier.
If this is indeed meant to be a question for a Mac OS X application instead of an iOS application @Ken Thomases reply is true. If this question is about making an iOS application with Xcode on Mac OS X then it might be possible your project file is a bit broken. I had to deal with this some weeks ago when all of a sudden I could not add an audio framework.
Alternatively you can show the contents of the package of your project file by CTRL-clicking it and selecting Show Package Contents. There are a lot of user based files there, some might be corrupt. Throw these files away and try again. Backup just to be sure.
Your project's settings should look something like this:
Build phases:
It's important that you target iOS and that UIKit and Foundation are there
If they're not, try to create a new project
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With