Giter Club home page Giter Club logo

simple_si's Introduction

SimpleSI for RubyMotion

I wanted a dead simple way to call SIAlertView (https://github.com/Sumi-Interactive/SIAlertView) in one line, similar to BubbleWrap's App.alert().

Setup

Add simple_si to your Gemfile, and run bundle install:

gem 'motion-cocoapods'
gem 'simple_si'

Edit the Rakefile of your RubyMotion project and add the following require line:

# After the line that require Rubymotion
require 'bundler'
Bundler.require

Then add SIAlertView to your pods list in your Rakefile:

app.pods do
  pod 'SIAlertView'
end

Usage

Basic:

SimpleSI.alert('Hello World!')

Custom:

SimpleSI.alert({
  title: "My App",
  message: "Are you sure?",
  transition: "drop_down", # or "slide_from_bottom", "slide_from_top", "fade" or "bounce"
  buttons: [
    {title: "Destroy", action: :destroy}, # no type specify become default styling
    {title: "Cancel", type: "cancel"} # action is secondary
  ],
  delegate: self # Needed if you want to call method of a class with your button
})

Transition

Here's the string you can pass to the transition property of the constructor (secondary). The default value is "slide_from_bottom".

  • "drop_down"
  • "slide_from_top"
  • "slide_from_bottom"
  • "fade"
  • "bounce"

Buttons

You have 3 types of styling for buttons (secondary). The default value is "default" (that's original).

  • "default"
  • "destructive"
  • "cancel"

To-do

  • Write specs

Contributions

Fork, improve, submit a pull request.

simple_si's People

Contributors

swatto avatar forrestgrant avatar dam13n avatar

Stargazers

Andrew Havens avatar Liu Lantao avatar  avatar Qi He avatar chunli avatar Hitoshi Okawa avatar Lauri Jutila avatar Casper Hollingberry avatar Bill Gloff avatar Erran Carey avatar Tres Trantham avatar Sam Chueng avatar Florian Bertholin avatar Artyom Keydunov avatar James Miller avatar Clay Allsopp avatar Mateus avatar Michael Erb avatar  avatar Creston Froats avatar

Watchers

 avatar James Cloos avatar  avatar

Forkers

he9qi dam13n

simple_si's Issues

Callback for buttons

Do you want that your user can create buttons with callback on action or you want to keep it as clean as possible.

Because your code is clean but it's a critical missing feature I think.

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.