title: Objective-C. How is your first SKScene initialised?
body: <p>This method sets up the initial scene and is called as soon as the application opens:</p>
  
  <pre><code> #import "GameScene.h"
      #import "WarScene.h"
      #import "Math.h"
  
      @implementation GameScene
      {
          SKNode *map;
          float oldY;
          float oldX;
          BOOL buttonClicked;
          int thisButton;
          float oldMapPosition;
          float midScreenX;
      float midScreenY;
      int separation;
      float sendY;
      BOOL interacting;
      CGVector speed;
      float oldPosition;
      float newPosition;
      BOOL isReleased;
      int iterations;
      float diff;
      BOOL comeToStop;
      BOOL actualStop;
      BOOL clicked;
  }
  
  int numberOfLevels = 20;
  
  -(void)didMoveToView:(SKView *)view {
  
      /* Setup your scene here */
      map = [SKNode node];
  
      separation = [UIScreen mainScreen].bounds.size.height;
  
      if (UIDeviceOrientationIsLandscape((UIDeviceOrientation)[[UIApplication sharedApplication] statusBarOrientation]))
      {
          //landscape mode
          midScreenX = ([[UIScreen mainScreen]bounds].size.width&gt;[[UIScreen mainScreen]bounds].size.height?[[UIScreen mainScreen]bounds].size.width:[[UIScreen mainScreen]bounds].size.height)/2;
          midScreenY = ([[UIScreen mainScreen]bounds].size.width&lt;[[UIScreen mainScreen]bounds].size.height?[[UIScreen mainScreen]bounds].size.width:[[UIScreen mainScreen]bounds].size.height)/2;
      }
      else
      {
          //portrait mode
          midScreenX = [[UIScreen mainScreen]bounds].size.width/2;
          midScreenY = [[UIScreen mainScreen]bounds].size.height/2;
      }
  
      NSLog(@"Initial Width: %f Height: %f", midScreenX*2, midScreenY*2);
  
      map.physicsBody = [SKPhysicsBody bodyWithRectangleOfSize: CGSizeMake([UIScreen mainScreen].bounds.size.width, separation*(numberOfLevels+1))];
      map.physicsBody.affectedByGravity = NO;
      map.physicsBody.allowsRotation = NO;
  
      clicked = NO;
  
      UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(handleTap:)];
      tap.numberOfTapsRequired = 1;
  
      [self.view addGestureRecognizer:tap];
  
      self.backgroundColor = [SKColor blackColor];
  
      for (int i = 0; i&lt;numberOfLevels; i += 1) {
          SKLabelNode *title;
          {
              title = [SKLabelNode labelNodeWithFontNamed:@"Cochin"];
              title.text = [NSString stringWithFormat: @"Level %d", 1+i];
              title.fontSize = 60;
              title.position = CGPointMake(CGRectGetMidX(self.frame),
                                           ((i+1)*separation));
              title.fontColor = [UIColor whiteColor];
              title.name = [NSString stringWithFormat: @"Level %d", 1+i];
  
              [map addChild:title];
          }
      }
      [self addChild:map];
  
       }
  </code></pre>
  
  <p>This works exactly as I intended it to, however, when I call this from another class:</p>
  
  <pre><code>-(void)continueMethod:(UIButton*)button{
  
      NSLog(@"InitwithSize to GameScene Width: %f Height: %f", midScreenX*2, midScreenY*2);
      GameScene *map = [[GameScene alloc] initWithSize: CGSizeMake(midScreenX*2 ,midScreenY*2)];
      SKTransition *reveal = [SKTransition revealWithDirection:SKTransitionDirectionDown duration:1.0];
      SKView * skView = (SKView *)self.view;
      UIView *viewToRemove = [self.view viewWithTag:3];
      [viewToRemove removeFromSuperview];
      [skView presentScene:map transition:reveal];
  }
  </code></pre>
  
  <p>The scene which should be set up doesn't appear as I intended it to, or indeed how it used to look the last time that it was initialised. The separation variable appears bigger, the text appears bigger and everything is wider. I've verified that the UIScreen that I have initialised is exactly the same throughout.</p>
  
  <p>This led me to question how the initial scene of a SKSprite application comes to be and whether it is different to "initWithSize:" however, looking through all the code that comes in the game template I can't ever see my first scene get called. The closest that I can find to initWithSize: is the following from the GameViewController- </p>
  
  <pre><code>GameScene *scene = [GameScene unarchiveFromFile:@"GameScene"];
      scene.scaleMode = SKSceneScaleModeAspectFill;
  </code></pre>
  
  <p>Firstly, is this what is initialising my initial scene? Secondly is it in anyway different to initWithSize: ? And finally if the answer to the previous tow questions is yes, should it be used instead of initWithsize: ?</p>