UITableView & UICollectionView
UITableView, UICollectionView, data sources, delegates, cell reuse, custom cells
1What is the main purpose of the dequeueReusableCell method in UITableView?
What is the main purpose of the dequeueReusableCell method in UITableView?
Risposta
The dequeueReusableCell method retrieves a reusable cell from the recycling pool. This optimizes memory by reusing off-screen cells rather than creating new instances constantly. This is critical for maintaining smooth performance during scrolling.
2Which UITableViewDataSource method returns the number of rows in a given section?
Which UITableViewDataSource method returns the number of rows in a given section?
Risposta
The tableView(_:numberOfRowsInSection:) method from UITableViewDataSource returns the row count for each section. It's called by UITableView to calculate total height and manage cell recycling. This method is mandatory to implement.
3What is the main advantage of using UICollectionViewFlowLayout over a custom layout?
What is the main advantage of using UICollectionViewFlowLayout over a custom layout?
Risposta
UICollectionViewFlowLayout provides a prebuilt optimized grid layout that automatically handles spacing, alignment, and cell wrapping. It avoids implementing complex layout logic and is highly configurable through properties like minimumLineSpacing, itemSize, and sectionInset.
How to combine numberOfSections and numberOfRowsInSection methods for a multi-section structure?
Which protocol provides methods for handling selection events in a UICollectionView?
+22 domande da colloquio
Altri argomenti di colloquio iOS
Swift Basics
Swift Language Essentials
UIKit Fundamentals
UIViewController Lifecycle
UserDefaults & Keychain
Application Lifecycle
Auto Layout & Constraints
SwiftUI Basics
SwiftUI State Management
SwiftUI Navigation
Networking & URLSession
Codable & JSON Parsing
Core Data
Protocol Oriented Programming
MVVM Architecture
Push Notifications
Unit Testing & XCTest
UI Testing
Xcode & Build System
Swift Package Manager
Memory Management & ARC
Combine Framework
Concurrency & async/await
iOS Design Patterns
Performance Optimization
Security & Encryption
SwiftUI Advanced
iOS Application Architecture
Padroneggia iOS per il tuo prossimo colloquio
Accedi a tutte le domande, flashcards, test tecnici, esercizi di code review e simulatori di colloquio.
Inizia gratis