Better Programming

Advice for programmers.

Follow publication

Member-only story

SwiftUI Materials Tutorial: Build a Glassmorphism Login Screen

Sarah
Better Programming
Published in
4 min readSep 20, 2021
Glassmorphism UI. Art provided by JuiceBox

In iOS 15, we have materials for the background and foreground style modifiers in SwiftUI.

Materials work by blurring the views behind them while keeping the edges sharp (not blurred). This creates a glass-like effect that we see in iOS notifications, macOS dock and menu bar background, and other places.

iOS notification’s glassmorphic design.

To obtain the glass-like look, we can solely use the materials provided to us in iOS 15. We have 5 materials that we can use; ultraThinMaterial, thinMaterial, regularMaterial, thickMaterial, and ultraThickMaterial.

Materials with Background and ForegroundStyle in light and dark modes

In this article, we will go show how to achieve flat, convex/protruding, and concave glass views. We are going to use a sign-up view with a colorful background provided by an artist juicebox to show the glassmorphic UI design in SwiftUI.

Flat Glass

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Write a response