Close Menu
  • Home
  • AI
  • Big Data
  • Cloud Computing
  • iOS Development
  • IoT
  • IT/ Cybersecurity
  • Tech
    • Nanotechnology
    • Green Technology
    • Apple
    • Software Development
    • Software Engineering

Subscribe to Updates

Get the latest technology news from Bigteetechhub about IT, Cybersecurity and Big Data.

    What's Hot

    Nanoscale Ceramic Film Boosts High-Frequency Performance

    November 7, 2025

    Hackers target massage parlour clients in blackmail scheme

    November 7, 2025

    Turning Security into Profit: Advanced VMware vDefend Opportunities for Cloud Service Providers

    November 7, 2025
    Facebook X (Twitter) Instagram
    Facebook X (Twitter) Instagram
    Big Tee Tech Hub
    • Home
    • AI
    • Big Data
    • Cloud Computing
    • iOS Development
    • IoT
    • IT/ Cybersecurity
    • Tech
      • Nanotechnology
      • Green Technology
      • Apple
      • Software Development
      • Software Engineering
    Big Tee Tech Hub
    Home»iOS Development»ios – Prevent matchedGeometryEffect from animating during transition
    iOS Development

    ios – Prevent matchedGeometryEffect from animating during transition

    big tee tech hubBy big tee tech hubAugust 27, 2025081 Min Read
    Share Facebook Twitter Pinterest Copy Link LinkedIn Tumblr Email Telegram WhatsApp
    Follow Us
    Google News Flipboard
    ios – Prevent matchedGeometryEffect from animating during transition
    Share
    Facebook Twitter LinkedIn Pinterest Email Copy Link


    I am trying to present a modal that contains an element using matchedGeometryEffect. I’ve run into a problem — if I animate the transition, the matchedGeometryEffect animates as well. I’d like it not to animate the first time, but only in response to the user’s action.

    Minimal example:

    struct Modal: View {
        @Namespace private var modalNamespace
        var body: some View {
            HStack {
                Text("Option 1")
                    .matchedGeometryEffect(id: "option1", in: modalNamespace)
                Text("Option 2")
                    .matchedGeometryEffect(id: "option2", in: modalNamespace)
            }
            .frame(maxWidth: .infinity)
            .background(
                Color.blue
                    .matchedGeometryEffect(id: "option2", in: modalNamespace, isSource: false)
            )
        }
    }
    
    struct ContentView: View {
        @State private var showModal: Bool = false
        var body: some View {
            ZStack {
                Button {
                    withAnimation {
                        showModal = true
                    }
                } label: {
                    Text("Show modal")
                }
                if showModal {
                    Color.gray
                        .onTapGesture {
                            showModal = false
                    }
                    VStack {
                        Spacer()
                        Modal()
                        Spacer()
                    }
                    .transition(.move(edge: .bottom))
                }
            }
        }
    }
    

    In the real app, the modal contains a segmented control that uses matchedGeometryEffect. I want to keep the animation in response to the user’s action, but I really want to remove this unwanted animation during view’s transition.

    Can anyone help me slide this modal in without triggering that animation? 🙂

    enter image description here



    Source link

    animating iOS matchedGeometryEffect Prevent Transition
    Follow on Google News Follow on Flipboard
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email Copy Link
    tonirufai
    big tee tech hub
    • Website

    Related Posts

    swift – Swiftui LazyVStack issue on iOS 17, 18

    November 6, 2025

    A deep dive into Collections, Sequences, and Iterators in Swift – Donny Wals

    November 5, 2025

    swift – TipGroup tip presented as sheet iOS 18 instead of a popover tip

    November 4, 2025
    Add A Comment
    Leave A Reply Cancel Reply

    Editors Picks

    Nanoscale Ceramic Film Boosts High-Frequency Performance

    November 7, 2025

    Hackers target massage parlour clients in blackmail scheme

    November 7, 2025

    Turning Security into Profit: Advanced VMware vDefend Opportunities for Cloud Service Providers

    November 7, 2025

    Developers decode their journeys from app ideas to App Store

    November 6, 2025
    About Us
    About Us

    Welcome To big tee tech hub. Big tee tech hub is a Professional seo tools Platform. Here we will provide you only interesting content, which you will like very much. We’re dedicated to providing you the best of seo tools, with a focus on dependability and tools. We’re working to turn our passion for seo tools into a booming online website. We hope you enjoy our seo tools as much as we enjoy offering them to you.

    Don't Miss!

    Nanoscale Ceramic Film Boosts High-Frequency Performance

    November 7, 2025

    Hackers target massage parlour clients in blackmail scheme

    November 7, 2025

    Subscribe to Updates

    Get the latest technology news from Bigteetechhub about IT, Cybersecurity and Big Data.

      • About Us
      • Contact Us
      • Disclaimer
      • Privacy Policy
      • Terms and Conditions
      © 2025 bigteetechhub.All Right Reserved

      Type above and press Enter to search. Press Esc to cancel.