Skip to content

Instantly share code, notes, and snippets.

@waynehartman
waynehartman / Create iOS Icons.jsx
Created December 29, 2018 21:54 — forked from twonjosh/Create iOS Icons.jsx
Photoshop Script to Create iOS Icons from a source image
// Photoshop Script to Create iPhone Icons from iTunesArtwork
//
// WARNING!!! In the rare case that there are name collisions, this script will
// overwrite (delete perminently) files in the same folder in which the selected
// iTunesArtwork file is located. Therefore, to be safe, before running the
// script, it's best to make sure the selected iTuensArtwork file is the only
// file in its containing folder.
//
// Copyright (c) 2010 Matt Di Pasquale
// Added tweaks Copyright (c) 2012 by Josh Jones http://www.appsbynight.com
@waynehartman
waynehartman / UIFont+PrettyPrint.swift
Last active January 10, 2018 04:02
There a number of posts out there that simply print the loaded fonts on iOS. This is a little bit more involved to sort and pretty print them to the console to easily determine what fonts have been loaded by visually scanning the list.
extension UIFont {
public static func prettyPrintFontNames() {
var fonts = [String:[String]]()
for fontFamilyName in UIFont.familyNames {
for fontName in UIFont.fontNames(forFamilyName: fontFamilyName) {
var collection = fonts[fontFamilyName] ?? [String]()
collection.append(fontName)
fonts[fontFamilyName] = collection.sorted()
/*
*
* Copyright (c) 2014 Wayne Hartman
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in the
* Software without restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so, subject
* to the following conditions:
//
// UISwitch+ForChrisLowe.h
//
// Created by Wayne on 1/19/13.
// Copyright (c) 2013 WayneHartman. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UISwitch (ForChrisLowe)
@waynehartman
waynehartman / gist:4464137
Created January 5, 2013 22:52
UIWebView Delegate
#pragma mark - UIWebViewDelegate
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error {
if (error.code != NSURLErrorCancelled) {
}
}
- (void)webViewDidFinishLoad:(UIWebView *)webView {