Latest 0.1.1
Homepage https://github.com/MrDML/MLFloatView
License MIT
Platforms ios 8.0
Authors

CI Status
Version
License
Platform

Preview

Demo

Example

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

Requirements

Installation

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

pod 'MLFloatView'

Example Use

// 设置frame
func initializeStyleOne(){
// 在初始化之前设置一些默认值
MLFloatView.configFloatViewDefaultValue(edgeScreenOffset: 5, distanceTaBarOffset: 20, isAnimation: true)
floatView = MLFloatView.init(image: UIImage.init(named: "redpacket"))
let size = (floatView.image?.size)!
let screenWidth = UIScreen.main.bounds.width
let screenHeigh = UIScreen.main.bounds.height
floatView.frame.origin = CGPoint(x: screenWidth - size.width - 20, y: screenHeigh - size.height - 50)
floatView.delegate = self
floatView.clickActionBlock = {(floatView) -> Void in
print("(#line):(#function)")
}
self.view .insertSubview(floatView, at: self.view.subviews.count)
}

// 无需设置frame 快速创建
func initializeStyleTwo(){
// 在初始化之前设置一些默认值
MLFloatView.configFloatViewDefaultValue(edgeScreenOffset: 5, distanceTaBarOffset: 20, isAnimation: true)
floatView =  MLFloatView.init(image: UIImage.init(named: "redpacket"), stopEdgeLocation: FloatViewAllShowState.AllShowRight)
floatView.clickActionBlock = {(floatView) -> Void in
print("(#line):(#function)")
}
self.view.insertSubview(floatView!, at: self.view.subviews.count)
}

func initializeStyleThree(){
// 在初始化之前设置一些默认值
MLFloatView.configFloatViewDefaultValue(edgeScreenOffset: 5, distanceTaBarOffset: 20, isAnimation: false)
floatView =  MLFloatView.init(image: UIImage.init(named: "redpacket"), stopEdgeLocation: FloatViewAllShowState.AllShowRight)
floatView.clickActionBlock = {(floatView) -> Void in
print("(#line):(#function)")
}
self.view.insertSubview(floatView!, at: self.view.subviews.count)
}

Author

DML, [email protected]

License

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

Latest podspec

{
    "name": "MLFloatView",
    "version": "0.1.1",
    "summary": "MLFloatView Provides an animated and no animated way to display",
    "description": "Provide animation and animation without the way to display, it can quickly create simple and practical.",
    "homepage": "https://github.com/MrDML/MLFloatView",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "DML": "[email protected]"
    },
    "source": {
        "git": "https://github.com/MrDML/MLFloatView.git",
        "tag": "0.1.1"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "MLFloatView/Classes/**/*"
}

Pin It on Pinterest

Share This