[ios] Minor codestyle fixes

This commit is contained in:
Alex Zolotarev 2012-09-26 13:29:01 +03:00 committed by Alex Zolotarev
parent e92cfddf34
commit 3fa05774a3
5 changed files with 42 additions and 39 deletions

View file

@ -37,6 +37,14 @@
isDisplayed = NO;
m_target = target;
m_selector = selector;
m_titleView = [[UIImageView alloc] init];
m_titleView.userInteractionEnabled = YES;
UITapGestureRecognizer * recognizer = [[[UITapGestureRecognizer alloc]
initWithTarget:m_target action:m_selector] autorelease];
recognizer.numberOfTapsRequired = 1;
recognizer.numberOfTouchesRequired = 1;
recognizer.delaysTouchesBegan = YES;
[m_titleView addGestureRecognizer:recognizer];
}
return self;
}
@ -112,20 +120,9 @@
- (void) showButtonsInView:(UIView *)view atPoint:(CGPoint)pt
{
[m_titleView release];
m_titleView = [[UIImageView alloc] initWithImage:[self createPopupImageWithName:self.title andAddress:self.description]];
CGSize const s = m_titleView.bounds.size;
m_titleView.frame = CGRectMake(pt.x, pt.y, 1, 1);
m_titleView.userInteractionEnabled = YES;
UITapGestureRecognizer * recognizer = [[UITapGestureRecognizer alloc]
initWithTarget:m_target action:m_selector];
recognizer.numberOfTapsRequired = 1;
recognizer.numberOfTouchesRequired = 1;
recognizer.delaysTouchesBegan = YES;
[m_titleView addGestureRecognizer:recognizer];
[recognizer release];
[view addSubview:m_titleView];
// Animate balloon from touched point

View file

@ -36,7 +36,7 @@
- (IBAction)OnSearchClicked:(id)sender;
- (IBAction)OnBookmarksClicked:(id)sender;
-(BOOL)OnProcessURL:(NSString*)url;
-(BOOL) OnProcessURL:(NSString*)url;
@property (nonatomic, retain) IBOutlet UIButton * m_myPositionButton;
@property (nonatomic, retain) IBOutlet UIButton * m_searchButton;

View file

@ -27,7 +27,7 @@
//********************************************************************************************
//*********************** Callbacks from LocationManager *************************************
- (void)onLocationStatusChanged:(location::TLocationStatus)newStatus
- (void) onLocationStatusChanged:(location::TLocationStatus)newStatus
{
GetFramework().OnLocationStatusChanged(newStatus);
switch (newStatus)
@ -64,12 +64,12 @@
}
}
- (void)onGpsUpdate:(location::GpsInfo const &)info
- (void) onGpsUpdate:(location::GpsInfo const &)info
{
GetFramework().OnGpsUpdate(info);
}
- (void)onCompassUpdate:(location::CompassInfo const &)info
- (void) onCompassUpdate:(location::CompassInfo const &)info
{
GetFramework().OnCompassUpdate(info);
}
@ -114,7 +114,7 @@
[navC release];
}
- (void)onBookmarkClicked
- (void) onBalloonClicked
{
PlacePageVC * placePageVC = [[PlacePageVC alloc] initWithBalloonView:m_bookmark];
[self.navigationController pushViewController:placePageVC animated:YES];
@ -224,7 +224,7 @@ NSInteger compareAddress(id l, id r, void * context)
return l < r;
}
- (void)updatePointsFromEvent:(UIEvent*)event
- (void) updatePointsFromEvent:(UIEvent*)event
{
NSSet * allTouches = [event allTouches];
@ -247,13 +247,13 @@ NSInteger compareAddress(id l, id r, void * context)
}
}
- (void)updateDataAfterScreenChanged
- (void) updateDataAfterScreenChanged
{
if (m_bookmark.isDisplayed)
[m_bookmark updatePosition:self.view atPoint:[self globalPoint2ViewPoint:m_bookmark.globalPosition]];
}
- (void)stopCurrentAction
- (void) stopCurrentAction
{
switch (m_CurrentAction)
{
@ -272,7 +272,7 @@ NSInteger compareAddress(id l, id r, void * context)
[self updateDataAfterScreenChanged];
}
- (void)touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event
- (void) touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event
{
// To cancel single tap timer
if (((UITouch *)[touches anyObject]).tapCount > 1)
@ -297,7 +297,7 @@ NSInteger compareAddress(id l, id r, void * context)
m_isSticking = true;
}
- (void)touchesMoved:(NSSet*)touches withEvent:(UIEvent*)event
- (void) touchesMoved:(NSSet*)touches withEvent:(UIEvent*)event
{
m2::PointD const TempPt1 = m_Pt1;
m2::PointD const TempPt2 = m_Pt2;
@ -346,7 +346,7 @@ NSInteger compareAddress(id l, id r, void * context)
[self updateDataAfterScreenChanged];
}
- (void)touchesEnded:(NSSet*)touches withEvent:(UIEvent*)event
- (void) touchesEnded:(NSSet*)touches withEvent:(UIEvent*)event
{
[self updatePointsFromEvent:event];
[self stopCurrentAction];
@ -372,7 +372,7 @@ NSInteger compareAddress(id l, id r, void * context)
[self updateDataAfterScreenChanged];
}
- (void)touchesCancelled:(NSSet*)touches withEvent:(UIEvent*)event
- (void) touchesCancelled:(NSSet*)touches withEvent:(UIEvent*)event
{
[self updatePointsFromEvent:event];
[self stopCurrentAction];
@ -385,13 +385,13 @@ NSInteger compareAddress(id l, id r, void * context)
return YES; // We support all orientations
}
- (void)didReceiveMemoryWarning
- (void) didReceiveMemoryWarning
{
GetFramework().MemoryWarning();
[super didReceiveMemoryWarning];
}
- (void)viewDidUnload
- (void) viewDidUnload
{
// to correctly release view on memory warnings
self.m_myPositionButton = nil;
@ -432,7 +432,7 @@ NSInteger compareAddress(id l, id r, void * context)
[self Invalidate]; // only invalidate when map is displayed on the screen
}
- (void)viewWillAppear:(BOOL)animated
- (void) viewWillAppear:(BOOL)animated
{
[self Invalidate];
// Update popup bookmark position
@ -440,7 +440,7 @@ NSInteger compareAddress(id l, id r, void * context)
[super viewWillAppear:animated];
}
- (void)viewWillDisappear:(BOOL)animated
- (void) viewWillDisappear:(BOOL)animated
{
GetFramework().SetUpdatesEnabled(false);
[super viewWillDisappear:animated];

View file

@ -2,20 +2,20 @@
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1024</int>
<string key="IBDocument.SystemVersion">11D50</string>
<string key="IBDocument.InterfaceBuilderVersion">2182</string>
<string key="IBDocument.AppKitVersion">1138.32</string>
<string key="IBDocument.HIToolboxVersion">568.00</string>
<string key="IBDocument.SystemVersion">12C54</string>
<string key="IBDocument.InterfaceBuilderVersion">2840</string>
<string key="IBDocument.AppKitVersion">1187.34</string>
<string key="IBDocument.HIToolboxVersion">625.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">1181</string>
<string key="NS.object.0">1926</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
<string>IBUICustomObject</string>
<string>IBUIViewController</string>
<string>IBUIButton</string>
<string>IBUIView</string>
<string>IBProxyObject</string>
<string>IBUIButton</string>
<string>IBUICustomObject</string>
<string>IBUIView</string>
<string>IBUIViewController</string>
</array>
<array key="IBDocument.PluginDependencies">
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
@ -47,6 +47,7 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{10, 435}, {40, 40}}</string>
<reference key="NSSuperview" ref="53915144"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="773974234"/>
<string key="NSReuseIdentifierKey">_NS:222</string>
<bool key="IBUIOpaque">NO</bool>
@ -95,6 +96,7 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{110, 435}, {40, 40}}</string>
<reference key="NSSuperview" ref="53915144"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="431157229"/>
<string key="NSReuseIdentifierKey">_NS:222</string>
<bool key="IBUIOpaque">NO</bool>
@ -124,6 +126,8 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{160, 435}, {40, 40}}</string>
<reference key="NSSuperview" ref="53915144"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:222</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
@ -152,6 +156,7 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{60, 435}, {40, 40}}</string>
<reference key="NSSuperview" ref="53915144"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="23888313"/>
<string key="NSReuseIdentifierKey">_NS:222</string>
<bool key="IBUIOpaque">NO</bool>
@ -179,6 +184,7 @@
</array>
<string key="NSFrame">{{0, 20}, {320, 480}}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="803813744"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">1</int>
@ -494,7 +500,7 @@
</object>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
<real value="1296" key="NS.object.0"/>
<real value="1536" key="NS.object.0"/>
</object>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
@ -513,6 +519,6 @@
<string key="search-highlighted.png">{48, 48}</string>
<string key="search.png">{48, 48}</string>
</dictionary>
<string key="IBCocoaTouchPluginVersion">1181</string>
<string key="IBCocoaTouchPluginVersion">1926</string>
</data>
</archive>

View file

@ -2124,7 +2124,6 @@
29B97314FDCFA39411CA2CEA /* Maps */ = {
isa = PBXGroup;
children = (
FA9EFCBE1609E150002D6195 /* Default-568h@2x.png */,
FA36B8011540388B004560CC /* Bookmarks */,
FA34BEC71338D6DB00FFB2A7 /* Common */,
FA6E1F1B124E6B2800F59149 /* Platform */,
@ -2193,6 +2192,7 @@
EEAF65E4134BCBD500A81C82 /* location-search@2x.png */,
49B3FB8B132FA43E00057053 /* location.png */,
49B3FB8C132FA43E00057053 /* location@2x.png */,
FA9EFCBE1609E150002D6195 /* Default-568h@2x.png */,
FA065FFD1286167A00FEA989 /* Default@2x.png */,
FA065FFE1286167A00FEA989 /* Default.png */,
28AD73870D9D96C1002E5188 /* MainWindow.xib */,