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
/* | |
Custom text view containing a placeholder | |
when text is `nil` (currently not supported by | |
UITextView). Placeholder can be modified both | |
programmatically and in the interface builder. | |
Created by Kristopher Jackson on 5/23/22. | |
*/ | |
import UIKit |
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
// | |
// Vibration.swift | |
// Created by Kristopher Jackson. | |
// | |
import UIKit | |
import AudioToolbox | |
enum Vibration { | |
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
// | |
// BlurView.swift | |
// Created by Kristopher Jackson. | |
// | |
class BlurView: UIView { | |
// Can set style of blur after initialization | |
var style: UIBlurEffect.Style { | |
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
// | |
// Window.swift | |
// Created by Kristopher Jackson. | |
// | |
import UIKit | |
let window = UIApplication.shared.connectedScenes | |
.filter({$0.activationState == .foregroundActive}) | |
.map({$0 as? UIWindowScene}) |
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
// | |
// Logging.swift | |
// Created by Kristopher Jackson | |
// | |
import Foundation | |
class Log { | |
enum LogType: String { |
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
// | |
// LabeledPickerView.swift | |
// Created by Kristopher Jackson | |
// | |
import UIKit | |
protocol LabeledPickerViewDataSource { | |
func numberOfComponents(in pickerView: UIPickerView) -> Int | |
func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int |
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
// | |
// Label.swift | |
// Created by Kristopher Jackson | |
// | |
import UIKit | |
@IBDesignable | |
class Label: UILabel { | |
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
/* | |
Custom array represented as a reference type. | |
Unlike NSArray and NSMutableArray, this class | |
allows for observing changes realtime. | |
Created by Kristopher Jackson on 5/22/22. | |
*/ | |
import Foundation |
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
import UIKit | |
extension Array where Element == NSLayoutConstraint { | |
/// Activates each constraint in an array of `NSLayoutConstraint`. | |
/// | |
/// Example usage: `[view.heightAnchor.constraint(equalToConstant: 30), view.widthAnchor.constraint(equalToConstant: 30)].activate()` | |
func activate() { | |
NSLayoutConstraint.activate(self) | |
} |