Skip to content

Commit

Permalink
Format iOS source
Browse files Browse the repository at this point in the history
  • Loading branch information
hansemannn committed May 3, 2018
1 parent 98757b7 commit f79f179
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 62 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ android/launch-*
android/java-sources.txt
nbproject
/ios/metadata.json
/ios/dist
13 changes: 6 additions & 7 deletions ios/Classes/TiMapMarkerAnnotationView.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@
*/
#if IS_IOS_11
#import "TiBase.h"
#import <MapKit/MapKit.h>
#import "TiMapView.h"
#import <MapKit/MapKit.h>

@interface TiMapMarkerAnnotationView : MKMarkerAnnotationView<TiMapAnnotation>
{
@private
NSString *lastHitName;
@interface TiMapMarkerAnnotationView : MKMarkerAnnotationView <TiMapAnnotation> {
@private
NSString *lastHitName;
}

-(id)initWithAnnotation:(id<MKAnnotation>)annotation reuseIdentifier:(NSString *)reuseIdentifier map:(TiMapView *)map;
-(NSString *)lastHitName;
- (id)initWithAnnotation:(id<MKAnnotation>)annotation reuseIdentifier:(NSString *)reuseIdentifier map:(TiMapView *)map;
- (NSString *)lastHitName;

@end
#endif
78 changes: 39 additions & 39 deletions ios/Classes/TiMapMarkerAnnotationView.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,57 +10,57 @@

@implementation TiMapMarkerAnnotationView

-(id)initWithAnnotation:(id<MKAnnotation>)annotation reuseIdentifier:(NSString *)reuseIdentifier map:(TiMapView *)map_
- (id)initWithAnnotation:(id<MKAnnotation>)annotation reuseIdentifier:(NSString *)reuseIdentifier map:(TiMapView *)map_
{
if (self = [super initWithAnnotation:annotation reuseIdentifier:reuseIdentifier]) {
}
return self;
if (self = [super initWithAnnotation:annotation reuseIdentifier:reuseIdentifier]) {
}
return self;
}

-(void)dealloc
- (void)dealloc
{
RELEASE_TO_NIL(lastHitName);
[super dealloc];
RELEASE_TO_NIL(lastHitName);
[super dealloc];
}

-(NSString *)lastHitName
- (NSString *)lastHitName
{
NSString * result = lastHitName;
[lastHitName autorelease];
lastHitName = nil;
return result;
NSString *result = lastHitName;
[lastHitName autorelease];
lastHitName = nil;
return result;
}

- (UIView *)hitTest:(CGPoint) point withEvent:(UIEvent *)event
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
{
UIView * result = [super hitTest:point withEvent:event];

if (result == nil) {
for (UIView *ourSubView in [self subviews]) {
CGPoint subPoint = [self convertPoint:point toView:ourSubView];
for (UIView *ourSubSubView in [ourSubView subviews]) {
if (CGRectContainsPoint([ourSubSubView frame], subPoint) &&
[ourSubSubView isKindOfClass:[UILabel class]]) {
NSString * labelText = [(UILabel *)ourSubSubView text];
TiMapAnnotationProxy * ourProxy = (TiMapAnnotationProxy *)[self annotation];
RELEASE_TO_NIL(lastHitName);
if ([labelText isEqualToString:[ourProxy title]]) {
lastHitName = [@"title" retain];
} else if ([labelText isEqualToString:[ourProxy subtitle]]) {
lastHitName = [@"subtitle" retain];
}
return nil;
}
}
if (CGRectContainsPoint([ourSubView bounds], subPoint)) {
RELEASE_TO_NIL(lastHitName);
lastHitName = [@"annotation" retain];
return nil;
}
UIView *result = [super hitTest:point withEvent:event];

if (result == nil) {
for (UIView *ourSubView in [self subviews]) {
CGPoint subPoint = [self convertPoint:point toView:ourSubView];
for (UIView *ourSubSubView in [ourSubView subviews]) {
if (CGRectContainsPoint([ourSubSubView frame], subPoint) &&
[ourSubSubView isKindOfClass:[UILabel class]]) {
NSString *labelText = [(UILabel *)ourSubSubView text];
TiMapAnnotationProxy *ourProxy = (TiMapAnnotationProxy *)[self annotation];
RELEASE_TO_NIL(lastHitName);
if ([labelText isEqualToString:[ourProxy title]]) {
lastHitName = [@"title" retain];
} else if ([labelText isEqualToString:[ourProxy subtitle]]) {
lastHitName = [@"subtitle" retain];
}
return nil;
}
}
if (CGRectContainsPoint([ourSubView bounds], subPoint)) {
RELEASE_TO_NIL(lastHitName);
lastHitName = [@"annotation" retain];
return nil;
}
}
RELEASE_TO_NIL(lastHitName);
return result;
}
RELEASE_TO_NIL(lastHitName);
return result;
}
@end
#endif
7 changes: 3 additions & 4 deletions ios/Classes/TiMapModuleAssets.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
* This is a generated file. Do not edit or your changes will be lost
*/

@interface TiMapModuleAssets : NSObject
{
@interface TiMapModuleAssets : NSObject {
}
- (NSData*) moduleAsset;
- (NSData*) resolveModuleAsset:(NSString*)path;
- (NSData *)moduleAsset;
- (NSData *)resolveModuleAsset:(NSString *)path;

@end
8 changes: 4 additions & 4 deletions ios/Classes/TiMapOverlayPattern.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
// Created by Hans Knöchel on 04.07.17.
//

#import <Foundation/Foundation.h>
#import "TiMapConstants.h"
#import <Foundation/Foundation.h>

@interface TiMapOverlayPattern : NSObject

- (instancetype)initWithPatternType:(TiMapOverlyPatternType)patternType andGapLength:(NSInteger)gapLength dashLength:(NSInteger)dashLength;

@property(nonatomic, assign, readonly) TiMapOverlyPatternType type;
@property(nonatomic, assign, readonly) NSInteger gapLength;
@property(nonatomic, assign, readonly) NSInteger dashLength;
@property (nonatomic, assign, readonly) TiMapOverlyPatternType type;
@property (nonatomic, assign, readonly) NSInteger gapLength;
@property (nonatomic, assign, readonly) NSInteger dashLength;

@end
16 changes: 8 additions & 8 deletions ios/Classes/TiMapOverlayPattern.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ @implementation TiMapOverlayPattern

- (instancetype)initWithPatternType:(TiMapOverlyPatternType)patternType andGapLength:(NSInteger)gapLength dashLength:(NSInteger)dashLength
{
if (self = [super init]) {
_type = patternType;
_dashLength = dashLength;
_gapLength = gapLength;
}
return self;
if (self = [super init]) {
_type = patternType;
_dashLength = dashLength;
_gapLength = gapLength;
}

return self;
}

@end

0 comments on commit f79f179

Please sign in to comment.