UIKit

The framework that has powered iPhone and iPad apps since day one.

Introduced
2008
iPhone SDK
Kind
Framework
Runs on
Get it from
iOS
2.0+
iPadOS
2.0+
Mac Catalyst
13.0+
macOS
tvOS
9.0+
visionOS
1.0+
watchOS
2.0+
Works in Swift Playground ›

Overview

UIKit gives you view controllers, views, gestures and the event loop that drive every iOS and iPadOS app. It's imperative: you create objects and change them as things happen.

It's still fully supported, and it works side by side with SwiftUI, so you can use whichever fits each screen.

UIViewController

The unit of every screen: lifecycle, presentation and containment.

Auto Layout

Constraints that adapt your layout to any size, orientation and text size.

Collection views

Compositional layouts and diffable data sources for any list or grid.

UIHostingController

Drop a SwiftUI view into a UIKit app, one screen at a time.

WelcomeViewController.swift
import UIKit class WelcomeViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() let label = UILabel() label.text = "Hello, UIKit" label.font = .preferredFont(forTextStyle: .largeTitle) label.translatesAutoresizingMaskIntoConstraints = false view.addSubview(label) NSLayoutConstraint.activate([ label.centerXAnchor.constraint(equalTo: view.centerXAnchor), label.centerYAnchor.constraint(equalTo: view.centerYAnchor) ]) } }

History

How it grew up.

2008

Introduced

The iPhone SDK opens iPhone to third-party apps.

2012

Auto Layout

Constraint-based layout comes to iOS 6.

2014

Size classes

Adaptive layout for every screen size in iOS 8.

2019

Multiple windows

Scenes let iPad apps open more than one window.

2019

Mac Catalyst

iPad apps built with UIKit can run natively on the Mac.

2025

Liquid Glass

UIKit apps adopt the new system design in iOS 26.

Watch and learn