Skip to content

cepages/CPSimpleHUD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README

SimpleHUD works on any iOS version and is compatible with swift.

Currently it has three modes:

  • Unlimited

Default mode, but to set Unlimited again:

      let hud = CPSimpleHUD.shareWaitingView
      hud.waitingMode = .Unlimited

![HUD.gif]hudbordersmall

  • SmallCubesLinear

To set SmallCubesLinear:

      hud.waitingMode = .SmallCubesLinear

hud

  • SmallCubesBorders

To set SmallCubesLinear:

      hud.waitingMode = .SmallCubesBorders

hudborder

How use it

To show the HUD just:

CPSimpleHUD.shareWaitingView.show()

To show the HUD just:

CPSimpleHUD.shareWaitingView.hide()

The dark view in the background and the label are customisable.

Autolayout

You can change the autolayout rules of the darkview and as a result the interior cubes will change:

        hud.heightDarkViewContraint.constant = 50;
        hud.widthDarkViewContraint.constant = 50;

hudbordersmall

How can I add it to my project?

Frameworks required:

  • Foundation.framework
  • UIKit.framework

If you're gonna use it in swift code, just copy the CPSimpleHUD.swift file in your project.

If you're gonna use it in Objective-C:

  • Copy CPSimpleHUDObjectiveCTypes too.
  • Add the import to your umbrella file:
#import "CPSimpleHUDObjectiveCTypes.h"
  • Add the import in your Objective-C file where you're gonna use it:
#import "ProjectName-Swift.h"
#import "CPSimpleHUDObjectiveCTypes.h"