Swift UI Kit to present clean modal/alert
Branch: master
Clone or download
loryhuz Merge pull request #3 from ykws/improve-example
Specify a platform for this target in Example Podfile
Latest commit f238224 Jan 28, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
CleanyModal change the way style settings are handled, more extendable Jan 22, 2019
Example Specify a platform for this target in Example Podfile Jan 28, 2019
.gitignore initial commit Aug 29, 2018
CleanyModal.podspec update podspec Jan 22, 2019
LICENSE initial commit Aug 29, 2018
README.md update readme Jan 22, 2019
_Pods.xcodeproj initial commit Aug 29, 2018

README.md


CleanyModal is a good way to use UI-Customised alerts with ease

Features

  • Present some kind of clean alerts (With same API as UIAlertViewController)
  • Add easily Textfields or Custom views as an Alert contains content UIStackView
  • Dismiss modal/alert from interaction gesture
  • Present full-custom components as modal from a container view

Demo

Present highly customizable and clean alert from provided built-in methods:

Use root modal system to present your custom components and use only the navigation/interaction stuff:

Example

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

Preview

Present a clean Alert with default style:

let alertConfig = CleanyAlertConfig(
  title: "Hello world",
  message: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas sed massa a magna semper semper a eget justo")
let alert = MyAlertViewController(config: alertConfig)

alert.addAction(CleanyAlertAction(title: "OK", style: .default))
alert.addAction(CleanyAlertAction(title: "Cancel", style: .cancel))

present(alert, animated: true, completion: nil)

Apply your own style/theme easily :

class MyAlertViewController: CleanyAlertViewController {
  override init(config: CleanyAlertConfig) {
    config.styleSettings[.tintColor] = .yellow
    config.styleSettings[.destructiveColor] = .pink
    super.init(config: config)
  }
}

Need to push customization of your Alerts further ?

Extend styles settings keys :

public extension CleanyAlertConfig.StyleKeys {
  public static let shadowOffset = CleanyAlertConfig.StyleKey<CGSize>("shadowOffset")
}

Then apply these news keys in viewDidLoad() implementation of your custom alert. If you only want to present a custom component (not an alert) as a modal, inherit directly form CleanyModalViewController

See example project to see all abilities to customize, enjoy !

Requirements

  • iOS 9.0+

Installation

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

pod 'CleanyModal', '~> 0.1.1'

Author

lory huz, lory.huz@gmail.com

License

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