Latest 1.1.0
Homepage https://github.com/Echo-BraveShine/ShineHud
License MIT
Platforms ios 9.0
Frameworks UIKit
Authors

ShineHud

ShineHud 基于Swift4.0 轻量级HUD框架 支持横屏

ShineHud

安装ShineHud

通过cocoapods安装

pod 'ShineHud', '~> 1.1.0'

使用

/// 核心创建方法
///
/// - Parameters:
///   - style: HUD样式
///   - maskStyle: 背景样式
///   - afterDelay: 显示时长 不写即永久
///   - radius: 圆角
///   - ofsetX: 水平偏移量
///   - ofsetY: 垂直偏移量
///   - diyView: 自定义的view
///   - title: 标题
///   - detailTitle: 副标题
///   - margin: 内边距
///   - effectStyle: 毛玻璃样式
public func show(style : ShineStyle? = nil,maskStyle : ShineMaskStyle? = nil,afterDelay : TimeInterval? = nil,radius : CGFloat? = nil,ofsetX : CGFloat? = nil,ofsetY : CGFloat? = nil,diyView : UIView? = nil,title : String? = nil,detailTitle : String? = nil,margin : CGFloat? = nil,effectStyle : UIBlurEffectStyle? = nil)

通过view.shine.show()方法传参数调用

view.shine?.show(style: <#T##ShineView.ShineStyle?#>, maskStyle: <#T##ShineView.ShineMaskStyle?#>, afterDelay: <#T##TimeInterval?#>, radius: <#T##CGFloat?#>, ofsetX: <#T##CGFloat?#>, ofsetY: <#T##CGFloat?#>, diyView: <#T##UIView?#>, title: <#T##String?#>, detailTitle: <#T##String?#>, margin: <#T##CGFloat?#>, effectStyle: <#T##UIBlurEffectStyle?#>)

或者通过初始化调用 1.1.0之后的版本可以先show() 再更改属性

let shine = view.shine
shine?.style = .activity
shine?.afterDelay = 3
shine?.title = "这是一个菊花"
shine?.detailTitle = "菊花3秒后消失"
shine?.show()

其中HUD类型有

/// HUD的类型
///
/// - normal: 默认只有文字
/// - activity: 菊花转圈
/// - cycleLoop: 圆形跑圈
/// - success: 成功图标
/// - error: 失败图标
/// - progress: 直线型进度条
/// - roundProgress: 圆形进度条
/// - custom: 自定义view
public enum ShineStyle {
case normal,activity,cycleLoop,success,error,progress,roundProgress,custom
}

HUD圆角大小

/// 内容区域圆角
public var radius : CGFloat = 5.0

HUD内边距

public var margin : CGFloat?

显示时长

/// 消失时长 默认hiden 立即消失
public var afterDelay : TimeInterval = 0.2

progress进度

/// 进度
public var progress : CGFloat

自定义的view

/// 自定义的view
public var diyView : UIView?

Latest podspec

{
    "name": "ShineHud",
    "version": "1.1.0",
    "summary": "Swift u8f7bu91cfu7ea7HUDu6846u67b6",
    "description": "u8f7bu91cfu7ea7u6846u67b6u4f7fu7528u65b9u4fbf,u57fau4e8eSwift4.0,u6301u7eedu66f4u65b0",
    "homepage": "https://github.com/Echo-BraveShine/ShineHud",
    "license": "MIT",
    "authors": {
        "BraceShine": "[email protected]"
    },
    "source": {
        "git": "https://github.com/Echo-BraveShine/ShineHud.git",
        "tag": "v1.1.0"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "ShineHud/ShineHud/ShineHud/*.{swift}",
    "frameworks": "UIKit",
    "resources": "ShineHud/ShineHud/Resource/*.{png,xib,plist}",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This