<commit_before>//
//  ViewController.swift
//  FeedbackEffect
//
//  Created by <NAME> on 9/7/17.
//  Copyright © 2017 Mergesort. All rights reserved.
//

import UIKit

class ViewController: UIViewController {

    // These are just 4 combos, you can mix and match and make tons of your own!
    
    @IBAction func urlAndHaptics(_ sender: Any) {
        // Uses the haptic feedback built into iOS along with an
        // alert sound to make a user feel they've finished a unit of work.

        let selectionFeedback = HapticFeedback.notification(.success)
        let soundUrl = Bundle.main.url(forResource: "Success", withExtension: "m4a")
        FeedbackEffect.play(sound: soundUrl, feedback: selectionFeedback)
    }
    
    @IBAction func urlAndVibration(_ sender: Any) {
        // Uses the vibration feedback fallback (for users without 3D Touch devices)
        // built into iOS along with an alert sound to make a user feel they've finished
        // a unit of work.

        let selectionVibration = VibrationFeedback.notification
        let soundUrl = Bundle.main.url(forResource: "Success", withExtension: "m4a")
        FeedbackEffect.play(sound: soundUrl, feedback: selectionVibration)
    }

    @IBAction func toneAndHaptics(_ sender: Any) {
        // Uses the haptic feedback built into iOS along with the tap sound
        // to make a user feel like they're really tapping a button.

        let notificationFeedback = HapticFeedback.selection
        let tapSound = SoundEffect.tap
        FeedbackEffect.play(sound: tapSound, feedback: notificationFeedback)
    }
    
    @IBAction func toneAndVibration(_ sender: Any) {
        // Uses the vibration feedback fallback (for users without 3D Touch devices)
        // built into iOS along with an alert sound to make a user feel they've finished
        // a unit of work.

        let vibration = VibrationFeedback.notification
        let sound = MessageTone.tweet
        FeedbackEffect.play(sound: sound, feedback: vibration)
    }<commit_msg>Adding prepare function to example project<commit_after>//
//  ViewController.swift
//  FeedbackEffect
//
//  Created by <NAME> on 9/7/17.
//  Copyright © 2017 Mergesort. All rights reserved.
//

import UIKit

class ViewController: UIViewController {

    // These are just 4 combos, you can mix and match and make tons of your own!
    
    @IBAction func urlAndHaptics(_ sender: Any) {
        // Uses the haptic feedback built into iOS along with an
        // alert sound to make a user feel they've finished a unit of work.

        let notificationFeedback = HapticFeedback.notification(.success)

        // We can optionally prepare the generator that relates to the feedback we're trying to activate.
        notificationFeedback.prepare()

        let soundUrl = Bundle.main.url(forResource: "Success", withExtension: "m4a")
        FeedbackEffect.play(sound: soundUrl, feedback: notificationFeedback)
    }
    
    @IBAction func urlAndVibration(_ sender: Any) {
        // Uses the vibration feedback fallback (for users without 3D Touch devices)
        // built into iOS along with an alert sound to make a user feel they've finished
        // a unit of work.

        let selectionVibration = VibrationFeedback.notification
        let soundUrl = Bundle.main.url(forResource: "Success", withExtension: "m4a")
        FeedbackEffect.play(sound: soundUrl, feedback: selectionVibration)
    }

    @IBAction func toneAndHaptics(_ sender: Any) {
        // Uses the haptic feedback built into iOS along with the tap sound
        // to make a user feel like they're really tapping a button.

        let selectionFeedback = HapticFeedback.selection
        selectionFeedback.prepare()
        let tapSound = SoundEffect.tap
        FeedbackEffect.play(sound: tapSound, feedback: selectionFeedback)
    }
    
    @IBAction func toneAndVibration(_ sender: Any) {
        // Uses the vibration feedback fallback (for users without 3D Touch devices)
        // built into iOS along with an alert sound to make a user feel they've finished
        // a unit of work.

        let vibration = VibrationFeedback.notification
        let sound = MessageTone.tweet
        FeedbackEffect.play(sound: sound, feedback: vibration)
    }
{'fraction_non_alphanumeric': 0.07317073170731707, 'fraction_numerical': 0.006097560975609756, 'mean_word_length': 2.751099384344767, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4615698', 'n_tokens_mistral': 1190, 'n_tokens_neox': 1104, 'n_words': 438}