Skip to content

Instantly share code, notes, and snippets.

@feighter09
feighter09 / changeKeyboardDoneColor.swift
Last active July 25, 2022 06:10
Change the keyboard "Done" button color to match the rest of your app! This is a total hack though and is likely to get flagged during app review. If so, try obfuscating =)
class Utilities {
class func subviewsOfView(view: UIView, withType type: String) -> [UIView]
{
let prefix = "<\(type)"
var subviewArray = view.subviews.flatMap { subview in subviewsOfView(subview, withType: type) }
if view.description.hasPrefix(prefix) {
subviewArray.append(view)
}
@staltz
staltz / introrx.md
Last active April 24, 2024 19:47
The introduction to Reactive Programming you've been missing
@jbgo
jbgo / git-recover-branch.md
Last active March 29, 2024 05:04
How to recover a git branch you accidentally deleted

UPDATE: A better way! (August 2015)

As pointed out by @johntyree in the comments, using git reflog is easier and more reliable. Thanks for the suggestion!

 $ git reflog
1ed7510 HEAD@{1}: checkout: moving from develop to 1ed7510
3970d09 HEAD@{2}: checkout: moving from b-fix-build to develop
1ed7510 HEAD@{3}: commit: got everything working the way I want
70b3696 HEAD@{4}: commit: upgrade rails, do some refactoring