Skip to content

Instantly share code, notes, and snippets.

View bewebste's full-sized avatar

Brian Webster bewebste

View GitHub Profile
@bewebste
bewebste / wrapper.swift
Last active September 30, 2016 23:34
Swift 3 generic object wrapper gives EXC_BAD_ACCESS
//: Playground - noun: a place where people can play
import Cocoa
/*
I've been using an object like ObjectWrapper in Swift 2.x without any problems
to store a Swift struct as a property an Objective-C object, and then later
access and use that struct from other Swift code.
//
// NSObject+BlockObservation.h
// Version 1.0
//
// Andy Matuschak
// andy@andymatuschak.org
// Public domain because I love you. Let me know how you use it.
//
#import <Cocoa/Cocoa.h>