Giter Site home page Giter Site logo

soanguyen / kcustomalert Goto Github PK

View Code? Open in Web Editor NEW

This project forked from krishnads/kcustomalert

0.0 1.0 0.0 212 KB

Simple and easy alerts to use instead of default AlertController. Separate Xib is provided to customize as pr your need. Callbacks are easily handled by using Closures.

License: Apache License 2.0

Swift 57.70% C 39.59% Objective-C 2.70%

kcustomalert's Introduction

KCustomAlert

Screenshot 2019-12-09 at 6 41 13 PM

GitHub pages URl here: https://krishnads.github.io/KCustomAlert/.

Let’s not use the default AlertController in our upcoming iOS Apps because it doesn’t feel awesome. To make the alert look better and customised, I just created Common Repo which can be used very easily for all kind of Alerts. So, let’s use this from now on.

Simple and easy alerts to use instead of default AlertController.

Separate Xib is provided to customize as per your need.

Integrate Framework file without writing a single line of code.

Callbacks are easily handled by using Closures.

Demo Video

Screenshots

Usage - It's simpler than anything: You can use it in two ways

1. Use Framework:

Simply Clone/Download the repository and drag KAlert.framework file into your project.

import KAlert in your file where you want to use it.And That's it..!

2. Use Code:

Simply Drag and drop CustomAlert folder in your project. that's it...

Use following samples to use this simple alert

For Simple one:

self.showCustomAlertWith(
    message: "This is a simple alert with a logo and message",
    descMsg: "",
    itemimage: nil,
    actions: nil)

Simple one with callback action on OK button:

let actionYes: () -> Void = { (
    print("tapped OK")
) }
self.showCustomAlertWith(
    okButtonAction: actionYes, // This is optional
    message: "This is a simple alert with a logo and message",
    descMsg: "",
    itemimage: nil,
    actions: nil)

For More Content:

let actionYes : [String: () -> Void] = [ "YES" : { (
        print("tapped YES")
) }]
let actionNo : [String: () -> Void] = [ "No" : { (
    print("tapped NO")
) }]
let arrayActions = [actionYes, actionNo]

self.showCustomAlertWith(
    message: "This is an alert with a logo, message, additional icon, description, and 2 buttons with handlers",
    descMsg: "your description goes here. Change font size from XiB file.",
    itemimage: #imageLiteral(resourceName: "icon"),
    actions: arrayActions)

Contact Me:

Krishna Datt Shukla

Sr. iOS Developer

Konstant Info Solutions Pvt. Ltd.

Skype: krishnads03

Email: [email protected]

kcustomalert's People

Contributors

krishnads avatar yonodactyl avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.