Skip to content

Instantly share code, notes, and snippets.

View vdugnist's full-sized avatar

Vlad Dugnist vdugnist

View GitHub Profile
@vdugnist
vdugnist / Spacedust.xccolortheme
Last active March 11, 2020 14:36
Spacedust.xccolortheme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>DVTConsoleDebuggerInputTextColor</key>
<string>0.052 0.489 0.482 1</string>
<key>DVTConsoleDebuggerInputTextFont</key>
<string>Menlo-Bold - 11.0</string>
<key>DVTConsoleDebuggerOutputTextColor</key>
<string>0.432 0.325 0.276 1</string>
@vdugnist
vdugnist / UIButton+spinner.swift
Created October 11, 2023 16:28
UIButton extension that allows replacing button with a loading indicator and back with one line of code
import UIKit
extension UIButton {
func hideButtonAndShowSpinner() {
self.isHidden = true
let spinnerTag = Int(bitPattern: Unmanaged.passUnretained(self).toOpaque())
if self.superview?.subviews.first(where: { (view) -> Bool in
return view.isKind(of: UIActivityIndicatorView.self) && view.tag == spinnerTag
}) != nil {