Coder Social home page Coder Social logo

sgr-ksmt / alertift Goto Github PK

View Code? Open in Web Editor NEW
283.0 9.0 21.0 1.79 MB

Swifty, modern UIAlertController wrapper.

License: MIT License

Ruby 1.75% Objective-C 1.50% Swift 96.75%
swift alert actionsheet uikit wrapper library cocoapods carthage modern

alertift's Introduction

visitor badge


Hi there πŸ‘‹

My name is Suguru Kishimoto. Please call me su- 😎
I have about ten year's experience in an iOS software engineer.

See more about me: https://sgr-ksmt.dev/


SNS

Twitter LinkedIn Qiita Zenn


Skills

Swift/SwiftUI Dart TypeScript Objective-C Ruby PHP

iOS Flutter Node React Next

Firebase GCP

Xcode VSCode Vim Zsh

Stats

su-'s github stats
Top Langs trophy

sgr-ksmt's github activity graph

Dart         2 hrs 53 mins   β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–’β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘   61.08 %
TypeScript   50 mins         β–ˆβ–ˆβ–ˆβ–ˆβ–’β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘   17.77 %
JSON         36 mins         β–ˆβ–ˆβ–ˆβ–’β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘   12.93 %
Other        12 mins         β–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘   04.56 %
YAML         6 mins          β–“β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘   02.44 %

alertift's People

Contributors

1amageek avatar lambdadigamma avatar onmotion avatar sgr-ksmt avatar xuaninbox avatar ykws avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

alertift's Issues

Syntax error on Swift 4.2

hello.
I found some problem with Swift 4.2 and Xcode 10,
Legacy Build System(under File > Workspace Settings... )

I use alertift 4.0 with cocoapds, It occurs syntax error at InnerAlertController.swift, Lines 162: source here

func registerTextFieldObserver(_ textField: UITextField) {
        NotificationCenter.default.addObserver(
            self,
            selector: #selector(self.textFieldDidChange(_:)),
            name: UITextField.textDidChangeNotification, object: textField
        )
    }

Xcode guides to fix it like this.

    func registerTextFieldObserver(_ textField: UITextField) {
        NotificationCenter.default.addObserver(
            self,
            selector: #selector(self.textFieldDidChange(_:)),
            name: Notification.Name.UITextFieldTextDidChange, object: textField
        )
    }

I fork and clone this repo, and load demo app - I can't reappearance that error.

Add icon to UIAlertAction button

How can i add icon to Action button and set the text alignment to left on Action Button.

For reference, you can see the whatsApp. I need exactly to WhatsApp action sheet.
whatsapp image 2017-11-19 at 2 02 15 am

Scroll to specific action

I am using your lib to add several actions to the Alert. Is it possible to scroll the list to a desired position?

Add actions at once

Alertift can only add action one by one for now.
It will make it possible to add actions at once.

Alertift.actionSheet(message: "Which food do you like?")
   .popover(sourceView: self.view, sourceRect: button.frame)
   .actions([.default("🍣"), .default("🍎"), .default("πŸ–"), .default("πŸ…")]) { action, index in
       if action.style == .cancel {
           return
       }
       Alertift.alert(message: "\(index). \(action.title!)")
           .action(.default("OK"))
           .show()
    }
    .show(on: self)

Disable action

Hello, have a nice day.
I need to disable action until textField.text.isEmpty. How i can do this?

On the cocoapods search less than

➜ ~ pod --version
1.2.1
➜ ~ pod search Alertift
[!] Unable to find a pod with name, author, summary, or description matching Alertift

Cannot show Alertift

Here is the log when open:

Warning: Attempt to present <Alertift.InnerAlertController: 0x7fd4f816d000> on <UINavigationController: 0x7fd4f8012a00> whose view is not in the window hierarchy!

No Issue but Code Further optimization

First of all well done a very good and complete written wrapper for UIAlert Controller. So my point is that when a user call action sheet on iPhone or iPad so your code should automattically set popover if device is a iPad so there is no need of user decision.

Does not work on Swift 4.2

Some minor APIs were renamed in Swift 4.2, current version does not compile/run on latest Xcode/Swift. I can make a pull request if you do not have time but the changes are very minor

Abolish AlertBase

  • Implement AlertType protocol instead of AlertBase.
  • Alert, ActionSheet will be not inherited AlertBase , but be adapted AlertType protocol.

Change color

Add function of changing alert's (title/message/background/button) color

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.