Latest 0.1.1
License MIT
Platforms ios 8.0

[![CI Status]( Jawaharlal/HexLoader.svg?style=flat)]( Jawaharlal/HexLoader)

This is a open source library which shows a hexagon shaped loading indictor, developed CAShapeLayer and CABasicAnimation. The library is highly customisable.


Try HexLoader on


To run the example project, clone the repo, and run pod install from the Example directory first.


Dark Background with Loading Text Light Background without Loading Text and no inner offset
Transparent Background Dark Background without backdrop
Transparent Background with custom Loading Text Color



HexLoader is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "HexLoader"

Manual Installation

Just copy the files under ‘HexLoader/Classes’ folder to get going.


The library has a protocol extension named ‘LoadingViewPresentable’, which enables any view controller to call the library easily without any boiler plate code. To start the loader, all you need to call any of the below two public functions, which were part of the protocol extension, from any of your UIViewControllers.


or call the below function to have some text beneath the indicator.

startLoading(with: "Loading...")

The indicator can be stopped by calling the below function



The loader has an extensive list of customisations exposed through a Singleton class ‘HexLoaderConfig’. Below are the params available

 *  Length of each side
HexagonLoaderConfig.shared.hexagonSideLength = 60

 *  Inner offset for each Hexagon
HexagonLoaderConfig.shared.hexagonInnerOffset = 2

 *  Color of Hexagon
HexagonLoaderConfig.shared.hexagonBackgroundColor = .white

 *  Color of Hexagon border
HexagonLoaderConfig.shared.hexagonBorderColor = white

 *  Background Type
HexagonLoaderConfig.shared.backgroundType = .transparent

* Boolean to indicate if a backdrop over lay is needed to be displayed
HexagonLoaderConfig.shared.displayBackdropOverlay = true

 *  Backdrop Overlay Color. This will be used only if'displayBackdropOverlay' var is set to true
HexagonLoaderConfig.shared.backdropOverlayColor = #colorLiteral(red: 0.4156862745, green: 0.7176470588, blue: 0.968627451, alpha: 1)

 *  Backdrop Overlay Corner Radius. This will be used only if'displayBackdropOverlay' var is set to true
HexagonLoaderConfig.shared.backdropOverlayCornerRadius = 10

* Loading Text Font
HexagonLoaderConfig.shared.loadingTextFont = UIFont.systemFont(ofSize: 17)

 * Loading Text Color
HexagonLoaderConfig.shared.loadingTextColor = .white

 *  Animation Speed of the loader
HexagonLoaderConfig.shared.animationSpeed = 1


Kesava Jawaharlal, [email protected]


HexLoader is available under the MIT license. See the LICENSE file for more info.

Latest podspec

    "name": "HexLoader",
    "version": "0.1.1",
    "summary": "The library has a hexagon shaped loader with can customised in numerous ways as documented",
    "description": "This is a generic library to load a hexagon shaped loading indicator. Its highly customisable and used CAShapeLayer to draw the shapes directly on the UIView",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "Kesavasankar Jawaharlal": "[email protected]"
    "source": {
        "git": "",
        "tag": "0.1.1"
    "platforms": {
        "ios": "8.0"
    "source_files": "HexLoader/Classes/**/*.swift",
    "pushed_with_swift_version": "3.0"

Pin It on Pinterest

Share This