Skip to content

Commit 03c33c4

Browse files
av0c0derrnystrom
authored andcommitted
Decrease minimum iOS version (GitHawkApp#46)
* Decrease minium iOS version Create ContextMenuHapticFeedbackStyle enumeration to mirror iOS UIImpactFeedbackGenerator.FeedbackStyle * Rename ContextMenuHapticFeedbackStyle and put the enum inside an extension to match the common style * Rename ContextMenuHapticFeedbackStyle to HapticFeedbackStyle * Update the Example project - Install newest Pod version - Specify platform in the Podfile - Unset development team
1 parent 6840577 commit 03c33c4

File tree

12 files changed

+332
-309
lines changed

12 files changed

+332
-309
lines changed

ContextMenu.podspec

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
Pod::Spec.new do |spec|
22
spec.name = 'ContextMenu'
3-
spec.version = '0.5.0'
3+
spec.version = '0.5.1'
44
spec.license = { :type => 'MIT' }
55
spec.homepage = 'https://github.com/GitHawkApp/ContextMenu'
66
spec.authors = { 'Ryan Nystrom' => '[email protected]' }
77
spec.summary = 'Context menu inspired by Things 3.'
88
spec.source = { :git => 'https://github.com/GitHawkApp/ContextMenu.git', :tag => spec.version.to_s }
99
spec.source_files = 'ContextMenu/*.swift'
10-
spec.platform = :ios, '10.0'
10+
spec.platform = :ios, '9.0'
1111
spec.swift_version = '4.2'
12-
end
12+
end

ContextMenu.xcodeproj/project.pbxproj

+4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
2991418920BC757100B63A3B /* ContextMenu.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2971CE722054539900342296 /* ContextMenu.framework */; };
2929
2991419020BC77FA00B63A3B /* CGRect+DominantCorner.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2991418F20BC77FA00B63A3B /* CGRect+DominantCorner.swift */; };
3030
2991419220BC789D00B63A3B /* CGRect_DominantCornerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2991419120BC789D00B63A3B /* CGRect_DominantCornerTests.swift */; };
31+
9DAB381F21E10EB600567709 /* ContextMenu+HapticFeedbackStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9DAB381E21E10EB600567709 /* ContextMenu+HapticFeedbackStyle.swift */; };
3132
DE5D838B2055D72A0069A81D /* UIViewController+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE5D838A2055D72A0069A81D /* UIViewController+Extensions.swift */; };
3233
/* End PBXBuildFile section */
3334

@@ -66,6 +67,7 @@
6667
2991418820BC757100B63A3B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
6768
2991418F20BC77FA00B63A3B /* CGRect+DominantCorner.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CGRect+DominantCorner.swift"; sourceTree = "<group>"; };
6869
2991419120BC789D00B63A3B /* CGRect_DominantCornerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CGRect_DominantCornerTests.swift; sourceTree = "<group>"; };
70+
9DAB381E21E10EB600567709 /* ContextMenu+HapticFeedbackStyle.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "ContextMenu+HapticFeedbackStyle.swift"; sourceTree = "<group>"; };
6971
DE5D838A2055D72A0069A81D /* UIViewController+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIViewController+Extensions.swift"; sourceTree = "<group>"; };
7072
/* End PBXFileReference section */
7173

@@ -117,6 +119,7 @@
117119
2971CE83205453D900342296 /* ContextMenu+Animations.swift */,
118120
2971CE80205453D800342296 /* ContextMenu+ContainerStyle.swift */,
119121
2971CE85205453D900342296 /* ContextMenu+ContextMenuPresentationControllerDelegate.swift */,
122+
9DAB381E21E10EB600567709 /* ContextMenu+HapticFeedbackStyle.swift */,
120123
2971CE81205453D900342296 /* ContextMenu+Item.swift */,
121124
2971CE86205453D900342296 /* ContextMenu+MenuStyle.swift */,
122125
2971CE7E205453D800342296 /* ContextMenu+Options.swift */,
@@ -262,6 +265,7 @@
262265
2971CE97205453D900342296 /* ContextMenuPresenting.swift in Sources */,
263266
2971CE90205453D900342296 /* ContextMenuDismissing.swift in Sources */,
264267
2971CE94205453D900342296 /* ContextMenu+MenuStyle.swift in Sources */,
268+
9DAB381F21E10EB600567709 /* ContextMenu+HapticFeedbackStyle.swift in Sources */,
265269
2971CE8E205453D900342296 /* ContextMenu+ContainerStyle.swift in Sources */,
266270
DE5D838B2055D72A0069A81D /* UIViewController+Extensions.swift in Sources */,
267271
2971CE95205453D900342296 /* ClippedContainerViewController.swift in Sources */,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//
2+
// ContextMenu+HapticFeedbackStyle.swift
3+
// ContextMenu
4+
//
5+
// Created by Abdurahim Jauzee on 31/12/2018.
6+
//
7+
8+
import Foundation
9+
10+
public extension ContextMenu {
11+
12+
/// Haptic Feedback types.
13+
public enum HapticFeedbackStyle: Int {
14+
case light, medium, heavy
15+
}
16+
17+
}
18+

