project_files/HedgewarsMobile/Classes/HelpPageLobbyViewController.m
branchios-revival
changeset 11120 83c0d96f86ea
child 11121 182a42b79610
equal deleted inserted replaced
11119:f08d5bb1d2b0 11120:83c0d96f86ea
       
     1 /*
       
     2  * Hedgewars-iOS, a Hedgewars port for iOS devices
       
     3  * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@gmail.com>
       
     4  *
       
     5  * This program is free software; you can redistribute it and/or modify
       
     6  * it under the terms of the GNU General Public License as published by
       
     7  * the Free Software Foundation; version 2 of the License
       
     8  *
       
     9  * This program is distributed in the hope that it will be useful,
       
    10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    12  * GNU General Public License for more details.
       
    13  *
       
    14  * You should have received a copy of the GNU General Public License
       
    15  * along with this program; if not, write to the Free Software
       
    16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
       
    17  */
       
    18 
       
    19 
       
    20 #import "HelpPageLobbyViewController.h"
       
    21 
       
    22 
       
    23 @implementation HelpPageLobbyViewController
       
    24 @synthesize scrollView;
       
    25 
       
    26 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
       
    27     return rotationManager(interfaceOrientation);
       
    28 }
       
    29 
       
    30 -(void) didReceiveMemoryWarning {
       
    31     [super didReceiveMemoryWarning];
       
    32     self.scrollView = nil;
       
    33 }
       
    34 
       
    35 // on iPhone the XIBs contain UIScrollView
       
    36 -(void) viewDidLoad {
       
    37     if (IS_IPAD() == NO){
       
    38         scrollView.contentSize = CGSizeMake(480,650);
       
    39         scrollView.maximumZoomScale = 4.0;
       
    40         scrollView.minimumZoomScale = 0.75;
       
    41         scrollView.clipsToBounds = YES;
       
    42         scrollView.delegate = self;
       
    43     }
       
    44     [super viewDidLoad];
       
    45 }
       
    46 
       
    47 -(void) viewDidUnload {
       
    48     [super viewDidUnload];
       
    49     self.scrollView = nil;
       
    50 }
       
    51 
       
    52 -(void) dealloc {
       
    53     releaseAndNil(scrollView);
       
    54     [super dealloc];
       
    55 }
       
    56 
       
    57 -(IBAction) dismiss {
       
    58     [UIView beginAnimations:@"dismiss help" context:NULL];
       
    59     self.view.alpha = 0;
       
    60     [UIView commitAnimations];
       
    61     [self.view performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:1];
       
    62 }
       
    63 
       
    64 @end