<commit_before>//
//  Created by <NAME> on 3/1/16.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import UIKit
import IBAnimatable

class TransitionViewController: AnimatableViewController {
  var animationType: String?
  
  @IBOutlet var presentButton: AnimatableButton!
    
  override func viewDidLoad() {
    super.viewDidLoad()
    
    // Transition animations start with `System` do not support Present transition, so hide it
    if let animationType = animationType where animationType.hasPrefix("System") {
        presentButton.alpha = 0
    }
  }
  
  @IBAction func presentButtonDidTap(sender: AnyObject) {
    guard let toViewController = storyboard?.instantiateViewControllerWithIdentifier("PresentedFirstViewController") as? AnimatableViewController, animationType = animationType else {
      return
    }
    
    toViewController.transitionAnimationType = animationType
    let segueName = "IBAnimatable.Present" + animationType + "Segue"
    guard let segueClass = NSClassFromString(segueName) as? UIStoryboardSegue.Type else {
      return
    }
    
    let segue = segueClass.init(identifier: segueName, source: self, destination: toViewController)
    prepareForSegue(segue, sender: self)
    segue.perform()
  }
}<commit_msg>Fix the present Explode segue in demo app.<commit_after>//
//  Created by <NAME> on 3/1/16.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import UIKit
import IBAnimatable

class TransitionViewController: AnimatableViewController {
  var animationType: String?
  
  @IBOutlet var presentButton: AnimatableButton!
    
  override func viewDidLoad() {
    super.viewDidLoad()
    
    // Transition animations start with `System` do not support Present transition, so hide it
    if let animationType = animationType where animationType.hasPrefix("System") {
      // Cannot use `hidden` here because of `UIStackView`
      presentButton.alpha = 0
    }
  }
  
  @IBAction func presentButtonDidTap(sender: AnyObject) {
    guard let toViewController = storyboard?.instantiateViewControllerWithIdentifier("PresentedFirstViewController") as? AnimatableViewController, animationType = animationType else {
      return
    }
    
    toViewController.transitionAnimationType = animationType
    let segueName = "IBAnimatable.Present" + extractAnimationType(animationType) + "Segue"
    guard let segueClass = NSClassFromString(segueName) as? UIStoryboardSegue.Type else {
      return
    }
    
    let segue = segueClass.init(identifier: segueName, source: self, destination: toViewController)
    prepareForSegue(segue, sender: self)
    segue.perform()
  }
  
  // To extract the type without parameters
  private func extractAnimationType(animationType: String) -> String {
    if let range = animationType.rangeOfString("(") {
      return animationType.substringToIndex(range.startIndex)
    }
    return animationType
  }
}
{'fraction_non_alphanumeric': 0.08134302526825891, 'fraction_numerical': 0.006230529595015576, 'mean_word_length': 3.8653198653198655, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2550136', 'n_tokens_mistral': 823, 'n_tokens_neox': 782, 'n_words': 220}