Skip to content

Instantly share code, notes, and snippets.

View andrewconlan's full-sized avatar
👋

Andrew Conlan andrewconlan

👋
View GitHub Profile
@andrewconlan
andrewconlan / CustomStringConvertible.swift
Created March 10, 2016 11:09
extension for printing objects
extension CustomStringConvertible {
var description : String {
var description: String = ""
if self is AnyObject {
description = "***** \(self.dynamicType) - <\(unsafeAddressOf((self as! AnyObject)))>***** \n"
} else {
description = "***** \(self.dynamicType) *****\n"
}
let selfMirror = Mirror(reflecting: self)
for child in selfMirror.children {
@andrewconlan
andrewconlan / IBInspectable.swift
Created March 9, 2016 17:56
extensions on UIView
extension UIView {
/// When positive, the background of the layer will be drawn with rounded corners. Also effects the mask generated by the `masksToBounds' property. Defaults to zero. Animatable.
@IBInspectable var cornerRadius: Double {
get {
return Double(self.layer.cornerRadius)
}
set {
self.layer.cornerRadius = CGFloat(newValue)
}
}
@andrewconlan
andrewconlan / Swipe.swift
Last active February 26, 2018 15:28
Fix Broken Swipe to Go Back With Hidden Navigation Bar
if let navigationController = navigationController, interactivePopGestureRecognizer = navigationController.interactivePopGestureRecognizer {
navigationController.setNavigationBarHidden(true, animated: true)
interactivePopGestureRecognizer.delegate = self
}