Skip to content

adad184/XXPlaceHolder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XXPlaceHolder

CocoaPods CocoaPods CocoaPods

A drop in solution to set a placeholder or show UIView's size, A Swift version of MMPlaceHolder

demo

Installation

The preferred way of installation is via CocoaPods. Just add

pod 'XXPlaceHolder'

and run pod install. It will install the most recent version of MMPlaceHolder.

If you would like to use the latest code of MMPlaceHolder use:

pod 'XXPlaceHolder', :head

Usage

simply, you only need one line code.

yourView.showPlaceHolder()

or you can customize youself.

func showPlaceHolder()
func showPlaceHolderWith(lineColor: UIColor)
func showPlaceHolderWith(lineColor: UIColor, backColor: UIColor)
func showPlaceHolderWith(lineColor: UIColor, backColor: UIColor, arrowSize: CGFloat)
func showPlaceHolderWith(lineColor: UIColor, backColor: UIColor, arrowSize: CGFloat, lineWidth: CGFloat)
func showPlaceHolderWith(lineColor: UIColor, backColor: UIColor, arrowSize: CGFloat, lineWidth: CGFloat, frameWidth: CGFloat, frameColor: UIColor)

func showPlaceHolderWithAllSubviews()
func showPlaceHolderWithAllSubviewsWith(maxPath: UInt)


func hidePlaceHolder()
func hidePlaceHolderWithAllSubviews()
func removePlaceHolder()    
func removePlaceHolderWithAllSubviews()

func getPlaceHolder() -> XXPlaceHolder?

and you can use the global configuration

struct XXPlaceHolderConfig {
    
    var backColor: UIColor
    var arrowSize: CGFloat
    var lineColor: UIColor
    var lineWidth: CGFloat
    var frameColor: UIColor
    var frameWidth: CGFloat
    
    var showArrow: Bool
    var showText: Bool

    var visible: Bool
    var autoDisplay: Bool
    var autoDisplaySystemView: Bool
    
    var visibleMemberOfClasses: [AnyClass] = [AnyClass]()
    var visibleKindOfClasses: [AnyClass]   = [AnyClass]()
}

Changelog

1.1 Fix Access Control under using framework

1.0 Migrate code from Objective-C into Swift, fully compatible with MMPlaceHolder

About

Swift version of MMPlaceHolder

Resources

License

Stars

Watchers

Forks

Packages

No packages published