mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 14:45:21 +00:00
cleanup/normalize method naming and braces
This commit is contained in:
@@ -40,8 +40,7 @@
|
|||||||
|
|
||||||
@implementation BITArrowImageAnnotation
|
@implementation BITArrowImageAnnotation
|
||||||
|
|
||||||
- (id)initWithFrame:(CGRect)frame
|
- (id)initWithFrame:(CGRect)frame {
|
||||||
{
|
|
||||||
self = [super initWithFrame:frame];
|
self = [super initWithFrame:frame];
|
||||||
if (self) {
|
if (self) {
|
||||||
self.shapeLayer = [CAShapeLayer layer];
|
self.shapeLayer = [CAShapeLayer layer];
|
||||||
@@ -196,7 +195,7 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-(void)layoutSubviews{
|
- (void)layoutSubviews{
|
||||||
[super layoutSubviews];
|
[super layoutSubviews];
|
||||||
|
|
||||||
[self buildShape];
|
[self buildShape];
|
||||||
|
|||||||
@@ -39,8 +39,7 @@
|
|||||||
|
|
||||||
@implementation BITBlurImageAnnotation
|
@implementation BITBlurImageAnnotation
|
||||||
|
|
||||||
- (id)initWithFrame:(CGRect)frame
|
- (id)initWithFrame:(CGRect)frame {
|
||||||
{
|
|
||||||
self = [super initWithFrame:frame];
|
self = [super initWithFrame:frame];
|
||||||
if (self) {
|
if (self) {
|
||||||
self.clipsToBounds = YES;
|
self.clipsToBounds = YES;
|
||||||
@@ -57,7 +56,7 @@
|
|||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
-(void)setSourceImage:(UIImage *)sourceImage {
|
- (void)setSourceImage:(UIImage *)sourceImage {
|
||||||
CGSize size = CGSizeMake(sourceImage.size.width/30, sourceImage.size.height/30);
|
CGSize size = CGSizeMake(sourceImage.size.width/30, sourceImage.size.height/30);
|
||||||
|
|
||||||
UIGraphicsBeginImageContext(size);
|
UIGraphicsBeginImageContext(size);
|
||||||
@@ -95,7 +94,7 @@
|
|||||||
[CATransaction commit];
|
[CATransaction commit];
|
||||||
}
|
}
|
||||||
|
|
||||||
-(BOOL)resizable {
|
- (BOOL)resizable {
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -274,7 +274,7 @@
|
|||||||
[super viewDidDisappear:animated];
|
[super viewDidDisappear:animated];
|
||||||
}
|
}
|
||||||
|
|
||||||
-(void)refreshAttachmentScrollview {
|
- (void)refreshAttachmentScrollview {
|
||||||
CGFloat scrollViewWidth = 0;
|
CGFloat scrollViewWidth = 0;
|
||||||
|
|
||||||
if (self.imageAttachments.count){
|
if (self.imageAttachments.count){
|
||||||
@@ -411,7 +411,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
-(void)addPhotoAction:(id)sender {
|
- (void)addPhotoAction:(id)sender {
|
||||||
if (_actionSheetVisible) return;
|
if (_actionSheetVisible) return;
|
||||||
|
|
||||||
// add photo.
|
// add photo.
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ typedef NS_ENUM(NSInteger, BITFeedbackMessageStatus) {
|
|||||||
|
|
||||||
@param object BITFeedbackMessageAttachment instance representing the attachment that should be added
|
@param object BITFeedbackMessageAttachment instance representing the attachment that should be added
|
||||||
*/
|
*/
|
||||||
-(void)addAttachmentsObject:(BITFeedbackMessageAttachment *)object;
|
- (void)addAttachmentsObject:(BITFeedbackMessageAttachment *)object;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Return the attachments that can be viewed
|
Return the attachments that can be viewed
|
||||||
|
|||||||
@@ -85,7 +85,7 @@
|
|||||||
|
|
||||||
#pragma mark - Deletion
|
#pragma mark - Deletion
|
||||||
|
|
||||||
-(void)deleteContents {
|
- (void)deleteContents {
|
||||||
for (BITFeedbackMessageAttachment *attachment in self.attachments){
|
for (BITFeedbackMessageAttachment *attachment in self.attachments){
|
||||||
[attachment deleteContents];
|
[attachment deleteContents];
|
||||||
}
|
}
|
||||||
@@ -103,7 +103,7 @@
|
|||||||
return returnArray;
|
return returnArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
-(void)addAttachmentsObject:(BITFeedbackMessageAttachment *)object{
|
- (void)addAttachmentsObject:(BITFeedbackMessageAttachment *)object{
|
||||||
if (!self.attachments){
|
if (!self.attachments){
|
||||||
self.attachments = [NSArray array];
|
self.attachments = [NSArray array];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
@property (nonatomic, weak) UIImage *sourceImage;
|
@property (nonatomic, weak) UIImage *sourceImage;
|
||||||
@property (nonatomic) CGRect imageFrame;
|
@property (nonatomic) CGRect imageFrame;
|
||||||
|
|
||||||
-(BOOL)resizable;
|
- (BOOL)resizable;
|
||||||
|
|
||||||
- (void)setSelected:(BOOL)selected;
|
- (void)setSelected:(BOOL)selected;
|
||||||
- (BOOL)isSelected;
|
- (BOOL)isSelected;
|
||||||
|
|||||||
@@ -65,8 +65,7 @@ typedef NS_ENUM(NSInteger, BITImageAnnotationViewControllerInteractionMode) {
|
|||||||
|
|
||||||
#pragma mark - UIViewController
|
#pragma mark - UIViewController
|
||||||
|
|
||||||
- (void)viewDidLoad
|
- (void)viewDidLoad {
|
||||||
{
|
|
||||||
[super viewDidLoad];
|
[super viewDidLoad];
|
||||||
|
|
||||||
self.view.backgroundColor = [UIColor groupTableViewBackgroundColor];
|
self.view.backgroundColor = [UIColor groupTableViewBackgroundColor];
|
||||||
@@ -163,7 +162,7 @@ typedef NS_ENUM(NSInteger, BITImageAnnotationViewControllerInteractionMode) {
|
|||||||
self.imageView.frame = baseFrame;
|
self.imageView.frame = baseFrame;
|
||||||
}
|
}
|
||||||
|
|
||||||
-(void)editingAction:(id)sender {
|
- (void)editingAction:(id)sender {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -246,8 +245,6 @@ typedef NS_ENUM(NSInteger, BITImageAnnotationViewControllerInteractionMode) {
|
|||||||
|
|
||||||
self.panStart = [gestureRecognizer locationInView:self.imageView];
|
self.panStart = [gestureRecognizer locationInView:self.imageView];
|
||||||
|
|
||||||
// [self.editingControls setSelectedSegmentIndex:UISegmentedControlNoSegment];
|
|
||||||
|
|
||||||
} else if (gestureRecognizer.state == UIGestureRecognizerStateChanged){
|
} else if (gestureRecognizer.state == UIGestureRecognizerStateChanged){
|
||||||
CGPoint bla = [gestureRecognizer locationInView:self.imageView];
|
CGPoint bla = [gestureRecognizer locationInView:self.imageView];
|
||||||
self.currentAnnotation.frame = CGRectMake(self.panStart.x, self.panStart.y, bla.x - self.panStart.x, bla.y - self.panStart.y);
|
self.currentAnnotation.frame = CGRectMake(self.panStart.x, self.panStart.y, bla.x - self.panStart.x, bla.y - self.panStart.y);
|
||||||
@@ -293,7 +290,7 @@ typedef NS_ENUM(NSInteger, BITImageAnnotationViewControllerInteractionMode) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
-(void)pinched:(UIPinchGestureRecognizer *)gestureRecognizer {
|
- (void)pinched:(UIPinchGestureRecognizer *)gestureRecognizer {
|
||||||
if (gestureRecognizer.state == UIGestureRecognizerStateBegan){
|
if (gestureRecognizer.state == UIGestureRecognizerStateBegan){
|
||||||
// try to figure out which view we are talking about.
|
// try to figure out which view we are talking about.
|
||||||
BITImageAnnotation *candidate = nil;
|
BITImageAnnotation *candidate = nil;
|
||||||
@@ -346,7 +343,7 @@ typedef NS_ENUM(NSInteger, BITImageAnnotationViewControllerInteractionMode) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
-(void)tapped:(UIGestureRecognizer *)tapRecognizer {
|
- (void)tapped:(UIGestureRecognizer *)tapRecognizer {
|
||||||
// This toggles the nav and status bar. Since iOS7 and pre-iOS7 behave weirdly different,
|
// This toggles the nav and status bar. Since iOS7 and pre-iOS7 behave weirdly different,
|
||||||
// this might look rather hacky, but hiding the navbar under iOS6 leads to some ugly
|
// this might look rather hacky, but hiding the navbar under iOS6 leads to some ugly
|
||||||
// animation effect which is avoided by simply hiding the navbar setting it's alpha to 0. // moritzh
|
// animation effect which is avoided by simply hiding the navbar setting it's alpha to 0. // moritzh
|
||||||
@@ -388,7 +385,7 @@ typedef NS_ENUM(NSInteger, BITImageAnnotationViewControllerInteractionMode) {
|
|||||||
|
|
||||||
#pragma mark - Helpers
|
#pragma mark - Helpers
|
||||||
|
|
||||||
-(UIView *)firstAnnotationThatIsNotBlur {
|
- (UIView *)firstAnnotationThatIsNotBlur {
|
||||||
for (BITImageAnnotation *annotation in self.imageView.subviews){
|
for (BITImageAnnotation *annotation in self.imageView.subviews){
|
||||||
if (![annotation isKindOfClass:[BITBlurImageAnnotation class]]){
|
if (![annotation isKindOfClass:[BITBlurImageAnnotation class]]){
|
||||||
return annotation;
|
return annotation;
|
||||||
|
|||||||
@@ -38,8 +38,7 @@
|
|||||||
|
|
||||||
@implementation BITRectangleImageAnnotation
|
@implementation BITRectangleImageAnnotation
|
||||||
|
|
||||||
- (id)initWithFrame:(CGRect)frame
|
- (id)initWithFrame:(CGRect)frame {
|
||||||
{
|
|
||||||
self = [super initWithFrame:frame];
|
self = [super initWithFrame:frame];
|
||||||
if (self) {
|
if (self) {
|
||||||
self.shapeLayer = [CAShapeLayer layer];
|
self.shapeLayer = [CAShapeLayer layer];
|
||||||
@@ -79,7 +78,7 @@
|
|||||||
[CATransaction commit];
|
[CATransaction commit];
|
||||||
}
|
}
|
||||||
|
|
||||||
-(BOOL)resizable {
|
- (BOOL)resizable {
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user