View PSPDFDefer.m
// Similar to defer in Swift
#define pspdf_defer_block_name_with_prefix(prefix, suffix) prefix ## suffix
#define pspdf_defer_block_name(suffix) pspdf_defer_block_name_with_prefix(pspdf_defer_, suffix)
#define pspdf_defer __strong void(^pspdf_defer_block_name(__LINE__))(void) __attribute__((cleanup(pspdf_defer_cleanup_block), unused)) = ^
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-function"
static void pspdf_defer_cleanup_block(__strong void(^*block)(void)) {
(*block)();
}
#pragma clang diagnostic pop
View SpringboardDestroyer.swift
let badwork = { (queue: DispatchQueue) in
queue.async {
let app = UIApplication.shared
for index in 0..<100000 {
let name = "Yolo \(index)"
let identifier = app.beginBackgroundTask(withName: name, expirationHandler: {
print("Expired")
});
View PreviewCrash.crash
Process: Preview [25413]
Path: /Applications/Preview.app/Contents/MacOS/Preview
Identifier: com.apple.Preview
Version: 9.0 (909.18)
Build Info: Preview-909018000000000~1
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Preview [25413]
User ID: 501
View PSPDFFastEnumeration.h
//
// PSPDFFastEnumeration.h
// PSPDFFoundation
//
// PSPDFKit is the leading cross-platform solution for integrating PDFs into your apps: https://pspdfkit.com.
// Try it today using our free PDF Viewer app: https://pdfviewer.io/
//
// This file is MIT licensed.
@protocol PSPDFFastEnumeration <NSFastEnumeration>
View PSPDFGenerics.h
//
// PSPDFGenerics.h
// PSPDFFoundation
//
// PSPDFKit is the leading cross-platform solution for integrating PDFs into your apps: https://pspdfkit.com.
// Try it today using our free PDF Viewer app: https://pdfviewer.io/
//
// This file is MIT licensed.
/**
View PSPDF_KEYPATH.m
#define PSPDF_KEYPATH(object, property) (^{ \
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wunreachable-code\"") \
_Pragma("clang diagnostic ignored \"-Wimplicit-retain-self\"") \
return ((void)(NO && ((void)object.property, NO)), @#property); \
_Pragma("clang diagnostic pop") \
}())
View gist:06d101d41c93763f7d5e394dea3c56fe
const NSUInteger test = 10u - 20u;
const NSInteger test2 = 10u - 20u;
const NSInteger test2_U = (NSUInteger)10 - (NSUInteger)20;
const NSUInteger test3 = 10 - 20;
const NSInteger test4 = 10 - 20;
const NSInteger test5 = 10u - 20;
64bit:
test NSUInteger 4294967286
test2 NSInteger 4294967286
View AvailailableAnalyzers
clang --version
Apple LLVM version 9.0.0 (clang-900.0.22.8)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
clang -cc1 -analyzer-checker-help
OVERVIEW: Clang Static Analyzer Checkers List
USAGE: -analyzer-checker <CHECKER or PACKAGE,...>
View gist:cdb0e9d62e18ab1de058e9c97dadc3f5
Incident Identifier: 45E2C1B6-A9E4-4A66-845F-9FD0CC4093A5
CrashReporter Key: 7B7C5ED8-8653-4CE2-96EA-269439F5D927
Hardware Model: iPad6,7
Process: Viewer [1583]
Path: /var/mobile/Containers/Bundle/Application/5CA518F4-8699-45FC-A706-CA4930EE3286/Viewer.app/Viewer
Identifier: com.pspdfkit.viewer
Version: 1.5.1 (1675)
Code Type: ARM-64
Parent Process: ??? [1]
View gist:c94e261ea107f76430e5c9286558b736
Incident Identifier: 19F77574-1A33-4357-91D2-777B579B2627
CrashReporter Key: 3DF5987A-DF10-41B3-B77A-03821D015B7B
Hardware Model: iPhone7,1
Process: Viewer [7455]
Path: /var/containers/Bundle/Application/AB688A6C-7BE0-4B6C-B079-B7BFDE56FD63/Viewer.app/Viewer
Identifier: com.pspdfkit.viewer
Version: 1.2.0 (1285)
Code Type: ARM-64
Parent Process: ??? [1]