AWSAuthUIHelper Class Reference

Inherits from NSObject
Declared in AWSAuthUIHelper.h
AWSAuthUIHelper.m

Other Methods

+ setUpFormShadowForView:

Set up shadow around specified view

+ (void)setUpFormShadowForView:(UIView *)view

Parameters

view

The view for which form shadow is to be set *

Declared In

AWSAuthUIHelper.h

+ getBackgroundColor:

Get background color set in the config or return the default background color. This is resilient to light/dark mode setting on iOS 13 (UIColor.systemBackgroundColor).

+ (UIColor *)getBackgroundColor:(id<AWSUIConfiguration>)config

Parameters

config

The object conforming to AWSUIConfiguration protocol

Return Value

backgroundColor *

Declared In

AWSAuthUIHelper.h

+ getSecondaryBackgroundColor

Get the default secondary background color. This is resilient to light/dark mode setting on iOS 13 (UIColor.secondarySystemBackgroundColor).

+ (UIColor *)getSecondaryBackgroundColor

Declared In

AWSAuthUIHelper.h

+ applyPrimaryColorFromConfig:toView:background:

Apply button-like primary color to buttons and labels.

+ (void)applyPrimaryColorFromConfig:(id<AWSUIConfiguration>)config toView:(UIView *)view background:(BOOL)background

Parameters

config

The object conforming to AWSUIConfiguration protocol

view

The view (usually a UIButton or UILabel)

background

whether the color should be applied to the background of the component or to the foreground. This is useful when styling buttons that look like hyperlinks.

Declared In

AWSAuthUIHelper.h

+ applyPrimaryColorFromConfig:toView:

Apply primary color to the view’s background.

+ (void)applyPrimaryColorFromConfig:(id<AWSUIConfiguration>)config toView:(UIView *)view

See Also

  • applyPrimaryColorFromConfig:(id<AWSUIConfiguration>) toView:(UIView *) background:(BOOL)

Declared In

AWSAuthUIHelper.h

+ getFont:

Retrieve the font set in the config or return nil

+ (UIFont *)getFont:(id<AWSUIConfiguration>)config

Parameters

config

The object conforming to AWSUIConfiguration protocol

Return Value

font *

Declared In

AWSAuthUIHelper.h

+ isBackgroundColorFullScreen:

Retrieve the flag that says if the background color has to be applied full screen or not.

+ (BOOL)isBackgroundColorFullScreen:(id<AWSUIConfiguration>)config

Parameters

config

The object conforming to AWSUIConfiguration protocol

Return Value

isFullScreenBackgroundColorEnabled *

Declared In

AWSAuthUIHelper.h

+ getTextColor:

Get the primary text color. Based on the configured background color.

+ (UIColor *)getTextColor:(id<AWSUIConfiguration>)config

Parameters

config

The object conforming to AWSUIConfiguration protocol

Return Value

a text color that contrasts with the background color.

Discussion

On iOS 13 or greater is uses UIColor.labelColor so it auto-adapts to light/dark mode. On older systems is picks a light or a dark color to contrast with the main background color.

Declared In

AWSAuthUIHelper.h

+ setAWSUIConfiguration:

Set the AWSAuthUIConfiguration object.

+ (void)setAWSUIConfiguration:(id<AWSUIConfiguration>)config

Parameters

config

The config object from which backgroundColor, isFullScreenBackgroundColorEnabled and font are extracted. *

Declared In

AWSAuthUIHelper.h

+ getAWSUIConfiguration

Retrieve the AWSAuthUIConfiguration object.

+ (id<AWSUIConfiguration>)getAWSUIConfiguration

Return Value

AWSAuthUIConfiguration *

Declared In

AWSAuthUIHelper.h

Other Methods

+ isDarkColor:

Check if a UIColor is bright or dark. Based on http://www.w3.org/WAI/ER/WD-AERT/#color-contrast

+ (BOOL)isDarkColor:(UIColor *)color

Declared In

AWSAuthUIHelper.m