-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCustomButton.m
More file actions
39 lines (32 loc) · 1.03 KB
/
CustomButton.m
File metadata and controls
39 lines (32 loc) · 1.03 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
//
// CustomButton.m
// VolOver
//
// Created by Owen McGirr on 14/03/2013.
// Copyright (c) 2013 Owen McGirr. All rights reserved.
//
#import "CustomButton.h"
NSString *AccessibilityElementFocusNotification = @"AccessibilityElementFocusNotification";
NSString *AccessibilityElementLostFocusNotification = @"AccessibilityElementLostFocusNotification";
@implementation CustomButton
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
// Initialization code
}
return self;
}
- (void)accessibilityElementDidBecomeFocused {
[[NSNotificationCenter defaultCenter] postNotificationName:AccessibilityElementFocusNotification object:self userInfo:nil];
self.highlighted = YES;
}
- (void)accessibilityElementDidLoseFocus {
[[NSNotificationCenter defaultCenter] postNotificationName:AccessibilityElementLostFocusNotification object:self userInfo:nil];
self.highlighted = NO;
}
- (void)checkHighlight:(id)btn
{
self.highlighted = [self accessibilityElementIsFocused];
}
@end