Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIKit is nowhere to be found?

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?

like image 694
thesublimeobject Avatar asked Jun 06 '14 22:06

thesublimeobject


People also ask

Do I need to import UIKit?

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.

Is UIKit available for macOS?

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.

Should I learn UIKit 2022?

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.

Does SwiftUI replace UIKit?

Starting with iOS 13, Apple is using the new SwiftUI framework. It is gradually replacing UIKit, which was actively used earlier.


1 Answers

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.

  • Open Xcode but close all windows so no projects are open
  • Press CMD-SHIFT-2 to go to the Organizer
  • Go to Projects
  • Select your project
  • Press on the Delete button on the line of Derived Data
  • Restart Xcode
  • Open your project
  • Wait until your project has been analyzed

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: enter image description here

Build phases:

enter image description here

It's important that you target iOS and that UIKit and Foundation are there

If they're not, try to create a new project

like image 114
Lucas van Dongen Avatar answered Oct 11 '22 13:10

Lucas van Dongen