![](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2F35nXQ%2FbtsMavN9tGk%2FHYEsMYTbFGy4U9KvW7xFM0%2Fimg.png)
타입 메서드 vs 싱글톤 성능 비교하기
·
iOS/내 방식대로 풀어보기
앱 내 전역적으로 햅틱 이벤트를 호출하기 위해 HapticService를 구현하려 합니다. 함수 두 개만 작성하면 되는 아주 간단한 것이죠!/// 알림 유형에 따른 햅틱 출력func notification(type: UINotificationFeedbackGenerator.FeedbackType) { UINotificationFeedbackGenerator().notificationOccurred(type)}/// 강도에 따른 햅틱 출력func impact(style: UIImpactFeedbackGenerator.FeedbackStyle) { UIImpactFeedbackGenerator(style: .medium).impactOccurred()}그러다 문득 이를 타입 메서드로 구현해야 할지..