Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-23778] (5_5_X) iOS: Provide better error for unsupported blurview-effects #8231

Merged
merged 1 commit into from
Aug 15, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 7 additions & 2 deletions iphone/Classes/TiUIiOSBlurView.m
Expand Up @@ -38,9 +38,14 @@ -(void)dealloc

-(void)setEffect_:(id)value
{
ENSURE_TYPE(value, NSNumber);
[[self blurView] setEffect:[UIBlurEffect effectWithStyle:[TiUtils intValue:value def:UIBlurEffectStyleLight]]];
ENSURE_TYPE_OR_NIL(value, NSNumber);

if (value == nil) {
DebugLog(@"[ERROR] The provided value for the Ti.UI.BlurView.effect property is not available in this iOS version.");
return;
}

[[self blurView] setEffect:[UIBlurEffect effectWithStyle:[TiUtils intValue:value def:UIBlurEffectStyleLight]]];
[[self proxy] replaceValue:value forKey:@"effect" notification:NO];
}

Expand Down
26 changes: 14 additions & 12 deletions iphone/Classes/TiUIiOSProxy.m
Expand Up @@ -461,47 +461,49 @@ -(void)setAppSupportsShakeToEdit:(NSNumber *)shake
END_UI_THREAD_PROTECTED_VALUE(appSupportsShakeToEdit)

#ifdef USE_TI_UIIOSBLURVIEW
- (NSNumber*) BLUR_EFFECT_STYLE_EXTRA_LIGHT
- (id)BLUR_EFFECT_STYLE_EXTRA_LIGHT
{
if ([TiUtils isIOS8OrGreater]) {
return NUMINTEGER(UIBlurEffectStyleExtraLight);
}
return nil;
return [NSNull null];
}

- (NSNumber* )BLUR_EFFECT_STYLE_LIGHT
- (id)BLUR_EFFECT_STYLE_LIGHT
{
if ([TiUtils isIOS8OrGreater]) {
return NUMINTEGER(UIBlurEffectStyleLight);
}
return nil;
return [NSNull null];
}

- (NSNumber*) BLUR_EFFECT_STYLE_DARK
- (id)BLUR_EFFECT_STYLE_DARK
{
if ([TiUtils isIOS8OrGreater]) {
return NUMINTEGER(UIBlurEffectStyleDark);
}
return nil;
return [NSNull null];
}

#if IS_XCODE_8
- (NSNumber*) BLUR_EFFECT_STYLE_REGULAR
- (id)BLUR_EFFECT_STYLE_REGULAR
{
#if IS_XCODE_8
if ([TiUtils isIOS10OrGreater]) {
return NUMINTEGER(UIBlurEffectStyleRegular);
}
return nil;
#endif
return [NSNull null];
}

- (NSNumber*) BLUR_EFFECT_STYLE_PROMINENT
- (id)BLUR_EFFECT_STYLE_PROMINENT
{
#if IS_XCODE_8
if ([TiUtils isIOS10OrGreater]) {
return NUMINTEGER(UIBlurEffectStyleProminent);
}
return nil;
}
#endif
return [NSNull null];
}
#endif

#ifdef USE_TI_UIIOSMENUPOPUP
Expand Down