Skip to content

Instantly share code, notes, and snippets.

View Polenoso's full-sized avatar
🏠
Working from home

Aitor Pagán Polenoso

🏠
Working from home
View GitHub Profile
@Polenoso
Polenoso / PagedIndexViewModifier.swift
Created November 27, 2023 22:15
A View Modifier for a Paged Index View like, using ScrollToTargetBehavior
//
// PagedIndexViewModifier.swift
//
// Copyright© 2023 ApiumHub
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
@colorcharge
colorcharge / SheetModalPresentationController.swift
Created March 17, 2021 09:30 — 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
@shnhrrsn
shnhrrsn / String+Hashing.swift
Created September 30, 2019 23:55
Swift CryptoKit MD5/SHA1 Hash
import Foundation
import CryptoKit
private protocol ByteCountable {
static var byteCount: Int { get }
}
extension Insecure.MD5: ByteCountable { }
extension Insecure.SHA1: ByteCountable { }
@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active August 16, 2024 14:43
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S