minivmac4ios/Mini vMac/ViewController.m

48 lines
1.1 KiB
Mathematica
Raw Normal View History

2016-04-27 20:52:28 +00:00
//
// ViewController.m
// Mini vMac
//
// Created by Jesús A. Álvarez on 27/04/2016.
// Copyright © 2016 namedfork. All rights reserved.
//
#import "ViewController.h"
2016-05-01 21:44:47 +00:00
#import "TouchScreen.h"
2016-05-11 21:04:49 +00:00
#import "AppDelegate.h"
2016-04-27 20:52:28 +00:00
@interface ViewController ()
@end
@implementation ViewController
2016-05-01 21:44:47 +00:00
{
UIControl *pointingDeviceView;
}
2016-04-27 20:52:28 +00:00
2016-05-01 17:05:36 +00:00
- (BOOL)prefersStatusBarHidden {
return YES;
2016-04-27 20:52:28 +00:00
}
2016-05-01 21:44:47 +00:00
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
[self setUpPointingDevice];
}
- (void)setUpPointingDevice {
if (pointingDeviceView) {
[pointingDeviceView removeFromSuperview];
pointingDeviceView = nil;
}
pointingDeviceView = [[TouchScreen alloc] initWithFrame:self.view.bounds];
pointingDeviceView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
[self.view insertSubview:pointingDeviceView aboveSubview:self.screenView];
}
2016-05-11 21:04:49 +00:00
- (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event {
if (motion == UIEventSubtypeMotionShake) {
[[AppDelegate sharedInstance] showInsertDisk:self];
}
}
2016-04-27 20:52:28 +00:00
@end