Skip to content

Instantly share code, notes, and snippets.

View AntonBrock's full-sized avatar
🧸
focusing

Anton Dobrynin AntonBrock

🧸
focusing
View GitHub Profile
@mobilinked
mobilinked / gist:9b6086b3760bcf1e5432932dad0813c0
Last active February 9, 2024 13:03
SwiftUI - prevent auto dismiss the sheet by drag down
//
// Created by https://quickplan.app on 2020/11/8.
//
import SwiftUI
/// Control if allow to dismiss the sheet by the user actions
/// - Drag down on the sheet on iPhone and iPad
/// - Tap outside the sheet on iPad
/// No impact to dismiss programatically (by calling "presentationMode.wrappedValue.dismiss()")
@samwarnick
samwarnick / UIRoundedButtonWithGradientAndShadow.swift
Last active December 26, 2021 16:45
A rounded button with a gradient and shadow written in swift
class UIRoundedButtonWithGradientAndShadow: UIButton {
let gradientColors : [UIColor]
let startPoint : CGPoint
let endPoint : CGPoint
required init(gradientColors: [UIColor],
startPoint: CGPoint = CGPoint(x: 0, y: 0.5),
endPoint: CGPoint = CGPoint(x: 1, y: 0.5)) {
self.gradientColors = gradientColors