ContextMenu/ContextMenu+Options.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ extension ContextMenu {
2323
let menuStyle: MenuStyle
2424

2525
/// Trigger haptic feedback when the menu is shown.
26-
let hapticsStyle: UIImpactFeedbackGenerator.FeedbackStyle?
26+
let hapticsStyle: HapticFeedbackStyle?
2727

2828
/// The position relative to the source view (if provided).
2929
let position: Position
@@ -32,7 +32,7 @@ extension ContextMenu {
3232
durations: AnimationDurations = AnimationDurations(),
3333
containerStyle: ContainerStyle = ContainerStyle(),
3434
menuStyle: MenuStyle = .default,
35-
hapticsStyle: UIImpactFeedbackGenerator.FeedbackStyle? = nil,
35+
hapticsStyle: HapticFeedbackStyle? = nil,
3636
position: Position = .default
3737
) {
3838
self.durations = durations

ContextMenu/ContextMenu.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ public class ContextMenu: NSObject {
3737
previous.viewController.dismiss(animated: false)
3838
}
3939

40-
if let style = options.hapticsStyle {
41-
let haptics = UIImpactFeedbackGenerator(style: style)
40+
if #available(iOS 10, *), let raw = options.hapticsStyle?.rawValue, let feedbackStyle = UIImpactFeedbackGenerator.FeedbackStyle(rawValue: raw) {
41+
let haptics = UIImpactFeedbackGenerator(style: feedbackStyle)
4242
haptics.impactOccurred()
4343
}
4444

Example/Example.xcodeproj/project.pbxproj

+2-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
isa = PBXProject;
124124
attributes = {
125125
LastSwiftUpdateCheck = 0920;
126-
LastUpgradeCheck = 0920;
126+
LastUpgradeCheck = 1010;
127127
ORGANIZATIONNAME = "Ryan Nystrom";
128128
TargetAttributes = {
129129
2971CEA1205454BD00342296 = {
@@ -251,6 +251,7 @@
251251
CLANG_WARN_BOOL_CONVERSION = YES;
252252
CLANG_WARN_COMMA = YES;
253253
CLANG_WARN_CONSTANT_CONVERSION = YES;
254+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
254255
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
255256
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
256257
CLANG_WARN_EMPTY_BODY = YES;

Example/Podfile

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
platform :ios, '9.0'
2+
13
target 'Example' do
24
use_frameworks!
35
pod 'ContextMenu', :path => '../ContextMenu.podspec'

Example/Podfile.lock

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PODS:
2-
- ContextMenu (0.5.0)
2+
- ContextMenu (0.5.1)
33

44
DEPENDENCIES:
55
- ContextMenu (from `../ContextMenu.podspec`)
@@ -9,8 +9,8 @@ EXTERNAL SOURCES:
99
:path: "../ContextMenu.podspec"
1010

1111
SPEC CHECKSUMS:
12-
ContextMenu: 771a37612cd5cd10bf1dc0e3b9187df4d6f1e57a
12+
ContextMenu: accf2c0d0d91ad7c573fcd9863a1fd339d1cf980
1313

14-
PODFILE CHECKSUM: aa060c7f3a10a9cb8b2633f1297c22bb65e4f54d
14+
PODFILE CHECKSUM: a25bcff99b093889f3fc3097941235bb4adeee58
1515

1616
COCOAPODS: 1.5.3

Example/Pods/Local Podspecs/ContextMenu.podspec.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/Pods/Manifest.lock

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)