diff --git a/Brokenithm-iOS.xcodeproj/project.pbxproj b/Brokenithm-iOS.xcodeproj/project.pbxproj index f38fe44..ad08881 100644 --- a/Brokenithm-iOS.xcodeproj/project.pbxproj +++ b/Brokenithm-iOS.xcodeproj/project.pbxproj @@ -335,7 +335,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 4; - DEVELOPMENT_TEAM = MXJJEEMF3U; + DEVELOPMENT_TEAM = K9CP5766XY; INFOPLIST_FILE = "Brokenithm-iOS/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = ( @@ -343,7 +343,7 @@ "@executable_path/Frameworks", ); MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = "com.estertion.brokenithm-ios"; + PRODUCT_BUNDLE_IDENTIFIER = com.estertion.brokenithm; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; TARGETED_DEVICE_FAMILY = "1,2"; @@ -359,7 +359,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 4; - DEVELOPMENT_TEAM = MXJJEEMF3U; + DEVELOPMENT_TEAM = K9CP5766XY; INFOPLIST_FILE = "Brokenithm-iOS/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = ( @@ -367,7 +367,7 @@ "@executable_path/Frameworks", ); MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = "com.estertion.brokenithm-ios"; + PRODUCT_BUNDLE_IDENTIFIER = com.estertion.brokenithm; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; TARGETED_DEVICE_FAMILY = "1,2"; diff --git a/Brokenithm-iOS/ViewController.h b/Brokenithm-iOS/ViewController.h index 65001e5..f8fd844 100644 --- a/Brokenithm-iOS/ViewController.h +++ b/Brokenithm-iOS/ViewController.h @@ -20,11 +20,11 @@ float screenWidth; float screenHeight; SocketDelegate *server; + UILabel *connectStatusView; + CAGradientLayer *ledBackground; } @property UIView *airIOView; @property UIView *sliderIOView; -@property UILabel *connectStatusView; -@property CAGradientLayer *ledBackground; -(void)updateLed:(NSData*)rgbData; -(void)updateTouches:(UIEvent *)event; diff --git a/Brokenithm-iOS/ViewController.m b/Brokenithm-iOS/ViewController.m index e0bd7c2..51d6c04 100644 --- a/Brokenithm-iOS/ViewController.m +++ b/Brokenithm-iOS/ViewController.m @@ -30,6 +30,7 @@ } */ + // io view CGRect screenSize = [UIScreen mainScreen].bounds; screenWidth = screenSize.size.width; screenHeight = screenSize.size.height; @@ -44,22 +45,26 @@ [self.view addSubview:self.airIOView]; [self.view addSubview:self.sliderIOView]; - self.connectStatusView = [[UILabel alloc] initWithFrame:CGRectMake(screenWidth - 200.0, screenHeight * 0.1, 200.0, 50.0)]; - self.connectStatusView.userInteractionEnabled = false; - self.connectStatusView.text = @"Not connected"; - self.connectStatusView.textAlignment = NSTextAlignmentCenter; - self.connectStatusView.textColor = [UIColor whiteColor]; - self.connectStatusView.numberOfLines = 1; - self.connectStatusView.backgroundColor = [UIColor blackColor]; - self.connectStatusView.layer.borderColor = [UIColor whiteColor].CGColor; - self.connectStatusView.layer.borderWidth = 1.0; - [self.view addSubview:self.connectStatusView]; + // connect status view + connectStatusView = [[UILabel alloc] initWithFrame:CGRectMake(screenWidth - 200.0, screenHeight * 0.1, 200.0, 50.0)]; + connectStatusView.userInteractionEnabled = false; + connectStatusView.text = @"Not connected"; + connectStatusView.textAlignment = NSTextAlignmentCenter; + connectStatusView.textColor = [UIColor whiteColor]; + connectStatusView.numberOfLines = 1; + connectStatusView.backgroundColor = [UIColor blackColor]; + connectStatusView.layer.borderColor = [UIColor whiteColor].CGColor; + connectStatusView.layer.borderWidth = 1.0; + [self.view addSubview:connectStatusView]; - self.ledBackground = [CAGradientLayer layer]; - self.ledBackground.frame = CGRectMake(0, 0, screenWidth, sliderHeight); - [self.sliderIOView.layer addSublayer:self.ledBackground]; - self.ledBackground.startPoint = CGPointMake(1,0); - self.ledBackground.endPoint = CGPointMake(0,0); + // function button view + + // led gradient layer + ledBackground = [CAGradientLayer layer]; + ledBackground.frame = CGRectMake(0, 0, screenWidth, sliderHeight); + [self.sliderIOView.layer addSublayer:ledBackground]; + ledBackground.startPoint = CGPointMake(1,0); + ledBackground.endPoint = CGPointMake(0,0); { float pointOffset = 0; float gapSmall = 1.0/16/8, gapBig = 1.0/16*6/8; @@ -73,7 +78,7 @@ pointOffset += gapSmall; } locations[48] = @1; - self.ledBackground.locations = locations; + ledBackground.locations = locations; } struct CGColor *gridBorderColor = [UIColor colorWithWhite:1.0 alpha:0.2].CGColor; @@ -122,8 +127,8 @@ off += (i+1)&1; colorArr[off] = (__bridge id)color.CGColor; } - self.ledBackground.colors = colorArr; - [self.ledBackground setNeedsDisplay]; + ledBackground.colors = colorArr; + [ledBackground setNeedsDisplay]; } -(BOOL)prefersStatusBarHidden { return kCFCoreFoundationVersionNumber < 1443.00; } @@ -181,11 +186,11 @@ -(void)hideStatus { pendingHideStatus = NO; [UIView animateWithDuration:0.5 animations:^{ - self.connectStatusView.frame = CGRectMake(self->screenWidth, self->screenHeight * 0.1, 200.0, 50.0); + self->connectStatusView.frame = CGRectMake(self->screenWidth, self->screenHeight * 0.1, 200.0, 50.0); }]; } -(void)connected { - self.connectStatusView.text = @"Connected"; + connectStatusView.text = @"Connected"; [self performSelector:@selector(hideStatus) withObject:nil afterDelay:3]; pendingHideStatus = YES; } @@ -193,9 +198,9 @@ if (pendingHideStatus) { [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(hideStatus) object:nil]; } - self.connectStatusView.text = @"Not connected"; + connectStatusView.text = @"Not connected"; [UIView animateWithDuration:0.3 animations:^{ - self.connectStatusView.frame = CGRectMake(self->screenWidth - 200.0, self->screenHeight * 0.1, 200.0, 50.0); + connectStatusView.frame = CGRectMake(self->screenWidth - 200.0, self->screenHeight * 0.1, 200.0, 50.0); }]; }