Declared in UIView+BFKit.h

Overview

This category adds some useful methods to UIView

Tasks

Class Methods

initWithFrame:backgroundColor:

+ (instancetype _Nonnull)initWithFrame:(CGRect)frame backgroundColor:(UIColor *_Nonnull)backgroundColor
Discussion

Create an UIView with the given frame and background color

Parameters

frame

UIView’s frame

backgroundColor

UIView’s background color

Declared In

UIView+BFKit.h

Instance Methods

applyMotionEffects

- (void)applyMotionEffects
Discussion

Adds a motion effect to the view

Declared In

UIView+BFKit.h

createBordersWithColor:withCornerRadius:andWidth:

- (void)createBordersWithColor:(UIColor *_Nonnull)color withCornerRadius:(CGFloat)radius andWidth:(CGFloat)width
Discussion

Create a border around the UIView

Parameters

color

Border’s color

radius

Border’s radius

width

Border’s width

Declared In

UIView+BFKit.h

createCornerRadiusShadowWithCornerRadius:offset:opacity:radius:

- (void)createCornerRadiusShadowWithCornerRadius:(CGFloat)cornerRadius offset:(CGSize)offset opacity:(CGFloat)opacity radius:(CGFloat)radius
Discussion

Create a corner radius shadow on the UIView

Parameters

cornerRadius

Corner radius value

offset

Shadow’s offset

opacity

Shadow’s opacity

radius

Shadow’s radius

Declared In

UIView+BFKit.h

createGradientWithColors:direction:

- (void)createGradientWithColors:(NSArray *_Nonnull)colors direction:(UIViewLinearGradientDirection)direction
Discussion

Create a linear gradient

Parameters

colors

NSArray of UIColor instances

direction

Direction of the gradient

Declared In

UIView+BFKit.h

createRectShadowWithOffset:opacity:radius:

- (void)createRectShadowWithOffset:(CGSize)offset opacity:(CGFloat)opacity radius:(CGFloat)radius
Discussion

Create a shadow on the UIView

Parameters

offset

Shadow’s offset

opacity

Shadow’s opacity

radius

Shadow’s radius

Declared In

UIView+BFKit.h

flipWithDuration:direction:

- (void)flipWithDuration:(NSTimeInterval)duration direction:(UIViewAnimationFlipDirection)direction
Discussion

Flip the view

Parameters

duration

Seconds of animation

direction

Direction of the flip animation

Declared In

UIView+BFKit.h

heartbeatViewWithDuration:

- (void)heartbeatViewWithDuration:(CGFloat)duration
Discussion

Create a heartbeat effect on the UIView

Parameters

duration

Seconds of animation

Declared In

UIView+BFKit.h

pulseViewWithDuration:

- (void)pulseViewWithDuration:(CGFloat)duration
Discussion

Create a pulse effect on th UIView

Parameters

duration

Seconds of animation

Declared In

UIView+BFKit.h

pulseViewWithTime:

- (void)pulseViewWithTime:(CGFloat)seconds
Discussion

Create a pulse effect on the UIView

Parameters

seconds

Seconds of animation

Declared In

UIView+BFKit.h

removeAllSubviews

- (void)removeAllSubviews
Discussion

Removes all subviews from current view

Declared In

UIView+BFKit.h

removeBorders

- (void)removeBorders
Discussion

Remove the borders around the UIView

Declared In

UIView+BFKit.h

removeShadow

- (void)removeShadow
Discussion

Remove the shadow around the UIView

Declared In

UIView+BFKit.h

saveScreenshot

- (UIImage *_Nonnull)saveScreenshot
Discussion

Take a screenshot of the current view an saving to the saved photos album

Return Value

Returns screenshot as UIImage

Declared In

UIView+BFKit.h

screenshot

- (UIImage *_Nonnull)screenshot
Discussion

Take a screenshot of the current view

Return Value

Returns screenshot as UIImage

Declared In

UIView+BFKit.h

setCornerRadius:

- (void)setCornerRadius:(CGFloat)radius
Discussion

Set the corner radius of UIView

Parameters

radius

Radius value

Declared In

UIView+BFKit.h

shakeView

- (void)shakeView
Discussion

Create a shake effect on the UIView

Declared In

UIView+BFKit.h

translateAroundTheView:duration:direction:repeat:startFromEdge:

- (void)translateAroundTheView:(UIView *_Nonnull)topView duration:(CGFloat)duration direction:(UIViewAnimationTranslationDirection)direction repeat:(BOOL)repeat startFromEdge:(BOOL)startFromEdge
Discussion

Translate the UIView around the topView

Parameters

topView

Top view to translate to

duration

Duration of the translation

direction

Direction of the translation

repeat

If the animation must be repeat or no

startFromEdge

If the animation must start from the edge

Declared In

UIView+BFKit.h