Last active
July 7, 2024 09:01
-
-
Save jamztang/7183939 to your computer and use it in GitHub Desktop.
My first hackathon experience - 12 hours of hacking and building the essentials.
https://medium.com/p/3db44088db70
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)viewDidLoad { | |
[super viewDidLoad]; | |
self.videoCamera = [[GPUImageVideoCamera alloc] initWithSessionPreset:AVCaptureSessionPreset640x480 cameraPosition:AVCaptureDevicePositionFront]; | |
self.videoCamera.outputImageOrientation = UIInterfaceOrientationPortrait; | |
// self.avatarView is a non full screen GPUImageView instance | |
// created in Storyboard | |
[self.videoCamera addTarget:self.avatarView]; | |
[self.videoCamera startCameraCapture]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
self.blurFilter = ({ | |
GPUImageGaussianBlurFilter *blurFilter = [[GPUImageGaussianBlurFilter alloc] init]; | |
blurFilter.blurSize = 8; | |
blurFilter; | |
}); | |
self.videoCamera addTarget:self.blurFilter]; | |
// self.blurView is a fullscreen GPUImageView instance configured in Storyboard | |
[self.blurFilter addTarget:self.blurView]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
self.avatarView.layer.cornerRadius = self.avatarView.frame.size.width/2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)viewDidLoad { | |
[super viewDidLoad]; | |
__weak typeof (self) weakSelf = self; | |
[self.view addKeyboardPanningWithActionHandler:^(CGRect | |
keyboardFrameInView) { | |
// Becareful of the retain cycle and use weakSelf instead of self | |
// when you need to add custom logic in code. | |
CGRect tableViewFrame = weakSelf.messageView.frame; | |
tableViewFrame.size.height = toolBarFrame.origin.y; | |
weakSelf.messageView.frame = tableViewFrame; | |
}]; | |
} | |
- (void)dealloc { | |
[self.view removeKeyboardControl]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment