Skip to content

Instantly share code, notes, and snippets.

@mikehaytm
mikehaytm / CocoaMethodsRaiseiOS9.txt
Last active January 6, 2016 14:09
Handle With Care: Cocoa methods and properties that may raise exceptions.
CLASS METHODS
+[AVCaptureDevice requestAccessForMediaType:completionHandler:]
+[AVCaptureStillImageOutput jpegStillImageNSDataRepresentation:]
+[HKCategorySample categorySampleWithType:value:startDate:endDate:]
+[HKCategorySample categorySampleWithType:value:startDate:endDate:device:metadata:]
+[HKCategorySample categorySampleWithType:value:startDate:endDate:metadata:]
+[HKCorrelation correlationWithType:startDate:endDate:objects:]
+[HKCorrelation correlationWithType:startDate:endDate:objects:device:metadata:]
+[HKCorrelation correlationWithType:startDate:endDate:objects:metadata:]
+[HKQuantitySample quantitySampleWithType:quantity:startDate:endDate:]
@AvdLee
AvdLee / DarwinNotificationCenter.swift
Last active March 25, 2025 19:09
A notification center for Darwin Notifications. MIT License applies.
//
// DarwinNotificationCenter.swift
//
// Copyright © 2017 WeTransfer. All rights reserved.
//
import Foundation
/// A Darwin notification payload. It does not contain any userInfo, a Darwin notification is purely event handling.
public struct DarwinNotification {