0

I am looking for the specific native API or implementation approach to replicate the horizontal swipe interaction found in two specific iOS system apps:

  1. iOS Camera App
    The "Mode Switcher", where you swipe between Photo, Video, Cinematic, and other modes.

  2. Safari
    The bottom bar interaction when switching between Tab Groups or Private Browsing.

I want to reproduce exactly what these native components do, including the visual style and the swipe interaction.

Is there a specific UIKit component or SwiftUI modifier designed to achieve this exact "Camera Mode" style transition natively?

If there is no single API, what is the standard native approach for implementing this specific combination of snapping behavior, fading opacity, and background blending?

1
  • There are many possible solutions here, if you clarify the question of what exactly you want to switch, it will help to give a more specific answer. On UIKit, for example, you can use a UIPageViewController Commented Dec 26, 2025 at 20:40

1 Answer 1

0

The Camera app's mode switcher and the Safari tab group bar are custom implementations build by Apple; however, there are standard native building blocks you can combine to replicate them for sure.

For the camera mode switcher, you can use UICollectionViewCompositionalLayout with its orthogonalScrollingBehavior property set to .groupPagingCentered. This will give you the horizontal scrolling with automatic snap-to-center behavior that the camera app uses.

In terms of the fading and scaling effect as items move away from center, you can use the visibleItemsInvalidationHandler callback on the layout section. This gets called continuously during scrolling and provides each visible item's position, allowing you to calculate distance from center and apply opacity and scale transforms accordingly.

From a SwiftUI perspective, you can just use .scrollTargetBehavior(.viewAligned) which provides declarative snapping behavior. Combine with the .scrollTransition() modifier, you can apply position-based opacity and scale changes as items scroll into and out of the center position.

For the Safari tabs group bar: It looks like the frosted glass background uses UIVisualEffectView with blur styles like .systemThinMaterial or .systemUltraThinMaterial. In SwiftUI, this is achieved using the .background(.ultraThinMaterial) modifier.

The horizontal scrolling and selection behavior follows the same patterns as the camera switcher, using either compositional layers in UIKit or scroll target behaviors in SwiftUI.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.