[ios] Cleaned up Objective C code

This commit is contained in:
Alex Zolotarev 2011-10-23 02:54:13 +03:00 committed by Alex Zolotarev
parent 34533b9952
commit a062fb7106
8 changed files with 7 additions and 26 deletions

View file

@ -2,10 +2,6 @@
// Custom view which drows an arrow
@interface CompassView : UIView
{
float m_angle;
}
// Rotation angle in radians (decart system)
@property (nonatomic, assign) float angle;
@end

View file

@ -2,7 +2,7 @@
@implementation CompassView
@synthesize angle = m_angle;
@synthesize angle;
- (id)initWithFrame:(CGRect)frame
{
@ -15,9 +15,9 @@
return self;
}
- (void)setAngle:(float)angle
- (void)setAngle:(float)aAngle
{
m_angle = angle;
angle = aAngle;
[self setNeedsDisplay];
}
@ -38,7 +38,7 @@
[aPath closePath];
CGAffineTransform matrix = CGAffineTransformMakeTranslation(w2, w2);
matrix = CGAffineTransformRotate(matrix, -m_angle);
matrix = CGAffineTransformRotate(matrix, -angle);
matrix = CGAffineTransformTranslate(matrix, -w2, -w2);
[aPath applyTransform:matrix];

View file

@ -39,8 +39,6 @@ namespace yg
shared_ptr<iphone::WindowHandle> windowHandle;
shared_ptr<DrawerYG> drawer;
shared_ptr<iphone::RenderBuffer> renderBuffer;
MapViewController * controller;
}
// Called as a result of invalidate on iphone::WindowHandle

View file

@ -201,7 +201,7 @@ bool _inRepaint = false;
{
CGFloat const scale = self.contentScaleFactor;
CGSize const s = self.frame.size;
[self.controller onResize:s.width * scale withHeight:s.height * scale];
[controller onResize:s.width * scale withHeight:s.height * scale];
[self onSize:s.width * scale withHeight:s.height * scale];
}

View file

@ -24,10 +24,7 @@
m2::PointD m_Pt1, m_Pt2;
UIButton * m_myPositionButton;
NSTimer * m_iconTimer;
bool m_mapIsVisible;
}
- (void) ZoomToRect: (m2::RectD const &) rect;

View file

@ -118,8 +118,6 @@ storage::Storage m_storage;
{
if ((self = [super initWithCoder:coder]))
{
m_mapIsVisible = false;
[(EAGLView*)self.view setController : self];
shared_ptr<iphone::WindowHandle> windowHandle = [(EAGLView*)self.view windowHandle];
@ -355,8 +353,8 @@ NSInteger compareAddress(id l, id r, void * context)
- (void) OnEnterForeground
{
m_framework->EnterForeground();
if (m_mapIsVisible)
[self Invalidate];
if (self.isViewLoaded && self.view.window)
[self Invalidate]; // only invalidate when map is displayed on the screen
}
- (void)viewWillAppear:(BOOL)animated
@ -365,7 +363,6 @@ NSInteger compareAddress(id l, id r, void * context)
// and orientation changes when mapVC is not visible
[self.view layoutSubviews];
m_mapIsVisible = true;
[self Invalidate];
[self.navigationController setNavigationBarHidden:YES animated:YES];
[super viewWillAppear:animated];
@ -373,7 +370,6 @@ NSInteger compareAddress(id l, id r, void * context)
- (void)viewWillDisappear:(BOOL)animated
{
m_mapIsVisible = false;
m_framework->SetUpdatesEnabled(false);
[self.navigationController setNavigationBarHidden:NO animated:YES];
[super viewWillDisappear:animated];

View file

@ -6,12 +6,8 @@
@interface MapsAppDelegate : NSObject <UIApplicationDelegate>
{
UINavigationController * m_navigationController;
UIWindow * m_window;
MapViewController * m_mapViewController;
SettingsManager * m_settingsManager;
NSInteger m_standbyCounter;
LocationManager * m_locationManager;
}
@property (nonatomic, retain) IBOutlet UINavigationController * m_navigationController;

View file

@ -21,8 +21,6 @@ typedef Framework<model::FeaturesFetcher> framework_t;
framework_t * m_framework;
LocationManager * m_locationManager;
vector<search::Result> m_results;
UISearchBar * m_searchBar;
UITableView * m_table;
UILabel * m_warningView;
/// Warning view shows only if this text is not nil
NSString * m_warningViewText;