Skip to content

Instantly share code, notes, and snippets.

View mrdaios's full-sized avatar
🐢

Xie Wu mrdaios

🐢
  • China, Chengdu
View GitHub Profile
//
// SimpleScrollingStack.swift
// A super-simple demo of a scrolling UIStackView in iOS 9
//
// Created by Paul Hudson on 10/06/2015.
// Learn Swift at www.hackingwithswift.com
// @twostraws
//
import UIKit
@bang590
bang590 / linkmap.js
Last active August 19, 2023 15:24
XCode Linkmap Parser
var readline = require('readline'),
fs = require('fs');
var LinkMap = function(filePath) {
this.files = []
this.filePath = filePath
}
LinkMap.prototype = {
start: function(cb) {
@hooman
hooman / AssociatedObjects.swift
Last active May 4, 2022 07:33
Take 2.0: A completely new take on Objective-C associated types. (See history for the ancient approach)
// Playground - noun: a place where people can play
//
//
// By: Hooman Mehr (hooman@mac.com)
// Gist: https://gist.github.com/hooman/599e381d5f037b87d20b (The latest version is always here)
//
//
// Update: 07/30/2014
// Added WeaklyOwned & removeOrphans for memory management support, added more generics & basic access control.
// 08/06/2014
@andelf
andelf / Swift.text
Created June 20, 2014 08:51
Swift Standard Library .swiftmodule Dump
Swift
LLVM 3.5svn
/SourceCache/compiler_KLONDIKE/compiler_KLONDIKE-600.0.34.4.8/src/tools/swift/stdlib/core/Algorithm.swift
/SourceCache/compiler_KLONDIKE/compiler_KLONDIKE-600.0.34.4.8/src/tools/swift/stdlib/core/ArrayBody.swift
/SourceCache/compiler_KLONDIKE/compiler_KLONDIKE-600.0.34.4.8/src/tools/swift/stdlib/core/ArrayBuffer.swift
/SourceCache/compiler_KLONDIKE/compiler_KLONDIKE-600.0.34.4.8/src/tools/swift/stdlib/core/ArrayBufferType.swift
/SourceCache/compiler_KLONDIKE/compiler_KLONDIKE-600.0.34.4.8/src/tools/swift/stdlib/core/ArrayType.swift
/BinaryCache/compiler_KLONDIKE/compiler_KLONDIKE-600.0.34.4.8~2/Objects/stdlib/macosx-10.9-internal-x86_64/stdlib/core/Arrays.swift
/SourceCache/compiler_KLONDIKE/compiler_KLONDIKE-600.0.34.4.8/src/tools/swift/stdlib/core/Assert.swift
/SourceCache/compiler_KLONDIKE/compiler_KLONDIKE-600.0.34.4.8/src/tools/swift/stdlib/core/AssertCommon.swift
@andreacremaschi
andreacremaschi / UITableView+Header
Last active June 28, 2020 04:19
UITableView category to resize table view header using autolayout
UITableView convenience classes for resizing header and footer with autolayout.
@bobmoff
bobmoff / UIView+RoundedCorners.h
Created July 10, 2013 15:23
Add rounded corners to any view using layer mask.
#import <UIKit/UIKit.h>
@interface UIView (RoundedCorners)
- (void)setRoundedCorners:(UIRectCorner)corners radius:(CGSize)size;
@end
@mattt
mattt / uiappearance-selector.md
Last active March 19, 2024 12:52
A list of methods and properties conforming to `UIAppearance` as of iOS 12 Beta 3

Generate the list yourself:

$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS*.sdk/System/Library/Frameworks/UIKit.framework/Headers
$ grep UI_APPEARANCE_SELECTOR ./*     | \
  sed 's/NS_AVAILABLE_IOS(.*)//g'     | \
  sed 's/NS_DEPRECATED_IOS(.*)//g'    | \
  sed 's/API_AVAILABLE(.*)//g'        | \
  sed 's/API_UNAVAILABLE(.*)//g'      | \
 sed 's/UI_APPEARANCE_SELECTOR//g' | \
@spilliams
spilliams / SWAppDelegate.h
Created January 18, 2013 02:08
lock state notifications test
//
// SWAppDelegate.h
// lockstatenotificationstest
//
// Created by Spencer Williams on 1/17/13.
// Copyright (c) 2013 Spencer Williams. All rights reserved.
//
#import <UIKit/UIKit.h>
@sekati
sekati / xcode-build-bump.sh
Created July 24, 2012 20:44
Xcode Auto-increment Build & Version Numbers
# xcode-build-bump.sh
# @desc Auto-increment the build number every time the project is run.
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Drag the "Run Script" below "Link Binaries With Libraries"
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0)
@iamleeg
iamleeg / main.mm
Created March 24, 2012 00:23
Using operator overloading with Objective-C. Erm, ++.
#include "objc_id.hpp"
int main(int argc, const char * argv[])
{
@autoreleasepool {
NSString *s1 = @"hello";
NSString *s2 = [@"hell" stringByAppendingString: @"o"];
if ((objc_id(s1) == objc_id(s2))) {
NSLog(@"win");