Home

sizeclass

Size class is a design concept used in user interface development to categorize screen space into a small set of buckets so UIs can adapt across devices and orientations. In iOS, a size class is defined along two axes: horizontal and vertical. Each axis can be compact or regular, forming a size-class pair such as (compact, regular) or (regular, regular). There is also an unspecified or any category used in certain tools to indicate applicability across multiple classes.

Developers access size class information through trait collections as part of a view's environment. At design

Common usage patterns include simplifying navigation for compact width (for example, stacking content or collapsing sidebars)

Limitations: size classes are coarse, and newer layouts may require more granular adjustments. They remain a

time,
Interface
Builder
lets
you
vary
layouts
by
size
class,
while
at
runtime
you
can
query
the
current
trait
collection
and
adjust
constraints,
visibility,
font
sizes,
or
control
layouts
accordingly.
Tools
like
Auto
Layout
and
SwiftUI
encourage
building
interfaces
that
reflow
automatically
when
the
size
class
changes,
rather
than
building
separate
screens
for
each
device.
and
expanding
multi-panel
layouts
in
regular
width.
On
iPhone
in
portrait,
the
horizontal
size
class
is
typically
compact
and
the
vertical
is
regular;
on
iPad,
in
landscape
you
may
see
both
axes
as
regular.
However,
exact
pixel
dimensions
are
not
encoded
by
size
classes,
so
developers
may
need
additional
breakpoints
or
runtime
checks
for
edge
cases.
foundational
tool
for
creating
responsive,
platform-adaptive
interfaces.