-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMyApplication.m
45 lines (37 loc) · 1.32 KB
/
MyApplication.m
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
40
41
42
43
44
45
//
// MyApplication.m
// FitnessElements
//
// Created by Ali Asadullah on 11/05/2015.
// Copyright (c) 2015 SwenggCo. All rights reserved.
//
#import "MyApplication.h"
#import "SignInViewController.h"
#import "PopupViewController.h"
#import "AppDelegate.h"
@implementation MyApplication
-(void)sendEvent:(UIEvent *)event
{
NSSet *set= event.allTouches;
NSArray *array=[set allObjects];
UITouch *touchEvent= [array lastObject];
UIView *view=[touchEvent view];
if([view isKindOfClass:[UIButton class]])
{
UIButton *button = (UIButton *)view;
for (id target in button.allTargets)
{
if (touchEvent.phase== UITouchPhaseEnded) {
PopupViewController *alertView = [[UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]]instantiateViewControllerWithIdentifier:@"PopupViewController"];
if([target isKindOfClass:[ABC class]] || [target isKindOfClass:[XYZ class]])
{
if([userNOTSignedIn]){
alertView.modalPresentationStyle = UIModalPresentationOverCurrentContext;
[target presentViewController:alertView animated:YES completion:NULL];
}
}
}
}
}
}
@end