Permalink
Browse files

Make `enableUIFeedback` available from iOS 10 (2)

  • Loading branch information...
iwb-kevin-hirsch committed Oct 29, 2018
1 parent c1f9ca4 commit 519ac3f9d9b0484643a5620c4bb1a68d10d4af3a
@@ -573,6 +573,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_IDENTITY = "iPhone Developer";
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "KVNProgress/KVNProgress-Prefix.pch";
@@ -595,6 +596,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_IDENTITY = "iPhone Developer";
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "KVNProgress/KVNProgress-Prefix.pch";
@@ -88,7 +88,7 @@ @interface KVNProgress ()
@property (atomic) NSBlockOperation *animateAppearanceOperation;
@property (nonatomic, strong) UIWindow *progressWindow;
@property (nonatomic, strong) UIWindow *originalKeyWindow;
@property (nonatomic, strong) UINotificationFeedbackGenerator *feedbackGenerator;
@property (nonatomic, strong) UINotificationFeedbackGenerator *feedbackGenerator API_AVAILABLE(ios(10.0));

@end

@@ -457,7 +457,9 @@ - (void)showProgress:(CGFloat)progress
});
}

[self sendUIFeedbackIfNeededFor:self.style];
if (@available(iOS 10.0, *)) {
[self sendUIFeedbackIfNeededFor:self.style];
}
}

- (UIView *)accessibilityView
@@ -471,7 +473,7 @@ - (UIView *)accessibilityView
}
}

- (void)sendUIFeedbackIfNeededFor:(KVNProgressStyle)style
- (void)sendUIFeedbackIfNeededFor:(KVNProgressStyle)style API_AVAILABLE(ios(10.0))
{
if (!configuration.isUIFeedbackEnabled) {

This comment has been minimized.

@AnthonyUccello

AnthonyUccello Oct 30, 2018

After doing a pod update on our project (which is Xcode 10 and Swift 4.2) this line is now throwing an error:

screen shot 2018-10-30 at 11 59 56 am

return;
@@ -41,7 +41,10 @@ - (id)init

_tapBlock = nil;
_allowUserInteraction = NO;
_enableUIFeedback = NO;

if (@available(iOS 10, *)) {
_enableUIFeedback = NO;
}
}

return self;
@@ -79,7 +82,10 @@ - (id)copyWithZone:(NSZone *)zone

copy.tapBlock = self.tapBlock;
copy.allowUserInteraction = self.allowUserInteraction;
copy.enableUIFeedback = self.enableUIFeedback;

if (@available(iOS 10, *)) {
copy.enableUIFeedback = self.enableUIFeedback;
}

return copy;
}
@@ -61,7 +61,10 @@ - (KVNProgressConfiguration *)customKVNProgressUIConfiguration
configuration.lineWidth = 1.0f;
configuration.showStop = YES;
configuration.stopRelativeHeight = 0.3f;
configuration.enableUIFeedback = YES;

if (@available(iOS 10, *)) {
configuration.enableUIFeedback = YES;
}

configuration.tapBlock = ^(KVNProgress *progressView) {
[KVNProgress dismiss];

0 comments on commit 519ac3f

Please sign in to comment.