![shota_appdev](https://booth.pximg.net/c/48x48/users/12136436/icon_image/0792dddc-0f47-49a3-bc3e-68623c3f4f82_base_resized.jpg)
Camera Shutter Button UI Animation made with Rive
- Digital5,000 JPY
![Camera Shutter Button UI Animation made with Rive](https://booth.pximg.net/3b1680cd-e505-4885-a46a-669c3ed2f22b/i/5067401/5362b43c-bc14-499e-a673-2ce42963c866_base_resized.jpg)
Recreate iPhone's Shutter Button with Rive Animation for effortless clicks. # How to use ## SwiftUI YouTube Video: https://youtu.be/lAgR0KCzN-s 1. Target The minimum iOS target is 14.0 2. Install the dependency To install via Swift Package Manager, in the package finder in Xcode, search for rive-ios 3. Place the file "shutter_button.riv" in your project 4. Sample code ```swift import SwiftUI import RiveRuntime struct ShutterButton: View { @StateObject private var riveViewModel = RiveViewModel( fileName: "shutter_button", stateMachineName: "State Machine 1", autoPlay: false ) @State private var isPressed = false private let action: () -> Void init(action: @escaping () -> Void) { self.action = action } var body: some View { Button { onTap() } label: { riveViewModel .view() .frame(width: 65, height: 65) } .buttonStyle(ShutterButtonStyle(isPressed: $isPressed)) .onChange(of: isPressed) { newValue in riveViewModel.setInput("isPressed", value: newValue) } .onAppear { riveViewModel.setInput("isPressed", value: false) } } private func onTap() { riveViewModel.triggerInput("onTapped") action() } } struct ShutterButtonStyle: ButtonStyle { @Binding var isPressed: Bool func makeBody(configuration: Configuration) -> some View { configuration.label .onChange(of: configuration.isPressed) { isPressed in self.isPressed = isPressed } } } ```