<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/stretchy-header-in-swiftui-with-visualeffect--kj1ieffav" -->

---
title: Stretchy header in SwiftUI with visualEffect() | daily.dev
description: A concise tutorial on building a stretchy image header in SwiftUI using the `visualEffect()` modifier. Instead of the common approach of tracking scroll offset...
canonical: https://daily.dev/posts/stretchy-header-in-swiftui-with-visualeffect--kj1ieffav
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Stretchy header in SwiftUI with visualEffect() | daily.dev
og:description: A concise tutorial on building a stretchy image header in SwiftUI using the `visualEffect()` modifier. Instead of the common approach of tracking scroll offset...
og:url: https://daily.dev/posts/stretchy-header-in-swiftui-with-visualeffect--kj1ieffav
og:image: https://api.daily.dev/og/posts/kj1iEFfAv.png
og:image:alt: Stretchy header in SwiftUI with visualEffect()
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.

# Stretchy header in SwiftUI with visualEffect()

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

## Summary

A concise tutorial on building a stretchy image header in SwiftUI using the `visualEffect()` modifier. Instead of the common approach of tracking scroll offset with `onScrollGeometryChange()` and modifying state, the technique uses `GeometryProxy` inside `visualEffect()` to compute a scale factor and apply a `scaleEffect` anchored to the bottom. This results in a self-contained, reusable `stretchy()` view modifier that requires no external state management.

## Full article

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

---

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/stretchy-header-in-swiftui-with-visualeffect--kj1ieffav)

```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":"Stretchy header in SwiftUI with visualEffect()","url":"https://daily.dev/posts/stretchy-header-in-swiftui-with-visualeffect--kj1ieffav","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/stretchy-header-in-swiftui-with-visualeffect--kj1ieffav"},"datePublished":"2026-08-02T07:15:08.940Z","dateModified":"2026-08-02T07:34:39.851Z","description":"A concise tutorial on building a stretchy image header in SwiftUI using the `visualEffect()` modifier. Instead of the common approach of tracking scroll offset...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/b00f449c228f0f498c92d45b65410bd7?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/b00f449c228f0f498c92d45b65410bd7?_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/stretchy-header-in-swiftui-with-visualeffect--kj1ieffav","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"ios,swift,swiftui","timeRequired":"PT3M"}
{"@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":"Stretchy header in SwiftUI with visualEffect()"}]}
```

