Skip to content

Instantly share code, notes, and snippets.

@shengchl
shengchl / FixedTransactionTransition.swift
Created June 28, 2022 19:52
SwiftUI transition modifier with advanced behavior
// 2022 (c) Alexey Grigorev, Ivan Oparin
// licensed under MIT
import SwiftUI
internal struct FixedTransactionTransition: ViewModifier {
@Binding var isPresentInParentContainer: Bool
@Binding var isPresentInBody: Bool
@shengchl
shengchl / HapticTouchToggle.swift
Created December 16, 2019 00:38
Custom Toggle SwiftUI View with Haptic Touch-like gesture
//
// HapticTouchToggle.swift
// Created by @shengchalover on 15.12.2019.
// License: MIT
// Gesture mechanics inspired by DraggableCover from MovieSwift by Thomas Ricouard _ 19/06/2019 Apache License 2.0
import SwiftUI
///pass c as root view to UIHostingController in SceneDelegate
let c = HapticTouchToggle()