Skip to content

Instantly share code, notes, and snippets.

View CrystDragon's full-sized avatar

Lincoln Wu CrystDragon

View GitHub Profile
@ole
ole / UIAlertController+TextField.swift
Last active September 13, 2022 14:20
A UIAlertController with a text field and the ability to perform validation on the text the user has entered while the alert is on screen. The OK button is only enabled when the entered text passes validation. More info: https://oleb.net/2018/uialertcontroller-textfield/
import UIKit
/// A validation rule for text input.
public enum TextValidationRule {
/// Any input is valid, including an empty string.
case noRestriction
/// The input must not be empty.
case nonEmpty
/// The enitre input must match a regular expression. A matching substring is not enough.
case regularExpression(NSRegularExpression)
@nevan
nevan / gist:3e1174f27e753db4731e
Last active January 9, 2022 19:04
WWDC 2015 Session Videos
https://developer.apple.com/videos/wwdc/2015/?id=101 101 Keynote
https://developer.apple.com/videos/wwdc/2015/?id=102 102 Platforms State of the Union
https://developer.apple.com/videos/wwdc/2015/?id=103 103 Apple Design Awards
https://developer.apple.com/videos/wwdc/2015/?id=104 104 What's New in Xcode
https://developer.apple.com/videos/wwdc/2015/?id=105 105 Introducing WatchKit for watchOS 2
https://developer.apple.com/videos/wwdc/2015/?id=106 106 What's New in Swift
https://developer.apple.com/videos/wwdc/2015/?id=107 107 What's New in Cocoa Touch
https://developer.apple.com/videos/wwdc/2015/?id=108 108 Building Watch Apps
https://developer.apple.com/videos/wwdc/2015/?id=112 112 Think Audacious
https://developer.apple.com/videos/wwdc/2015/?id=201 201 iOS Accessibility