Size Classes - SwiftUI - Adopt Landscape Example @seanallen
Size Classes - SwiftUI - Adopt Landscape Example  @seanallen
Uploaded July 2022 | Updated September 2026, 13 hours ago
Size classes help us determine which device our user is on as well as the orientation of that device. In SwiftUI we use environment variables to access size class information and adapt our UI accordingly. In this video, I show an example of how to adjust between landscape and portrait on an iPhone in SwiftUI.

iOS Developer Courses
seanallen.teachable.com/?video=fyhYRkTIzoM

Human Interface Guidelines - Layout - Size Classes (Scroll Down a bit)
developer.apple.com/design/human-interface-guidelines/foundations/layout

Twitter:
Sean Allen - twitter.com/seanallen_dev

iOS Developer Courses
seanallen.teachable.com

Timestamps:
0:00 - What are Size Classes?
0:41 - Device Examples - MAX Exception
1:24 - Size Class Chart - HIG
2:09 - iPad Split View Considerations
2:36 - Code - Access Size Class in SwiftUI
4:11 - iPhone - Determine Landscape
4:29 - Code - Change UI in Landscape
5:08 - Quick Refactor
5:53 - Quick Review & Run App

Hired.com:
hired.com/x/1n01g

Book and learning recommendations that help out the channel if you decide to purchase (Affiliate Links):

Paul Hudson's Hacking With Swift:
gumroad.com/a/762098803

Donny Wals - Combine:
gumroad.com/a/909014131

Mark Moeyken’s SwiftUI Books:
bigmountainstudio.com/swiftui-views-book/fzc51

Objc.io Books (Thinking in SwiftUI & Advanced Swift):
gumroad.com/a/656585843

Ray Wenderlich Books:
store.raywenderlich.com/a/20866/link/1

Links to my iOS Dev Setup & iOS Dev Book Recommendations
amazon.com/shop/seanallen

#swift #softwaredeveloper #iosdeveloper
Size Classes - SwiftUI - Adopt Landscape ExampleXcode Tip - FAST Navigation #iosdeveloper #swift #xcodeClean Swift Code with Where ClauseiOS Dev Happy Hour - The Best Way to NetworkWeb vs In-App Purchase, Liquid Glass, Micro-Interactions, AsyncStream, Dynamic Type, and more.SwiftUI Bottom Sheet - ResizableXcode Tip - #warning & #errorSwift Build Open Source, Secure API Keys, Swift Concurrency, Jr. Devs Cant Code, and more!Apples Human Interface Guidelines 2024 - Updated w/ visionOS2023 App Store Pricing UpdateMy HONEST opinion about UIKit vs SwiftUI in 2023SwiftUI Search Bar - Searchable
Sean Allen |

Size Classes - SwiftUI - Adopt Landscape Example

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER