Skip to content

Instantly share code, notes, and snippets.

JasonY iJasonY

View GitHub Profile
Skifary / main.m
Last active Jul 3, 2020
View main.m
#import <Foundation/Foundation.h>
#import "ffi.h"
NSMutableArray *g_allocations;
ffi_cif g_cif;
ffi_closure *g_closure;
void *g_replacement_invoke;
void *g_origin_invoke;
Skifary / main.m
Last active Jul 3, 2020
View main.m
#import <Foundation/Foundation.h>
typedef struct __block_impl {
void *isa;
int Flags;
int Reserved;
void *FuncPtr;
typedef void(^GlobalBlock)(void);
OliverLetterer / XCDUUID.m
Created Jan 26, 2013
With this gist, I, as a total assembly noob, am trying to understand the XCDUUID runtime hack ( to be able to use NSUUID on iOS < 6.0.
@implementation XCDUUID
+ (void) load
// query runtime if NSUUID class already exists, if so => done
if (objc_getClass("NSUUID"))
View PSPDFFastEnumeration.h
// PSPDFFastEnumeration.h
// PSPDFFoundation
// PSPDFKit is the leading cross-platform solution for integrating PDFs into your apps:
// Try it today using our free PDF Viewer app:
// This file is MIT licensed.
@protocol PSPDFFastEnumeration <NSFastEnumeration>
josephchang10 / blockchain.swift
Created Dec 27, 2017
在 iOS 中实现区块链
View blockchain.swift
import Cocoa
import Foundation
class Block {
var index: Int = 0
var dateCreated: String
var previousHash: String!
var hash: String!
var nonce: Int
Josscii / iOS
Last active Apr 29, 2018
iOS Navigation Related Cheat Sheet
View iOS

iOS Navigation Related Cheat Sheet


每个 vc 都有自己的 navigationItem。

// 隐藏 push 的下一个 vc 的 back title。
navigationItem.backBarButtonItem = UIBarButtonItem(title: "", style: .plain, target: nil, action: nil)
josephchang10 / ReviewRequest.swift
Created Aug 12, 2017
从 iOS 10.3 开始请求应用商店评分的正确姿势:SKStoreReviewController
View ReviewRequest.swift
// ReviewRequest.swift
// Created by 张嘉夫 on 12/8/17.
// Copyright © 2017 张嘉夫. All rights reserved.
import Foundation
import StoreKit
let runIncrementerSetting = "numberOfRuns" // 用于存储运行次数的 UserDefauls 字典键
You can’t perform that action at this time.