Latest 1.1
Homepage https://github.com/adad184/XXPlaceHolder
License MIT
Platforms ios 8.0, requires ARC
Frameworks UIKit
Authors

[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

Latest podspec

{
    "name": "XXPlaceHolder",
    "platforms": {
        "ios": "8.0"
    },
    "summary": "A drop in solution to show UIView's size. Only one line code to use it. Swift version of MMPlaceHolder",
    "requires_arc": true,
    "version": "1.1",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "adad184": "[email protected]"
    },
    "homepage": "https://github.com/adad184/XXPlaceHolder",
    "source": {
        "git": "https://github.com/adad184/XXPlaceHolder.git",
        "tag": "1.1"
    },
    "frameworks": "UIKit",
    "source_files": "Classes/*.{swift}"
}

Pin It on Pinterest

Share This