Skip to content

Instantly share code, notes, and snippets.

View saitcihaner's full-sized avatar
🏠

Sait CİHANER saitcihaner

🏠
View GitHub Profile
@saitcihaner
saitcihaner / SheetModalPresentationController.swift
Created July 21, 2024 15:36 — forked from vinczebalazs/SheetModalPresentationController.swift
A presentation controller to use for presenting a view controller modally, which can be dismissed by a pull down gesture. The presented view controller's height is also adjustable.
import UIKit
extension UIView {
var allSubviews: [UIView] {
subviews + subviews.flatMap { $0.allSubviews }
}
func firstSubview<T: UIView>(of type: T.Type) -> T? {
allSubviews.first { $0 is T } as? T
//
// UIBarButtonItem+Badge.swift
// PiGuardMobile
//
// Created by Stefano Vettor on 12/04/16.
// Copyright © 2016 Stefano Vettor. All rights reserved.
//
import UIKit
@saitcihaner
saitcihaner / Date+Extension.swift
Created August 7, 2022 13:13 — forked from kunikullaya/Date+Extension.swift
Date Extension for Swift
import Foundation
extension Date {
func toString(format: String = "yyyy-MM-dd") -> String {
let formatter = DateFormatter()
formatter.dateStyle = .short
formatter.dateFormat = format
return formatter.string(from: self)
}