forked from natanrolnik/NRTouchPoints
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUITouch+NRTouch.m
More file actions
26 lines (19 loc) · 729 Bytes
/
UITouch+NRTouch.m
File metadata and controls
26 lines (19 loc) · 729 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//
// UITouch+NRTouch.m
// NRTouchPoints
//
// Created by Natan Rolnik on 06/12/13.
// Copyright (c) 2013 Natan Rolnik. All rights reserved.
//
//solution from http://stackoverflow.com/a/14899909/675486 and http://oleb.net/blog/2011/05/faking-ivars-in-objc-categories-with-associative-references/
#import "UITouch+NRTouch.h"
#import <objc/runtime.h>
static void * TouchImageViewKey;
@implementation UITouch (NRTouch)
- (UIView *)touchRepresentationView {
return objc_getAssociatedObject(self, TouchImageViewKey);
}
- (void)setTouchRepresentationView:(UIView *)newTouchRepresentationView {
objc_setAssociatedObject(self, TouchImageViewKey, newTouchRepresentationView, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
@end