JDropDownAlert 1.3.0

JDropDownAlert 1.3.0

测试已测试
语言语言 SwiftSwift
许可 MIT
发布最新版本2018年5月
SPM支持 SPM

trilliwon 维护。



  • trilliwon

JDropDownAlert

Swift Platform spm Version License Build Status codecov Issues

JDropDownALert

为任何 iOS 项目提供的简单下拉警告视图。

用法

顶部

    let alert = JDropDownAlert()
    alert.alertWith("U can use just title")
    
    alert.didTapBlock = {
      print("Top View Did Tapped")
    }
    
    let alert = JDropDownAlert()
    alert.alertWith(titleString, message: messageString)
    
    alert.didTapBlock = {
      print("Top View Did Tapped")
    }

带有方向的顶部

    let alert = JDropDownAlert(position: .top, direction: .toLeft)
    alert.alertWith(titleString, message: messageString)
    
    alert.didTapBlock = {
      print("Top View Did Tapped")
    }
    
    let alert = JDropDownAlert(position: .top, direction: .toRight)
    alert.alertWith(titleString, message: messageString, topLabelColor: UIColor.white, messageLabelColor: UIColor.darkGray, backgroundColor: UIColor.brown)

//  alert.alertWith(titleString, message: messageString, topLabelColor: UIColor.white, messageLabelColor: UIColor.darkGray)
//  alert.alertWith(titleString, message: messageString, topLabelColor: UIColor.white)
//  alert.alertWith(titleString, message: messageString)

    
    alert.didTapBlock = {
      print("Top View Did Tapped")
    }

底部

    let alert = JDropDownAlert(position: .bottom)
    alert.alertWith(titleString, message: messageString)
    
    alert.didTapBlock = {
      print("Bottom Alert View Did Tapped")
    }

底部带指南

    let alert = JDropDownAlert(position: .bottom, direction: .toLeft)
    alert.alertWith(titleString, message: messageString)
    
    alert.didTapBlock = {
      print("Bottom Alert View Did Tapped")
    }
    
    let alert = JDropDownAlert(position: .bottom, direction: .toRight)
    alert.alertWith(titleString, message: messageString)
    
    alert.didTapBlock = {
      print("Bottom Alert View Did Tapped")
    }

不同位置和动画方向

  enum AlertPosition {
    case top
    case bottom
  }
  
  enum AnimationDirection {
    case toLeft
    case toRight
    case normal
  }

需求

  • iOS 8.0 +
  • swift 3.0
  • Xcode 8.0

安装

JDropDownAlert 可通过 CocoaPods 获取。要安装它,只需将以下行添加到您的 Podfile。

pod "JDropDownAlert"

将 JDropDownAlert.swift 添加到您的项目中。

致谢

作者

贡献者

欢迎任何贡献。只需提交一个拉取请求。

许可证

JDropDownAlert 采用了 MIT 许可证。有关更多信息,请参阅 LICENSE 文件。

演示动图

top alert bottom alert