Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Live animated Alert View for iOS written in Swift

License

NotificationsYou must be signed in to change notification settings

codestergit/SweetAlert-iOS

Repository files navigation

Beautiful Animated custom Alert View inspired from javascript librarySweetAlert.Written in Swift this SweetAlertView can be used in Swift and Objective-C projects. SweetAlertView provides live intutive experience to user actions.It can be used in place ofUIAlertView andUIAlertController

###ScreenShotsSweetAlert

###Usage#####Basic message:

SweetAlert().showAlert("Here's a message!")

#####Title with a text under:

SweetAlert().showAlert("Here's a message!", subTitle:"It's pretty, isn't it?", style:AlertStyle.None)

#####Animated Success message:

SweetAlert().showAlert("Good job!", subTitle:"You clicked the button!", style:AlertStyle.Success)

#####Warning message and Chained Animated Success messge on completion:

SweetAlert().showAlert("Are you sure?", subTitle:"You file will permanently delete!", style:AlertStyle.Warning, buttonTitle:"Cancel", buttonColor:UIColorFromRGB(0xD0D0D0), otherButtonTitle:"Yes, delete it!", otherButtonColor:UIColorFromRGB(0xDD6B55)){(isOtherButton)->Voidinif isOtherButton==true{println("Cancel Button  Pressed")}else{SweetAlert().showAlert("Deleted!", subTitle:"Your imaginary file has been deleted!", style:AlertStyle.Success)}}

#####Chained Alerts on actions with custom button colors:

//Chaining alerts with messages on button clickSweetAlert().showAlert("Are you sure?", subTitle:"You file will permanently delete!", style:AlertStyle.Warning, buttonTitle:"No, cancel plx!", buttonColor:UIColorFromRGB(0xD0D0D0), otherButtonTitle:"Yes, delete it!", otherButtonColor:UIColorFromRGB(0xDD6B55)){(isOtherButton)->Voidinif isOtherButton==true{SweetAlert().showAlert("Cancelled!", subTitle:"Your imaginary file is safe", style:AlertStyle.Error)}else{SweetAlert().showAlert("Deleted!", subTitle:"Your imaginary file has been deleted!", style:AlertStyle.Success)}}

#####Custom icon alert:

SweetAlert().showAlert("Sweet!", subTitle:"Here's a custom image.", style:AlertStyle.CustomImag(imageFile:"thumb.jpg"))

###Diffrent Animated Styles for Diffrent Purposes

enumAlertStyle{case Success,Error,Warning,Nonecase CustomImag(imageFile:String)}

###InstallationAdd theSwiftAlert.swift in to your project.

###Reuirements

  • Xcode 7.0+
  • iOS 7.0+

License

The MIT License (MIT)Copyright (c) 2014 codestergitPermission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.

About

Live animated Alert View for iOS written in Swift

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp