{"action":"created","issue":{"url":"https://api.github.com/repos/SVProgressHUD/SVProgressHUD/issues/665","repository_url":"https://api.github.com/repos/SVProgressHUD/SVProgressHUD","labels_url":"https://api.github.com/repos/SVProgressHUD/SVProgressHUD/issues/665/labels{/name}","comments_url":"https://api.github.com/repos/SVProgressHUD/SVProgressHUD/issues/665/comments","events_url":"https://api.github.com/repos/SVProgressHUD/SVProgressHUD/issues/665/events","html_url":"https://github.com/SVProgressHUD/SVProgressHUD/pull/665","id":176994481,"number":665,"title":"iOS 10 Haptics support","user":{"login":"Vortec4800","id":396122,"avatar_url":"https://avatars.githubusercontent.com/u/396122?v=3","gravatar_id":"","url":"https://api.github.com/users/Vortec4800","html_url":"https://github.com/Vortec4800","followers_url":"https://api.github.com/users/Vortec4800/followers","following_url":"https://api.github.com/users/Vortec4800/following{/other_user}","gists_url":"https://api.github.com/users/Vortec4800/gists{/gist_id}","starred_url":"https://api.github.com/users/Vortec4800/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vortec4800/subscriptions","organizations_url":"https://api.github.com/users/Vortec4800/orgs","repos_url":"https://api.github.com/users/Vortec4800/repos","events_url":"https://api.github.com/users/Vortec4800/events{/privacy}","received_events_url":"https://api.github.com/users/Vortec4800/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-09-14T19:13:03Z","updated_at":"2016-11-30T18:58:34Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/SVProgressHUD/SVProgressHUD/pulls/665","html_url":"https://github.com/SVProgressHUD/SVProgressHUD/pull/665","diff_url":"https://github.com/SVProgressHUD/SVProgressHUD/pull/665.diff","patch_url":"https://github.com/SVProgressHUD/SVProgressHUD/pull/665.patch"},"body":"I've created this Pull Request with what would appear to be a fully functional version of the new Haptic Feedback in iOS 10. Without a new phone yet I haven't been able to test this on a real device yet, so it would be best to wait until at least next week to merge this.\n\nI've added a property that enables or disables Haptics, which is disabled by default. I would love to make this enabled by default, so any app using SVProgressHUD would automatically get Haptics without any code changes, and I think that would go a long way to making users get used to Haptics in apps. I also understand not wanting to slip in unknown functionality without the app developer knowing about it.\n\nThe feedback generator is stored in a private property, and is only returned if the app is running on iOS 10 and Haptics are enabled. If either of those things aren't true, then nil-messaging means the Haptic calls elsewhere are no-op.\n\nI figure a general use case will be to show a progress or indeterminate HUD first, then show an success or error HUD shortly thereafter. In order to best fit these cases, I tell the feedback generator to prepare for Haptics when showing the progress HUD, then actually perform the feedback on success/error HUD show.\n\nThe notification types Apple provides templates for are:\n\n```\nUINotificationFeedbackTypeSuccess\nUINotificationFeedbackTypeWarning\nUINotificationFeedbackTypeError\n```\n\nThe two we're using are `UINotificationFeedbackTypeSuccess` and `UINotificationFeedbackTypeError` as I didn't have a good use for the Warning type.\n\nThe downside to this change is it will require Xcode 8 / iOS 10 SDK to build, though I've tested these changes on both iOS 8 and iOS 9 and verified the class checking keeps the app from crashing on an older OS. As Apple will soon disallow submissions from Xcode 7 I don't know how much of a big deal this is.\n\n**Things that still need to be done:**\n- I'm not sure how this will work in Extensions, as I don't have one currently to test with. We may need to put an #ifdef in to keep this from building in an Extension context.\n- Once we've decided this is good I can add some documentation about it in the README.\n"},"comment":{"url":"https://api.github.com/repos/SVProgressHUD/SVProgressHUD/issues/comments/263961899","html_url":"https://github.com/SVProgressHUD/SVProgressHUD/pull/665#issuecomment-263961899","issue_url":"https://api.github.com/repos/SVProgressHUD/SVProgressHUD/issues/665","id":263961899,"user":{"login":"Vortec4800","id":396122,"avatar_url":"https://avatars.githubusercontent.com/u/396122?v=3","gravatar_id":"","url":"https://api.github.com/users/Vortec4800","html_url":"https://github.com/Vortec4800","followers_url":"https://api.github.com/users/Vortec4800/followers","following_url":"https://api.github.com/users/Vortec4800/following{/other_user}","gists_url":"https://api.github.com/users/Vortec4800/gists{/gist_id}","starred_url":"https://api.github.com/users/Vortec4800/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vortec4800/subscriptions","organizations_url":"https://api.github.com/users/Vortec4800/orgs","repos_url":"https://api.github.com/users/Vortec4800/repos","events_url":"https://api.github.com/users/Vortec4800/events{/privacy}","received_events_url":"https://api.github.com/users/Vortec4800/received_events","type":"User","site_admin":false},"created_at":"2016-11-30T18:58:34Z","updated_at":"2016-11-30T18:58:34Z","body":"Yeah, I can understand that. FWIW I've been using this code in a production app for a few months now and haven't seen any issues. Of course there's no way my app covers every use-case, but still better than nothing.\r\n\r\nAs for the inconsistency, I'm also not sure how to deal with that. I figure progress HUDs won't want haptics because it's not just a single display, but something that will stay on screen for an indeterminate amount of time. It also seems to me that after a progress HUD, you would then show either a success HUD or an error HUD to show the result of whatever was progressing, in which case you would get the feedback. If you just dismiss the progress HUD without anything at the end, I don't think you would want to punctuate that with any sort of feedback.\r\n\r\nI guess the only thing we're missing would be custom HUDs that show an image or something else. Not sure what you would want to do with that scenario."}}
{"actor":{"display_login":"Vortec4800"}}