Skip to content

Instantly share code, notes, and snippets.

@jacobbubu
jacobbubu / ioslocaleidentifiers.csv
Created February 15, 2012 14:41
iOS Locale Identifiers
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
mr Marathi
bs Bosnian
ee_TG Ewe (Togo)
ms Malay
kam_KE Kamba (Kenya)
mt Maltese
ha Hausa
es_HN Spanish (Honduras)
ml_IN Malayalam (India)
ro_MD Romanian (Moldova)
@matt-curtis
matt-curtis / NumberPadDoneBtn.h
Last active December 31, 2020 14:29
Done Button for UIKeyboard NumberPad (must be set as inputAccessoryView)
#import <UIKit/UIKit.h>
@interface NumberPadDoneBtn : UIView
@end
@interface NumberPadButton : UIButton
@end
@kristopherjohnson
kristopherjohnson / executionTimeInterval.swift
Last active May 29, 2024 19:25
Calculate execution time for a block of Swift code
import QuartzCore
func executionTimeInterval(block: () -> ()) -> CFTimeInterval {
let start = CACurrentMediaTime()
block();
let end = CACurrentMediaTime()
return end - start
}
@mikezs
mikezs / UIView+AutoLayout.swift
Last active October 8, 2019 22:22
UIView+AutoLayoutAnchors.swift
import UIKit
protocol LayoutAttributeConvertible {
var layoutAttribute: NSLayoutAttribute { get }
}
enum Edge: LayoutAttributeConvertible {
case left
case right
case top
@sindresorhus
sindresorhus / issuehunt-bounties.md
Last active July 5, 2019 08:51
IssueHunt bounties
@yawboafo
yawboafo / AutoLayout+Extension.swift
Last active October 8, 2019 22:18
A UIView Extensions to help you constrains a view programatically and simplified
import UIKit
public extension UIView{
func setWith(_ width: CGFloat){
self.widthAnchor.constraint(equalToConstant: width).isActive = true
}
func setHeight(_ width: CGFloat){
self.heightAnchor.constraint(equalToConstant: width).isActive = true
}