Flare

The flare enables you to display content with a pointer to directional content.

Backpack/FlareView

Cocoapods class reference view on Github

Default

Day Night

Rounded

Day Night

Pointing up

Day Night

With background image

Day Night

Usage

BPKFlareView is a UIView with the Skyscanner flare style. The flare can be easily enabled and disabled with a BOOL property.

Objective-C


                                                
                                                #import <Backpack/FlareView.h>
                                                
                                                BPKFlareView *flareView = [[BPKFlareView alloc] initWithFrame:CGRectZero];
                                                flareViewView.backgroundView.backgroundColor = BPKColor.skyBlue;
                                                
                                                UIView *innerView = [[UIView alloc] initWithFrame:CGRectZero];
                                                innerView.backgroundColor = [BPKColor systemRed];
                                                
                                                [flareView.contentView addSubview:innerView];
                                                flareView.flarePosition = BPKFlarePositionTop;
                                                flareView.cornerRadius = BPKCornerRadiusSm;

Swift


                                                
                                                import Backpack
                                                
                                                let flareView = BPKFlareView(frame: .zero)
                                                flareViewView.backgroundView.backgroundColor = BPKColor.skyBlue;
                                                
                                                let label = BPKLabel(fontStyle: .textXlEmphasized)
                                                label.text = "Much wow!"
                                                label.textColor = BPKColor.white
                                                label.translatesAutoresizingMaskIntoConstraints = false
                                                
                                                flareView.contentView.addSubview(label)
                                                flareView.flarePosition = .top
                                                flareView.cornerRadius = BPKCornerRadiusSm