Skip to content

Instantly share code, notes, and snippets.

View pradeepb28's full-sized avatar
🎯
Focusing

pradeep pradeepb28

🎯
Focusing
View GitHub Profile
@IanKeen
IanKeen / Coordinator.swift
Last active April 13, 2020 23:26
Segue<Destination> to tame Storyboard segues
//
// Coordinator
//
// Created by Ian Keen.
// Copyright © 2018 Ian Keen. All rights reserved.
//
import ObjectiveC
import UIKit
@IanKeen
IanKeen / Debounce.swift
Created January 16, 2019 19:13
Simple debouncer
func debounce<T>(delay: TimeInterval, function: @escaping (T) -> Void, complete: @escaping () -> Void = { }) -> (T) -> Void {
let queue = DispatchQueue(label: "Debouncer")
var current: DispatchWorkItem?
return { input in
current?.cancel()
let new = DispatchWorkItem {
function(input)
complete()
}
@parrotbait
parrotbait / UniqueNos.swift
Created January 17, 2019 11:16
Algorithm to determine if a string has all unique characters. What if you cannot use any additional data structures?
import UIKit
// This code is based on implementing the following:
// Implement an algorithm to determine if a string has all unique characters. What if you cannot use any additional data structures?
extension Character {
func toString() -> String {
return String(self)
}
}
@parrotbait
parrotbait / gist:a2b632a057a98f05230e554b11a6c590
Last active January 18, 2019 17:01
Some good iOS Dev Accounts to follow
@TyrfingMjolnir
TyrfingMjolnir / README.convert_iOS_icon.md
Last active February 26, 2019 06:23
Convert 1 image 2048x2048 to all needed sizes for an iOS app