Skip to content

Instantly share code, notes, and snippets.

View Josscii's full-sized avatar
💭
??

Josscii Josscii

💭
??
View GitHub Profile
@joshdholtz
joshdholtz / UIButton+Block.h
Created April 23, 2012 04:37
iOS - UIButton+Block
//
// UIButton+Block.h
// BoothTag
//
// Created by Josh Holtz on 4/22/12.
// Copyright (c) 2012 Josh Holtz. All rights reserved.
//
#define kUIButtonBlockTouchUpInside @"TouchInside"
@oliverdowling
oliverdowling / CEButton.h
Last active October 22, 2017 14:51
A custom UIButton extension that can change title and image insets depending on button state.
//
// CEButton.h
//
// Created by Cemal Eker on 11/12/13. (2013-11-12)
// Modified by Oliver Dowling on 2014-04-28.
//
#import <UIKit/UIKit.h>
@interface CEButton : UIButton
@buranmert
buranmert / In-page navigation detection UIWebView
Created November 4, 2013 15:19
In-page navigation detection UIWebView
//
// WVViewController.m
// WebViewTrial
//
// Created by Mert Buran on 11/4/13.
// Copyright (c) 2013 Mert Buran. All rights reserved.
//
#import "WVViewController.h"
//
// ContextLabel.swift
// ContextLabel
//
// Created by Cory D. Wiles
// Copyright (c) 2017 Cory D. Wiles. All rights reserved.
//
import Foundation
import UIKit
@stuartjmoore
stuartjmoore / FontMeasure.swift
Created June 21, 2015 21:54
Fix Clipping UITextView
//: Playground - noun: a place where people can play
import XCPlayground
import UIKit
// MARK: - Paragraph Styles
let headlineParagraphStyle = NSMutableParagraphStyle()
headlineParagraphStyle.lineHeightMultiple = 0.8
@algal
algal / FontUtils.swift
Last active January 12, 2018 18:43
Type-safe font initiazer
//
// MARK: Font utilities
//
enum FontFamily : String {
case HelveticaNeue = "Helvetica Neue"
case MontSerrat = "Montserrat"
}
enum FontWeight {
@Inferis
Inferis / CommonMacros.h
Last active February 5, 2018 03:01
Common Macros for Xcode projects.
//
// CommonMacros.h
// Created by Tom Adriaenssen (@inferis)
// Inspired by the awesome work by Piet Jaspers (@pjaspers)
//
/*
* How to use this file:
* 1. Find your .pch file
* 2. Import this file
@Kametrixom
Kametrixom / emoji.swift
Created August 3, 2015 20:46
Gets all Emoji Unicode code points from the latest Unicode source and prints them out (as Emoji). Also: Prints out all country flag emojis from "AA" to "ZZ"
import Foundation
import XCPlayground
XCPSetExecutionShouldContinueIndefinitely()
func getAllEmojis(completion: String? -> ()) {
let url = NSURL(string: "http://www.unicode.org/Public/UCD/latest/ucd/EmojiSources.txt")!
NSURLSession.sharedSession().dataTaskWithURL(url) { data, response, error in
guard let data = data where error == nil else {
completion(nil)
@twobitlabs
twobitlabs / NSURLConnection+Timeout.m
Created April 30, 2012 17:55
Synchronous NSURLConnection timeout
@implementation NSURLConnection (Timeout)
+ (dispatch_queue_t)timeoutLockQueue {
static dispatch_queue_t queue;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
queue = dispatch_queue_create("timeout lock queue", DISPATCH_QUEUE_SERIAL);
});
return queue;
}
@lexrus
lexrus / CollectionOperator.swift
Created April 24, 2017 08:53
Avoid hard-coded KVC collection operators
import Foundation
enum CollectionOperator: String {
case avg
case count
case max
case min
case sum