Skip to content

Instantly share code, notes, and snippets.

View wzbozon's full-sized avatar

Denis Kutlubaev wzbozon

View GitHub Profile
@wzbozon
wzbozon / PressActionsModifier.swift
Created November 22, 2022 19:06 — forked from gabrieltheodoropoulos/PressActionsModifier.swift
PressActions modifier - Handle press and release events in SwiftUI
struct PressActions: ViewModifier {
var onPress: () -> Void
var onRelease: () -> Void
func body(content: Content) -> some View {
content
.simultaneousGesture(
DragGesture(minimumDistance: 0)
.onChanged({ _ in
onPress()
@wzbozon
wzbozon / RoundBorderedShadowButton.swift
Last active October 25, 2020 14:58
iOS round bordered UIButton with a shadow written in Swift
import UIKit
class RoundBorderedShadowButton: UIButton {
// Customize your button here
let fillColor: UIColor = .white
let highlightedFillColor: UIColor = .lightGray
let borderColor: UIColor = .gray
let borderWidth: CGFloat = 0.5
let shadowColor: UIColor = .lightGray