MMActionSheet-Swift 0.1.1

MMActionSheet-Swift 0.1.1

MM-Lei 维护。



  • lh

MMActionSheet

一个简单的 actionSheet 选择控件,防止微信底部 sheet 弹出框弹出。支持自定义颜色

导入方法

  1. 使用 CocoaPods 导入

    在文件 Podfile 中加入以下内容:

        pod 'MMActionSheet-Swift', '~> 0.1.0'
    

    然后运行以下命令:

    pod install 或 pod update
    
  2. 手动导入

    复制工程中 MMActionSheet 文件夹下的 MMActionSheet.swift 文件即可

使用

  1. 使用默认的颜色方案
        let items = ["拍照","相册"]
        let sheet =  MMActionSheet(title: "选择", items: items)
        sheet.handelChooseAction { (index) in
            print("选择了---\(items[index])")
        }
        sheet.handelCancelAction {
            print("取消选择")
        }
  1. 自定义颜色

    	let item1 = MMActionSheetItem(title: "查看", color: UIColor.black)
      	let item2 = MMActionSheetItem(title: "删除", color: UIColor.red)
        let items = [item1,item2]
        
    	let sheet =  MMActionSheet(title: "选择", items: items)
       	sheet.handelChooseAction { (index) in
          print("选择了---\(index)")
        }
       	sheet.handelCancelAction {
        	print("取消选择")
        }