Reset Push Notification Settings For iOS App

Answer: http://stackoverflow.com/a/4080720/4395879

The first time a push-enabled app registers for push notifications, iOS asks the user if they wish to receive notifications for that app. Once the user has responded to this alert it is not presented again unless the device is restored or the app has been uninstalled for at least a day.
If you want to simulate a first-time run of your app, you can leave the app uninstalled for a day. You can achieve the latter without actually waiting a day by setting the system clock forward a day or more, turning the device off completely, then turning the device back on.
Update: As noted in the comments below, this solution stopped working since iOS 5.1. I would encourage filing a bug with Apple so they can update their documentation. The current solution seems to be resetting the device's content and settings.
Update: The tech note has been updated with new steps that work correctly as of iOS 7.
  1. Delete your app from the device.
  2. Turn the device off completely and turn it back on.
  3. Go to Settings > General > Date & Time and set the date ahead a day or more.
  4. Turn the device off completely again and turn it back on.

How to erase bluetooth devices from Mac

Original answer -> http://apple.stackexchange.com/a/150979

In System Preferences > Bluetooth, make sure that Bluetooth is on and the Show Bluetooth in menu bar check box is checked. Then hold down alt or option before clicking the Bluetooth toolbar menu icon. Now, in the device's contextual menu you can remove it.


dispatch_after in Swift

let delayTime = dispatch_time(DISPATCH_TIME_NOW, Int64(1 * Double(NSEC_PER_SEC)))
dispatch_after(delayTime, dispatch_get_main_queue()) {
    print("test")
}

Editing the Hosts File in Mac OS X

  1. Launch Terminal, found in /Applications/Utilities/ or launched through Spotlight,
  2. Type the following command at the prompt:
    sudo nano /private/etc/hosts
  3. Enter the administrator password when requested,
  4. Once the hosts file is loaded within nano, use the arrow keys to navigate to the bottom of the hosts file to make your modifications,
  5. When finished, hit Control+O followed by ENTER/RETURN to save changes to /private/etc/hosts, then hit Control+X to exit out of nano,
  6. Quit out of Terminal when finished.