Skip to content

Instantly share code, notes, and snippets.

View brandFromNSK's full-sized avatar

Andrey Bronnikov brandFromNSK

  • Whoosh
  • Russia, Novosibirsk
View GitHub Profile
@nyg
nyg / iOSCreatePDF.swift
Last active December 28, 2024 04:12
iOS, Swift: Create a PDF file from an HTML string.
// Thanks to http://www.labs.saachitech.com/2012/10/23/pdf-generation-using-uiprintpagerenderer
// Note: including images in the HTML won't work, see here:
// https://github.com/nyg/HTMLWithImagesToPDF
import UIKit
// 1. Create a print formatter
let html = "<b>Hello <i>World!</i></b>"
let fmt = UIMarkupTextPrintFormatter(markupText: html)
@alexrozanski
alexrozanski / PXProtocolMethodList.h
Last active February 22, 2017 10:09
Gets information about all methods that are defined in an Objective-C protocol. Returns an array of dictionaries with the selector and argument types for each method in NSString form.
#import <Foundation/Foundation.h>
extern NSString * const PXProtocolMethodListMethodNameKey;
extern NSString * const PXProtocolMethodListArgumentTypesKey;
NSArray *px_allProtocolMethods(Protocol *protocol);