Skip to content

Commit

Permalink
2.2.2 (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
efremidze authored Dec 6, 2018
1 parent 36fd7f8 commit 6ef6d82
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 10 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change log

## [Version 2.2.2](https://github.com/efremidze/Haptica/releases/tag/2.2.2)
Released on 2018-12-05

- Readded iOS 9 Support

## [Version 2.2.1](https://github.com/efremidze/Haptica/releases/tag/2.2.1)
Released on 2018-10-01

Expand Down
4 changes: 2 additions & 2 deletions Haptica.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

Pod::Spec.new do |s|
s.name = 'Haptica'
s.version = '2.2.1'
s.version = '2.2.2'
s.summary = 'Easy Haptic Feedback'
s.homepage = 'https://github.com/efremidze/Haptica'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'efremidze' => '[email protected]' }
s.documentation_url = 'https://efremidze.github.io/Haptica/'
s.source = { :git => 'https://github.com/efremidze/Haptica.git', :tag => s.version.to_s }
s.ios.deployment_target = '10.0'
s.ios.deployment_target = '9.0'
s.source_files = 'Sources/*.swift'
end
4 changes: 2 additions & 2 deletions Haptica.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -408,7 +408,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ $ pod try Haptica

## Requirements

- iOS 10.0+
- iOS 9.0+
- Xcode 8.0+
- Swift 4 (Haptica 2.x), Swift 3 (Haptica 1.x)

Expand Down
30 changes: 26 additions & 4 deletions Sources/Haptic.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,31 @@

import UIKit

public enum HapticFeedbackStyle: Int {
case light, medium, heavy
}

@available(iOS 10.0, *)
extension HapticFeedbackStyle {
var value: UIImpactFeedbackGenerator.FeedbackStyle {
return UIImpactFeedbackGenerator.FeedbackStyle(rawValue: rawValue)!
}
}

public enum HapticFeedbackType: Int {
case success, warning, error
}

@available(iOS 10.0, *)
extension HapticFeedbackType {
var value: UINotificationFeedbackGenerator.FeedbackType {
return UINotificationFeedbackGenerator.FeedbackType(rawValue: rawValue)!
}
}

public enum Haptic {
case impact(UIImpactFeedbackGenerator.FeedbackStyle)
case notification(UINotificationFeedbackGenerator.FeedbackType)
case impact(HapticFeedbackStyle)
case notification(HapticFeedbackType)
case selection

// trigger
Expand All @@ -19,13 +41,13 @@ public enum Haptic {

switch self {
case .impact(let style):
let generator = UIImpactFeedbackGenerator(style: style)
let generator = UIImpactFeedbackGenerator(style: style.value)
generator.prepare()
generator.impactOccurred()
case .notification(let type):
let generator = UINotificationFeedbackGenerator()
generator.prepare()
generator.notificationOccurred(type)
generator.notificationOccurred(type.value)
case .selection:
let generator = UISelectionFeedbackGenerator()
generator.prepare()
Expand Down
2 changes: 1 addition & 1 deletion Sources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.2.1</string>
<string>2.2.2</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
Expand Down

0 comments on commit 6ef6d82

Please sign in to comment.