Skip to main content

Menu

LEVEL 0
0/5 XP
HomeAboutTopicsPricingMy VaultStatsPractice TestsCertifications

Categories

🎓 Certifications
🤖 Artificial Intelligence
☁️ Cloud and Infrastructure
💾 Data and Databases
💼 Professional Skills
🎯 Programming and Development
🔒 Security and Networking
📚 Specialized Topics
CheatGrid
HomeAboutTopicsPricingMy VaultStatsPractice TestsCertifications
LVLEVEL 0
0/5 XP
GitHub
© 2026 CheatGrid™. All rights reserved.
Privacy PolicyTerms of UseAboutContact

UIKit Cheat Sheet

UIKit Cheat Sheet

Back to Mobile Development
Updated 2026-05-25
Next Topic: Xcode Cheat Sheet

UIKit is Apple's foundational framework for building user interfaces in iOS, iPadOS, tvOS, and watchOS applications. It provides the window and view architecture needed to display content on screen, the infrastructure to handle user interactions through touch and gestures, and the tools to manage your app's data and content flow. Understanding UIKit is essential even in the SwiftUI era — many production apps combine both frameworks, and iOS 26 deepened that integration further with automatic @Observable tracking in layout methods and a new updateProperties() lifecycle phase. UIKit's view controller lifecycle, Auto Layout system, compositional collection views, and diffable data sources remain the standard for complex, high-performance interfaces.

What This Cheat Sheet Covers

This topic spans 33 focused tables and 296 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.

Table 1: View Hierarchy and Core View ClassesTable 2: UIViewController LifecycleTable 3: Auto Layout — Constraint CreationTable 4: Auto Layout — Properties and GuidesTable 5: UITableView BasicsTable 6: UITableViewCell ConfigurationTable 7: UICollectionView LayoutsTable 8: Diffable Data SourcesTable 9: UINavigationControllerTable 10: View Controller Presentation and Modal StylesTable 11: UITabBarControllerTable 12: Gesture Recognizers — Basic GesturesTable 13: Gesture Recognizer PropertiesTable 14: UIView Animation — Basic MethodsTable 15: Animation Properties and OptionsTable 16: UIViewPropertyAnimatorTable 17: View Controller TransitionsTable 18: Common UI ControlsTable 19: Context Menus and ActionsTable 20: Text Input ControlsTable 21: UIScrollViewTable 22: CALayer BasicsTable 23: Drawing and Custom ShapesTable 24: Layout Update MethodsTable 25: UIFont and Dynamic TypeTable 26: Size Classes and Trait CollectionsTable 27: UIAppearance and StylingTable 28: Responder ChainTable 29: View Controller ContainmentTable 30: Alert Controllers and Action SheetsTable 31: Additional View ControllersTable 32: Additional UI ComponentsTable 33: UIWindow and Scenes

Table 1: View Hierarchy and Core View Classes

The UIView is the atomic unit of every UIKit interface; every visible element is a subview sitting inside a tree rooted at a UIWindow. Understanding how views are added, layered, and positioned in this hierarchy is the prerequisite for everything else in UIKit.

ClassExampleDescription
UIView
let view = UIView(frame: CGRect(x: 0, y: 0, width: 100, height: 100))
view.backgroundColor = .red
• The fundamental building block for all visual elements
• manages a rectangular area on screen and handles drawing and touch events
addSubview
parentView.addSubview(childView)
• Adds a view as a subview to another view's hierarchy
• child appears on top of the parent
removeFromSuperview
childView.removeFromSuperview()
• Removes a view from its parent's subview hierarchy
• automatically releases strong references
UILabel
let label = UILabel()
label.text = "Hello"
• Displays one or more lines of read-only text
• supports attributed strings and custom fonts
UIImageView
let imageView = UIImageView(image: UIImage(named: "photo"))
Displays a single image or animates a sequence of images
UIStackView
let stack = UIStackView(arrangedSubviews: [view1, view2])
stack.axis = .vertical
• Arranges views in horizontal or vertical layouts without manual constraints
• automatically manages spacing and alignment
frame
view.frame = CGRect(x: 50, y: 100, width: 200, height: 150)
• Position and size in the parent's coordinate system
• avoid setting when using Auto Layout
bounds
let size = view.bounds.size
• Position and size in the view's own coordinate system
• origin typically (0, 0)

More in Mobile Development

  • SwiftUI Cheat Sheet
  • Xcode Cheat Sheet
  • .NET MAUI Cross-Platform Framework Cheat Sheet
  • Cross-Platform Mobile UI Component Libraries Cheat Sheet
  • Jetpack Compose Cheat Sheet
  • Mobile App Navigation Patterns Cheat Sheet_v1_references
View all 40 topics in Mobile Development