title: custom sktransition in SpriteKit iOS Swift
body: <p>I am having trouble finding documentation/examples in creating custom sktransitions between two skscenes. I can use the built in transitions fine and plan to use some of those.</p>
  
  <p>Can somebody explain the process in creating a transition, possibly with an example?</p>
  
  <p>I am getting a bit confused as I see examples with CIFilters and alike. I understand these are from the CoreImage framework, so am wondering how these are involved.</p>
  
  <p>Many thanks.</p>
  
  <p>Leon</p>
  
  <p>Edit 1:</p>
  
  <p>I have tried a Swift 3 version such as:</p>
  
  <pre><code>let customFilter = CIFilter(name: "CIDotScreen")
  let transition = SKTransition(ciFilter: customFilter!, duration: 0.5)
  let newScene = GameOverScene(size: self.size, won: false)
  transition.pausesOutgoingScene = true
  self.view?.presentScene(newScene, transition: transition)
  </code></pre>
  
  <p>from
  <a href="https://github.com/nicklockwood/Presentations/blob/master/Transitions/Presentation/SKCITransitionsView.m" rel="nofollow noreferrer">Custom SKTransitions</a></p>
  
  <p>and using SKTransition.init(ciFilter:, duration:) - the same initialiser as above, but the transition doesn't animate. Interestingly, the transition back to the main game screen, a built in flip animation, doesn't start until after the duration specified above has expired.</p>