title: Unable to make a custom dialog for Spritekit swift
body: <p>I'm currently having a problem with making a popup dialog for the spritekit game. What I want to do is to show a custom dialog that shows up when the game start button is pressed. I was able to make the custom dialog , but the problem is how to make a button for this custom dialog that extends a UIView to transition to the other Scene ?  This code below will make the dialog apear in the title scene when the start button is selected </p>
  
  <pre><code>let dialog = CustomDialog(scene: self, frame:CGRectMake(0, 0, self.view!.bounds.maxX - 50, 300))
      self.view!.addSubview(dialog)
  </code></pre>
  
  <p>But how can I implement this script within the CustomDialog class ?</p>
  
  <pre><code> let scene = GameStartedScene(size: self.size)
              scene.scaleMode = SKSceneScaleMode.AspectFill
              skview.presentScene(scene)
  </code></pre>
  
  <p>The code below is the CustomDialog class , Is there a way to make this class to transition to other scene ? Since I'm new to swift and spritekit , It would be a honor if I can have some sample or hints.</p>
  
  <pre><code>import UIKit
  import SpriteKit
  
  class CustomDialog : UIView{
  
      var backGroundView : UIView!
      var scene : SKScene!
  
      required init(coder aDecoder: NSCoder) {
          super.init(coder: aDecoder)
      }
  
      init(scene : SKScene,frame : CGRect){
          super.init(frame: scene.view!.bounds)
  
  
          self.scene = scene
  
  
          self.scene.view!.paused = true
  
  
          self.scene.userInteractionEnabled = false
  
          self.layer.zPosition = 10
  
  
          self.backGroundView = UIView(frame: scene.view!.bounds)
          self.backGroundView.backgroundColor = UIColor(red: 0.0, green: 0.0, blue: 0.0, alpha: 0.3)
          self.backGroundView.layer.position = scene.view!.center
          self.addSubview(backGroundView)
  
  
          let board = UIView(frame: frame)
          board.backgroundColor = UIColor.whiteColor()
          board.layer.position = backGroundView.center
          board.layer.masksToBounds = true
          board.layer.cornerRadius = 20.0
          board.layer.borderColor = UIColor.blackColor().CGColor
          self.addSubview(board)
  
  
          let textView = UILabel(frame: CGRectMake(0, 0, 200,50))
          textView.text = "hogehoge"
          textView.textAlignment = NSTextAlignment.Center
          textView.layer.position = backGroundView.center
          textView.backgroundColor = UIColor.clearColor()
          textView.textColor = UIColor.blackColor()
          self.addSubview(textView)
  
  
          let myWindowExitButton = UIButton.buttonWithType(UIButtonType.ContactAdd) as! UIButton
          myWindowExitButton.tintColor = UIColor.blackColor()
          myWindowExitButton.layer.position = CGPointMake(board.bounds.maxX - myWindowExitButton.bounds.midX - 5, myWindowExitButton.bounds.midY + 5)
  
                     myWindowExitButton.transform = CGAffineTransformMakeRotation(CGFloat((45.0 * M_PI) / 180.0))
  
          myWindowExitButton.addTarget(self, action: "onExitButton:", forControlEvents: UIControlEvents.TouchUpInside)
          board.addSubview(myWindowExitButton)
  
      }
  
      func onExitButton(sender : UIButton){
  
          self.scene.view!.paused = false
          self.scene.userInteractionEnabled = true
          self.removeFromSuperview()
  
      }
  
  }
  </code></pre>