This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# GitHub REST API ref: https://docs.github.com/en/rest/reference/repos#releases | |
# | |
# | |
# Expects the following arguments: | |
# | |
# REPOSITORY - GitHub Repository | |
# TOKEN - GitHub token | |
# RELEASE_ID - ID of GitHub Release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// UITableView+Extensions.swift | |
// | |
import Foundation | |
import UIKit | |
protocol ReusableCell: AnyObject { | |
static var reuseIdentifier: String { get } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// UIView+Extensions.swift | |
// | |
import UIKit | |
extension UIView { | |
convenience init(autolayout: Bool) { | |
self.init() | |
translatesAutoresizingMaskIntoConstraints = !autolayout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// String+Extensions.swift | |
// | |
import Foundation | |
extension String { | |
var isEmail: Bool { | |
// https://www.tutorialspoint.com/email-and-phone-validation-in-swift | |
let regularExpressionForEmail = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,64}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// UIStoryboard+Extensions.swift | |
// | |
import Foundation | |
import UIKit | |
extension UIStoryboard { | |
static func instantiate<T>(fromStoryboardWithName name: String = "Main", inBundle bundle: Bundle = .main) -> T where T: UIViewController { | |
let identifier = String(describing: T.self) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// RoundedView.swift | |
// | |
@IBDesignable | |
class RoundedView: UIView { | |
private let borderView: UIView = { | |
let view = UIView() | |
view.translatesAutoresizingMaskIntoConstraints = false | |
return view |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// CircularView.swift | |
// | |
import Foundation | |
import UIKit | |
class CircularView: UIView { | |
override func layoutSubviews() { | |
super.layoutSubviews() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// debounce.swift | |
// | |
import Fundation | |
func debounce(delay: TimeInterval, queue: DispatchQueue = .main, action: @escaping (() -> Void)) -> () -> Void { | |
var currentWorkItem: DispatchWorkItem? | |
var lastFire: TimeInterval = 0 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// trottle.swift | |
// | |
import Foundation | |
func throttle(interval: TimeInterval, queue: DispatchQueue = .main, action: @escaping (() -> Void)) -> () -> Void { | |
var lastFire: TimeInterval = 0 | |
return { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// FullScreenPresentationController.swift | |
// | |
import Foundation | |
import UIKit | |
import TinyConstraints | |
final class FullScreenPresentationController: UIPresentationController { | |
private lazy var closeButtonContainer: UIVisualEffectView = { |
OlderNewer