Skip to content

Instantly share code, notes, and snippets.

View louisdh's full-sized avatar

Louis D'hauwe louisdh

  • Apple
  • San Jose, CA
View GitHub Profile
@louisdh
louisdh / UIPaddedLabel.swift
Last active December 19, 2016 15:10 — forked from mikeMTOL/UIPaddedLabel.swift
Swift 3
import Foundation
import UIKit
@IBDesignable
class UIPaddedLabel: UILabel {
@IBInspectable var topPadding: CGFloat = 0 {
didSet {
updatePadding()
}
@louisdh
louisdh / Data+String.swift
Created November 16, 2016 13:52
Swift Data extension for easily converting to String
import Foundation
extension Data {
var utf8String: String? {
return string(as: .utf8)
}
func string(as encoding: String.Encoding) -> String? {
return String(data: self, encoding: encoding)

Keybase proof

I hereby claim:

  • I am louisdh on github.
  • I am louisdh (https://keybase.io/louisdh) on keybase.
  • I have a public key whose fingerprint is 4273 FC51 0900 0AFF 5EC7 C74E 5F48 9309 DED5 41C6

To claim this, I am signing this object:

@louisdh
louisdh / String+EmailValidation.swift
Created May 22, 2017 18:16
Email validation using NSDataDetector
import Foundation
// Adapted from https://www.cocoanetics.com/2014/06/e-mail-validation/
extension String {
var isValidEmail: Bool {
guard !self.characters.isEmpty else {
return false
@louisdh
louisdh / NYSKeyboardHelper.swift
Last active March 10, 2023 21:47 — forked from matthiasnys/NYSKeyboardHelper.swift
A Keyboard helper for your Swift Keyboard troubles.
//
// NYSKeyboardHelper.swift
// B-NYS GCV
//
// Created by Matthias Nys on 18/03/2017.
// Copyright © 2017 B-NYS. All rights reserved.
//
import UIKit