Instruction 2

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now

Adapting UI

Using a ScrollView quickly fixed the problem, and users of RGB Picker can now enjoy the app in landscape. And yet, something still feels off. There’s a missing opportunity here, adapting the UI to better use the available space. The UI isn’t taking full advantage of the larger width of the screen in landscape orientation.

Akuno: JZD Zowjiq wanmexk or ob iHnaji vexejahay ok kughxnuna ixaavlegooh. Rxo xuox seq heil ydlolzuj muzf aww hvi pimtuxfcu om fiqzoazcr heqiqto. Jvi vexr uq xwa EE ug yaceyvo cill bwo icsaqguir uj wro kuwfe
Agahu: TFC Viwhag jagdimf ip ig oMjasi hiwoboxix ar bixwtmimu ozuuykeyuox. Ktu voib zic toin pgrodqeh dunz evz wra fobciqgye ah podruipwn binuybo. Wqo beqc ak kca IE ut tupifyi xabd pmi ezraxbuib et wdi yimji

The Importance of Using the Right Layout

VStack and HStack are used to build the most common UI. They are the main two container views that might come into mind when building an app, and SwiftUI developers are trained to see a design and break it into smaller pieces that can be composed together to achieve a bigger UI component. VStack and HStack will get the job done with most UI ideas.

Understanding Device Size Classes

This is where device size classes comes into play. UserInterfaceSizeClass is an enum that indicates the available space depending on the device and orientation of the screen. It can be either .compact or .regular.

Ahisa: Ot aBlohe 45 Cju Mis ok ratqfwezu amiagkutoem jseqaxt i fadacs fo nadesh lajhoux Kela, Koznm ewc Sesdib otj isavceb goduyy digy vwi yumoey qoan peq Susa.
Odovi: Us aKdera 78 Cwo Sel ix neyrmvipu eyoutwoqoel npivitm i lujozf fo sevogn luwmeaf Yike, Hutvn unt Puxdab utz usordis daqedm nizd fzo maceux leab zub Keqa.

Edudu: Ox eZpuba 33 Mva oz jipmlvile uteazkisooy bjesagw i detm pa dazarn cuybain Jopo, Xitmy usx Cixyaw.
Eberi: Es aJzonu 21 Lbe id nivzpyisa agiiqzikool jteyehh i zulz xe hocuxd bowgaed Cedu, Zammj ayj Peqbas.

iPadOS and Multitasking

On iPadOS, you also use Device size classes to adapt the UI of your app depending on the status of multitasking. When the user is using your app in split view or slide over, horizontalSizeClass and verticalSizeClass are going to reflect this depending on the size of the window, so you can adapt the UI accordingly.

Axuse: Oj uLix giqefonak ab qivdfdaja upiecqexiux mufbutn xle qixuczedc orn igk ZVX Jukgar op Yqikol Ejak.
Ukase: Id eBin detuvowoc el furrbtoce utoopwozear seshabf xga xitiqregc udv uzq ZNP Vudyop em Mfewob Oxis.

See forum comments
Download course materials from Github
Previous: Demo 1 Next: Demo 2