<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/driving-swiftui-animations-with-the-hinge-angle-on-iphone-duo-jw8nqzgtf" -->

---
title: Driving SwiftUI animations with the hinge angle on...
description: SwiftUI's new onHingeChange(isEnabled:_:) modifier, introduced in iOS 27.1, exposes the hinge angle and status on iPhone Duo so apps can drive animations as...
canonical: https://daily.dev/posts/driving-swiftui-animations-with-the-hinge-angle-on-iphone-duo-jw8nqzgtf
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Driving SwiftUI animations with the hinge angle on iPhone Duo | daily.dev
og:description: SwiftUI's new onHingeChange(isEnabled:_:) modifier, introduced in iOS 27.1, exposes the hinge angle and status on iPhone Duo so apps can drive animations as...
og:url: https://daily.dev/posts/driving-swiftui-animations-with-the-hinge-angle-on-iphone-duo-jw8nqzgtf
og:image: https://api.daily.dev/og/posts/JW8nqZGTf.png
og:image:alt: Driving SwiftUI animations with the hinge angle on iPhone Duo
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.

# Driving SwiftUI animations with the hinge angle on iPhone Duo

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

## Summary

SwiftUI's new onHingeChange(isEnabled:_:) modifier, introduced in iOS 27.1, exposes the hinge angle and status on iPhone Duo so apps can drive animations as the device folds. A demo flower view unfolds its petals by mapping a bloom value from 0 to 1 to the hinge angle: closed bud at 80 degrees or less, full bloom at 170 degrees or more. When the device is closed, the flower shows as a bud, and when fully open or on devices with no hinge, it stays in full bloom. For layout changes rather than live animation, reserved regions or ArrangementView are recommended instead, since layout only needs to change when the fold becomes active or inactive, and reserved regions also tell where the fold is within the view, which the hinge does not.

## Full article

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

## Questions this post answers

### How do I use onHingeChange in SwiftUI on iPhone Duo?

Use the onHingeChange(isEnabled:_:) modifier, introduced in iOS 27.1, which fires with previous and current DeviceHingeContext values whenever the hinge angle or status changes. The context's hinge property gives you angle and status, and is nil on devices without a hinge, letting you drive animations like unfolding a view as the device opens.

_Building fold-aware animations in SwiftUI is easier when you track API changes like this on daily.dev._

### Should I use onHingeChange or reserved regions to adapt SwiftUI layout to the iPhone Duo fold?

Reserved regions and ArrangementView are the better fit for layout, since they update only when the fold becomes active or inactive rather than on every hinge angle change, and they also report where the fold is within the view. onHingeChange() is best reserved for effects and interactions that need to respond continuously to the folding motion itself.

_daily.dev helps developers compare foldable-device APIs before committing to one in their layout code._

### At what hinge angle does a partially open iPhone Duo count as open versus closed?

In the described mapping, a hinge angle of 80 degrees or less is treated as fully closed (bud state), and 170 degrees or more is treated as fully open, with progress interpolated linearly in between using the formula (angle - 80) / 90, clamped between 0 and 1.

_Developers tuning fold-driven animations can keep up with these API details on daily.dev._

## Similar posts on daily.dev

- [Adjusting the hinge angle in the iPhone Duo simulator](https://daily.dev/posts/adjusting-the-hinge-angle-in-the-iphone-duo-simulator-gmqvhgdqi) · Nil Coalescing · 0 upvotes · 0 comments
- [Positioning SwiftUI views around the fold on iPhone Duo](https://daily.dev/posts/positioning-swiftui-views-around-the-fold-on-iphone-duo-i3gdcfsn1) · Nil Coalescing · 0 upvotes · 0 comments

---

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

[View this post on daily.dev](https://daily.dev/posts/driving-swiftui-animations-with-the-hinge-angle-on-iphone-duo-jw8nqzgtf)

```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":"Driving SwiftUI animations with the hinge angle on iPhone Duo","url":"https://daily.dev/posts/driving-swiftui-animations-with-the-hinge-angle-on-iphone-duo-jw8nqzgtf","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/driving-swiftui-animations-with-the-hinge-angle-on-iphone-duo-jw8nqzgtf"},"datePublished":"2026-10-27T07:05:33.482Z","dateModified":"2026-10-27T07:06:08.636Z","description":"SwiftUI's new onHingeChange(isEnabled:_:) modifier, introduced in iOS 27.1, exposes the hinge angle and status on iPhone Duo so apps can drive animations as...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/1a0316b58a289ead0710f91a2e2d8558?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/1a0316b58a289ead0710f91a2e2d8558?_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/driving-swiftui-animations-with-the-hinge-angle-on-iphone-duo-jw8nqzgtf","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"ios,swift,swiftui","timeRequired":"PT4M"}
{"@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":"Driving SwiftUI animations with the hinge angle on iPhone Duo"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/driving-swiftui-animations-with-the-hinge-angle-on-iphone-duo-jw8nqzgtf#faq","mainEntity":[{"@type":"Question","name":"How do I use onHingeChange in SwiftUI on iPhone Duo?","acceptedAnswer":{"@type":"Answer","text":"Use the onHingeChange(isEnabled:_:) modifier, introduced in iOS 27.1, which fires with previous and current DeviceHingeContext values whenever the hinge angle or status changes. The context's hinge property gives you angle and status, and is nil on devices without a hinge, letting you drive animations like unfolding a view as the device opens. Building fold-aware animations in SwiftUI is easier when you track API changes like this on daily.dev."}},{"@type":"Question","name":"Should I use onHingeChange or reserved regions to adapt SwiftUI layout to the iPhone Duo fold?","acceptedAnswer":{"@type":"Answer","text":"Reserved regions and ArrangementView are the better fit for layout, since they update only when the fold becomes active or inactive rather than on every hinge angle change, and they also report where the fold is within the view. onHingeChange() is best reserved for effects and interactions that need to respond continuously to the folding motion itself. daily.dev helps developers compare foldable-device APIs before committing to one in their layout code."}},{"@type":"Question","name":"At what hinge angle does a partially open iPhone Duo count as open versus closed?","acceptedAnswer":{"@type":"Answer","text":"In the described mapping, a hinge angle of 80 degrees or less is treated as fully closed (bud state), and 170 degrees or more is treated as fully open, with progress interpolated linearly in between using the formula (angle - 80) / 90, clamped between 0 and 1. Developers tuning fold-driven animations can keep up with these API details on daily.dev."}}]}
```

