-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
111 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// | ||
// HapticManager.swift | ||
// YDS | ||
// | ||
// Created by 정종인 on 12/25/23. | ||
// | ||
|
||
import UIKit | ||
|
||
public class HapticManager { | ||
public static let instance = HapticManager() | ||
private init() {} | ||
|
||
public func notification(type: UINotificationFeedbackGenerator.FeedbackType) { | ||
let generator = UINotificationFeedbackGenerator() | ||
generator.notificationOccurred(type) | ||
} | ||
|
||
public func impact(style: UIImpactFeedbackGenerator.FeedbackStyle) { | ||
let generator = UIImpactFeedbackGenerator(style: style) | ||
generator.impactOccurred() | ||
} | ||
} | ||
|
||
/* | ||
Haptic Manager 사용 방법 | ||
HapticManager.instance.notification(type: .success) | ||
HapticManager.instance.impact(style: .soft) | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters