Skip to content

Instantly share code, notes, and snippets.

View wulongwang's full-sized avatar

wulongwang wulongwang

View GitHub Profile
@wulongwang
wulongwang / gist:c6a28494ef9449d9d4d7e7fef946063b
Created January 9, 2022 09:33 — forked from floriankugler/gist:6870499
Mapping of NSURLConnection to NSURLSession delegate methods. Created by Mattt Thompson.
NSURLConnection | NSURLSession
------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------
NSURLConnectionDelegate connectionShouldUseCredentialStorage: |
------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------
NSURLConnectionDelegate connection:willSendRequestForAuthenticationChallenge: | NSURLSessionDelegate URLSession:didReceiveChallenge:completionHandler:
| N
@wulongwang
wulongwang / class-hierarchy.py
Created May 6, 2023 10:45 — forked from timonus/class-hierarchy.py
Class Hierarchy Visualizer
import sys
import subprocess
import re
import os
import shutil
import json
# usage
# python class-hierarchy.py *directory to scan within*
# outputs nested json
@wulongwang
wulongwang / PSPDFUIKitMainThreadGuard.m
Created May 7, 2023 09:02 — forked from steipete/PSPDFUIKitMainThreadGuard.m
This is a guard that tracks down UIKit access on threads other than main. This snippet is taken from the commercial iOS PDF framework http://pspdfkit.com, but relicensed under MIT. Works because a lot of calls internally call setNeedsDisplay or setNeedsLayout. Won't catch everything, but it's very lightweight and usually does the job.You might n…
// Taken from the commercial iOS PDF framework http://pspdfkit.com.
// Copyright (c) 2014 Peter Steinberger, PSPDFKit GmbH. All rights reserved.
// Licensed under MIT (http://opensource.org/licenses/MIT)
//
// You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it.
// PLEASE DUPE rdar://27192338 (https://openradar.appspot.com/27192338) if you would like to see this in UIKit.
#import <objc/runtime.h>
#import <objc/message.h>