📱

UIKit

iOS 2+

Apple's original framework for building user interfaces on iOS. UIKit provides the essential infrastructure for iOS apps, including windows, views, view controllers, and user input handling.

UI
Official Apple Documentation →
iOS Version Compatibility
99.8%
coverage

of iOS users worldwide can use UIKit (iOS 2+ required)

iOS VersionMarket ShareStatus
iOS 18.730.3%Supported
iOS 18.629.8%Supported
iOS 26.110.7%Supported
iOS 18.56.0%Supported
iOS 16.72.3%Supported
iOS 26.22.0%Supported
iOS 18.31.8%Supported
iOS 15.81.8%Supported
iOS 11.01.7%Supported
iOS 17.61.7%Supported

Key Features

View and view controller hierarchy

Touch and gesture recognition

Animations and visual effects

Navigation and tab bar controllers

Table and collection views

Auto Layout for responsive designs

Code Examples

Create a View Controller

Basic UIViewController with a label and button

import UIKit

class ViewController: UIViewController {
    let label = UILabel()
    let button = UIButton(type: .system)
    
    override func viewDidLoad() {
        super.viewDidLoad()
        view.backgroundColor = .white
        
        // Configure label
        label.text = "Hello, UIKit!"
        label.font = .systemFont(ofSize: 24, weight: .bold)
        label.translatesAutoresizingMaskIntoConstraints = false
        view.addSubview(label)
        
        // Configure button
        button.setTitle("Tap Me", for: .normal)
        button.addTarget(self, action: #selector(buttonTapped), for: .touchUpInside)
        button.translatesAutoresizingMaskIntoConstraints = false
        view.addSubview(button)
        
        // Layout constraints
        NSLayoutConstraint.activate([
            label.centerXAnchor.constraint(equalTo: view.centerXAnchor),
            label.centerYAnchor.constraint(equalTo: view.centerYAnchor, constant: -50),
            
            button.centerXAnchor.constraint(equalTo: view.centerXAnchor),
            button.topAnchor.constraint(equalTo: label.bottomAnchor, constant: 20)
        ])
    }
    
    @objc func buttonTapped() {
        label.text = "Button Tapped!"
    }
}

Table View with Custom Cells

Display a list of items using UITableView

import UIKit

class TableViewController: UITableViewController {
    let items = ["Item 1", "Item 2", "Item 3", "Item 4", "Item 5"]
    
    override func viewDidLoad() {
        super.viewDidLoad()
        tableView.register(UITableViewCell.self, forCellReuseIdentifier: "cell")
    }
    
    override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return items.count
    }
    
    override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath)
        cell.textLabel?.text = items[indexPath.row]
        return cell
    }
    
    override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        tableView.deselectRow(at: indexPath, animated: true)
        print("Selected: \(items[indexPath.row])")
    }
}

Animations

Animate view properties with UIView.animate

import UIKit

func animateView(_ view: UIView) {
    // Fade in animation
    view.alpha = 0
    UIView.animate(withDuration: 0.5) {
        view.alpha = 1
    }
    
    // Spring animation
    UIView.animate(
        withDuration: 0.6,
        delay: 0,
        usingSpringWithDamping: 0.5,
        initialSpringVelocity: 0.5,
        options: [],
        animations: {
            view.transform = CGAffineTransform(scaleX: 1.2, y: 1.2)
        },
        completion: { _ in
            view.transform = .identity
        }
    )
}

Frequently Asked Questions

What is UIKit?

Apple's original framework for building user interfaces on iOS. UIKit provides the essential infrastructure for iOS apps, including windows, views, view controllers, and user input handling.

Which iOS versions support UIKit?

UIKit is available on iOS 2 and later. Currently, 99.8% of iOS users worldwide can use this framework.

What are alternatives to UIKit?

Related frameworks include Swiftui, Foundation. Each has different capabilities and iOS version requirements.