Auto Layout & Constraints
Auto Layout, constraints, stack views, priorities, content hugging, compression resistance
1What is Auto Layout in iOS?
What is Auto Layout in iOS?
Відповідь
Auto Layout is a constraint-based system that automatically calculates view positions and sizes based on their dependencies. It enables creating adaptive interfaces without manually managing positions. Auto Layout is essential for supporting multiple screen sizes and orientations.
2What is the role of the translatesAutoresizingMaskIntoConstraints property?
What is the role of the translatesAutoresizingMaskIntoConstraints property?
Відповідь
This property controls whether the autoresizing mask is converted into Auto Layout constraints. By default it is true, which can create conflicts with explicit constraints. When using Auto Layout, setting it to false is required to avoid warnings and conflicts.
3What is the difference between NSLayoutConstraint and NSLayoutAnchor?
What is the difference between NSLayoutConstraint and NSLayoutAnchor?
Відповідь
NSLayoutConstraint is the classic dictionary-based API, more verbose and error-prone. NSLayoutAnchor is a modern, type-safe API using methods to create constraints. NSLayoutAnchor provides better readability and compile-time error detection.
What is the difference between `constraintEqualToAnchor` and `constraintEqualToConstant`?
Why is the `contentHuggingPriority` property important in Auto Layout?
+21 питань зі співбесід
Інші теми співбесід iOS
Swift Basics
Swift Language Essentials
UIKit Fundamentals
UIViewController Lifecycle
UserDefaults & Keychain
Application Lifecycle
UITableView & UICollectionView
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
Опануй iOS для наступної співбесіди
Отримай доступ до всіх питань, flashcards, технічних тестів, вправ code review та симуляторів співбесід.
Почни безкоштовно