Latest 0.1.0
Homepage https://github.com/ajijoyo/AJPopAlert
License MIT
Platforms ios 9.0
Dependencies SnapKit
Authors

CI Status
Version
License
Platform

Example

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

Requirements

Xcode 10+
Swift 4.2

Installation

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

pod 'AJPopAlert'

Usage

Default Alert


let vc = AJPopAlert(title: "Lorem Ipsum", message: "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum",position:.bottom)
vc.addAction(title: "Ok") { (action) in
  print("ok")
}
vc.addAction(title: "Later") { (action) in
  print("later")
}        
vc.addAction(title: "Cancel", type: .destructive) { (action) in
  action.dismiss(animated: true, completion: nil)
}        
vc.show()

customization

Custom View


let customView = MyCustomView()
let vc = AJPopAlert(customView: customView)

vc.addAction(title: "Ok") { (action) in
     print("ok")
}
vc.addAction(title: "Later") { (action) in
     print("later")
}

vc.addAction(title: "Cancel", type: .destructive) { (action) in
     action.dismiss(animated: true, completion: nil)
}

vc.show()

Custom Action

Make sure you inheritent AJPopAction add pass to addAction(popAction: <#T##AJPopAction#>)

class MyCustomAction : AJPopAction {
  init(){
    type = .normal

  }
}

//// in other class

let customView = MyCustomView()
let vc = AJPopAlert(customView: customView)

vc.addAction(title: "Ok") { (action) in
     print("ok")
}
vc.addAction(title: "Later") { (action) in
     print("later")
}
let action = MyCustomAction()
action.action = { (viewcontroller) in 
  print("DidTap")
}
vc.addAction(popAction:action)

vc.show()

Documentation

See in Wiki Tab for further information

Author

ajijoyo, [email protected]

Note

Feel free to pull request for adding new feature or fixing bugs.

License

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

Latest podspec

{
    "name": "AJPopAlert",
    "version": "0.1.0",
    "summary": "Pop Alert to Show Message",
    "swift_version": "4.2",
    "description": "Pop Alert to Show Message with variant type",
    "homepage": "https://github.com/ajijoyo/AJPopAlert",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "ajijoyo": "[email protected]"
    },
    "source": {
        "git": "https://github.com/ajijoyo/AJPopAlert.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "AJPopAlert/Classes/**/*",
    "dependencies": {
        "SnapKit": [
            "~> 4.0.1"
        ]
    }
}

Pin It on Pinterest

Share This