All questions
of 39What is the difference between UIView and UIViewController?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
UIView is the fundamental building block for all visual elements in iOS. It represents a rectangular area on the screen and handles drawing and user interaction within that area. Views can contain other views (subviews) and form a view hierarchy.
UIViewController manages a collection of views and coordinates the logic between the model and view layers. It handles view lifecycle events, user interactions, and navigation between different screens.
// UIView - represents visual element
let myView = UIView(frame: CGRect(x: 0, y: 0, width: 100, height: 100))
myView.backgroundColor = .blue
// UIViewController - manages views and logic
class MyViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
view.addSubview(myView)
}
}
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
The model's verdict: “”
The interactive diagram is below the answer - jump to diagram ↓
This answer is explained by a shared concept diagram - open →
Explain the view hierarchy in UiKit.
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
The view hierarchy is a tree-like structure where views contain other views as subviews. Each view has a superview (parent) and can have multiple subviews (children). The root view is typically managed by a view controller.
Key characteristics:
- Child views are drawn on top of their parent views
- Coordinate systems are relative to the superview
- Events bubble up through the hierarchy
- Views inherit certain properties from their superviews
let parentView = UIView()
let childView1 = UIView()
let childView2 = UIView()
parentView.addSubview(childView1)
parentView.addSubview(childView2)
// childView2 will be drawn on top of childView1
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
The model's verdict: “”
The interactive diagram is below the answer - jump to diagram ↓
This answer is explained by a shared concept diagram - open →
What are the main properties of UIView?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
Key UIView properties include:
- frame: Position and size in superview's coordinate system
- bounds: Internal coordinate system (always origin at 0,0)
- center: Center point in superview coordinates
- backgroundColor: Background color of the view
- alpha: Transparency level (0.0 to 1.0)
- isHidden: Visibility state
- tag: Integer identifier for finding views
- superview: Parent view reference
- subviews: Array of child views
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
The model's verdict: “”
The interactive diagram is below the answer - jump to diagram ↓
This answer is explained by a shared concept diagram - open →
What is Auto Layout and why is it important?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
Auto Layout is a constraint-based layout system that automatically calculates the size and position of views based on rules (constraints) you define. It's important because:
- Responsive Design: Adapts to different screen sizes and orientations
- Dynamic Content: Handles varying content sizes automatically
- Internationalization: Supports different languages and text directions
- Accessibility: Works with Dynamic Type and accessibility features
Auto Layout uses mathematical relationships between views instead of fixed frames, making UIs flexible and maintainable.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
The model's verdict: “”
The interactive diagram is below the answer - jump to diagram ↓
This answer is explained by a shared concept diagram - open →
Explain the difference between UITableView and UICollectionView.
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
UITableView displays data in a single column of rows. It's optimized for vertical scrolling and is ideal for lists, settings screens, and hierarchical data.
UICollectionView displays data in a customizable grid layout. It supports multiple columns, horizontal scrolling, and complex layouts like grids, carousels, or custom arrangements.
Key differences:
- TableView: Single column, vertical scrolling, simpler implementation
- CollectionView: Multiple columns, any scroll direction, more flexible but complex
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
The model's verdict: “”
The interactive diagram is below the answer - jump to diagram ↓
This answer is explained by a shared concept diagram - open →
What is UINavigationController and how does it work?
What is the difference between frame and bounds?
Describe the view controller lifecycle methods and their purposes.
When would you use viewWillAppear vs viewDidLoad?
What is the purpose of loadView() and when should you override it?
What are the different types of constraints in Auto Layout?
What is content hugging and compression resistance priority?
How do you resolve Auto Layout conflicts?
What is intrinsic content size?
What is cell reuse and why is it important?
How do you implement a custom table view cell?
What are the required and optional methods of UITableViewDataSource?
How do you implement swipe actions in a table view?
How do you pass data between view controllers?
What is the difference between modal presentation and navigation?
What are the different modal presentation styles?
What are gesture recognizers and how do you use them?
How do you handle multiple gesture recognizers on the same view?
How do you create basic animations in UiKit?
What properties can be animated with UIView animations?
How do you create a custom view with custom drawing?
When should you use drawRect vs adding subviews?
What are the pros and cons of Interface Builder vs programmatic UI?
How do you create UI elements programmatically?
How do you handle memory warnings in view controllers?
How do you implement Dark Mode support in UiKit?
What is the responder chain and how does touch handling work?
What is the difference between UIView animations and Core Animation?
How does memory management work with view controllers and strong reference cycles?
What are some best practices for UiKit performance optimization?
What are size classes and how do you use them for adaptive layouts?
What is UIKit Dynamics and when would you use it?
How do you implement accessibility in UiKit applications?
What are some common UiKit design patterns and when to use them?
This answer is part of Pro.
The full written answer, with the trade-offs and follow-ups an interviewer will probe.
No matches
Try a different filter or search term.
34 of 39 UIKit answers are gated.
Full answers, code samples, AI explanations - simpler, deeper, or as an interactive diagram. Cancel anytime.
- Full answers + code
- AI explain - simpler, deeper, or visualized
- 1,000 AI credits / month
- Cancel anytime
Change topic
Pick a different technology or stack. Your current topic stays put until you choose a new one.
MEAN
MongoDB, Express, Angular, Node.jsMERN
MongoDB, Express, React, Node.jsLAMP
Linux, Apache, MySQL, PHPRuby on Rails
Convention over ConfigurationJAM
JavaScript, APIs, and MarkupServerless on AWS
Serverless Architecture on AWSInterviewers also test these - they're common to every stack, whichever one you picked above.
Flutter Mobile
Flutter Cross-Platform Mobile DevelopmentInterviewers also test these - they're common to every stack, whichever one you picked above.
Spring Boot
Enterprise Java Development.NET
Microsoft EcosystemVue
Vue.js, Vite, TypeScript, Tailwind, Node.jsGo Backend
Golang, gRPC, PostgreSQL, Redis, RabbitMQFastAPI
Python, FastAPI, SQLAlchemy, PostgreSQLReact Native
React, TypeScript, Redux, FirebaseiOS Native
Swift, SwiftUI, UIKit, FirebaseAndroid Native
Java, Jetpack Compose, FirebaseWeb3 / Ethereum
Solidity, Ethereum, Hardhat, FoundryDevOps / Platform
Docker, Kubernetes, Terraform, CI/CDCore SWE Interview Prep
Data structures, algorithms, OS, concurrency, networking, gitInterviewers also test these - they're common to every stack, whichever one you picked above.
Interviewers also test these - they're common to every stack, whichever one you picked above.