<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/building-adaptive-non-modal-panels-in-swiftui-92svaraut" -->

---
title: Building adaptive non-modal panels in SwiftUI | daily.dev
description: A deep dive into building a custom non-modal panel API in SwiftUI for a walking app (Strolly) that needed to support both portrait and landscape orientations....
canonical: https://daily.dev/posts/building-adaptive-non-modal-panels-in-swiftui-92svaraut
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Building adaptive non-modal panels in SwiftUI | daily.dev
og:description: A deep dive into building a custom non-modal panel API in SwiftUI for a walking app (Strolly) that needed to support both portrait and landscape orientations....
og:url: https://daily.dev/posts/building-adaptive-non-modal-panels-in-swiftui-92svaraut
og:image: https://api.daily.dev/og/posts/92Svaraut.png
og:image:alt: Building adaptive non-modal panels in SwiftUI
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Building adaptive non-modal panels in SwiftUI

**[Nil Coalescing](https://daily.dev/sources/nilcoalescing)** · 8 min read · 0 upvotes · 0 comments

## Summary

A deep dive into building a custom non-modal panel API in SwiftUI for a walking app (Strolly) that needed to support both portrait and landscape orientations. The system sheet API loses its non-modal behavior on iPhone landscape rotation, so the authors built an overlay-based solution using a custom Layout, SwiftUI preferences, and environment values. The panel supports detents (adaptive, medium, large, fraction, height), adapts its presentation from a bottom-attached panel in portrait to an edge-aligned panel in landscape based on measured scene width rather than size class, and handles drag gestures with a layout cache to prevent size jumps during interaction. Key design decisions include using onGeometryChange at the WindowGroup root for a single source of truth, freezing the layout cache during drags, and keeping the API surface close to SwiftUI's native sheet API for future migration.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://nilcoalescing.com/blog/BuildingAdaptiveNonModalPanelsInSwiftUI>

## Similar posts on daily.dev

- [Presenting SwiftUI sheets on iPhone Duo](https://daily.dev/posts/presenting-swiftui-sheets-on-iphone-duo-py7zqu9ke) · Nil Coalescing · 0 upvotes · 0 comments
- [Building a Production-Grade Adaptive Layout System in Kotlin Multiplatform — From Phone to Foldable](https://daily.dev/posts/building-a-production-grade-adaptive-layout-system-in-kotlin-multiplatform-from-phone-to-foldable-ngxlniy3b) · ProAndroidDev · 1 upvotes · 0 comments
- [Issue \#83: Liquid Glass goes mandatory, Foundation Models opens up, and non-modal panels in SwiftUI](https://daily.dev/posts/issue-83-liquid-glass-goes-mandatory-foundation-models-opens-up-and-non-modal-panels-in-swiftui-3iaih8wgv) · iOS Code Review · 0 upvotes · 0 comments

---

Tags: [#ios](https://daily.dev/tags/ios), [#swiftui](https://daily.dev/tags/swiftui)

[View this post on daily.dev](https://daily.dev/posts/building-adaptive-non-modal-panels-in-swiftui-92svaraut)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Building adaptive non-modal panels in SwiftUI","url":"https://daily.dev/posts/building-adaptive-non-modal-panels-in-swiftui-92svaraut","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/building-adaptive-non-modal-panels-in-swiftui-92svaraut"},"datePublished":"2026-08-02T07:15:03.037Z","dateModified":"2026-08-02T07:32:58.236Z","description":"A deep dive into building a custom non-modal panel API in SwiftUI for a walking app (Strolly) that needed to support both portrait and landscape orientations....","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/0eb602fd050251979ea196f5c1013e38?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/0eb602fd050251979ea196f5c1013e38?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Nil Coalescing","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Nil Coalescing","logo":"https://media.daily.dev/image/upload/s--rcEu6sag--/f_auto,q_auto/v1785654899/logos/nilcoalescing?_a=BAMAMicg0","url":"https://daily.dev/sources/nilcoalescing"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/building-adaptive-non-modal-panels-in-swiftui-92svaraut","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"ios,swiftui","timeRequired":"PT8M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Nil Coalescing","item":"https://daily.dev/sources/nilcoalescing"},{"@type":"ListItem","position":3,"name":"Building adaptive non-modal panels in SwiftUI"}]}
```

