Quantcast
Viewing all articles
Browse latest Browse all 3

Answer by efremidze for Creating a haptic feedback pattern in swift 3

You can create an OperationQueue and add operations with haptic feedback. The operation would look like this:

class HapticFeedbackOperation: Operation {
    override func main() {
        // Play the haptic feedback
        UIImpactFeedbackGenerator(style: .heavy).impactOccurred()
    }
}

You might want to add a delay between the operations.

Checkout my open source framework Haptica, it supports both Haptic Feedback, AudioServices and unique vibrations patterns. Works on Swift 4.2, Xcode 10


Viewing all articles
Browse latest Browse all 3

Trending Articles