LSDialogViewController 4.0

LSDialogViewController 4.0

测试已测试
语言语言 SwiftSwift
使用许可 MIT
发布最后发布2019年11月
SPM支持 SPM

Daisuke Hasegawa维护。



  • 作者:
  • daihase

Language: Swift 5.0 License Platform CocoaPodsDL Carthage Compatible

LSDialogViewController 能够轻松地将自定义视图作为对话框显示。

LSDialogViewController_animation

需求

  • Swift 2+ (Swift 4.2 已就绪)👍)
  • iOS 8.0+

安装

从 CocoaPods 安装

LSDialogViewController 通过 CocoaPods 提供。要安装它,只需将以下行添加到Podfile中:

# for Swift 4.2
pod 'LSDialogViewController', '~> 3.0'

# for Swift 3
pod 'LSDialogViewController', '~> 0.1.9'

# for Swift 2
pod 'LSDialogViewController', '0.1.0'

从 Carthage 安装

将此行添加到 Cartfile。

github "daihase/LSDialogViewController"

然后,运行此命令。

$ carthage update

用法

要运行示例项目,首先克隆存储库,然后从示例目录运行pod install

示例

import LSDialogViewController
// to show the dialog
let dialogViewController: CustomDialogViewController = CustomDialogViewController(nibName:"CustomDialog", bundle: nil)
dialogViewController.delegate = self
self.presentDialogViewController(dialogViewController, animationPattern: animationPattern, completion: { () -> Void in })

// to dismiss the dialog
self.dismissDialogViewController(animationPattern)

配置

presentDialogViewController(
  // required
  dialogViewController: :UIViewController,
  // default LSAnimationPattern.FadeInOut
  animationPattern: LSAnimationPattern,
  // default LSDialogBackgroundViewType.Solid
  backgroundViewType: LSDialogBackgroundViewType,
  // default true
  dismissButtonEnabled: Bool,
  // optional
  completion: (() -> Swift.Void)?
)

其他背景视图类型。(.Gradient .None)

Image . Image

许可协议

LSDialogViewController适用于MIT许可协议。有关更多信息,请参阅LICENSE文件。