Giter Site home page Giter Site logo

sclalertview-swift's Introduction

SCLAlertView

Version Carthage compatible

Animated Alert View written in Swift, which can be used as a UIAlertView or UIAlertController replacement with nice customization features.

BackgroundImage_ BackgroundImage

Easy to use

Get Started

// Get started
SCLAlertView().showInfo("Important info", subTitle: "You are great")

Updating the alert view

let alertViewResponder: SCLAlertViewResponder = SCLAlertView().showSuccess("Hello World", subTitle: "This is a more descriptive text.")

// Upon displaying, change/close view
alertViewResponder.setTitle("New Title") // Rename title
alertViewResponder.setSubTitle("New description") // Rename subtitle
alertViewResponder.close() // Close view

Alternative alert types

SCLAlertView().showError("Hello Error", subTitle: "This is a more descriptive error text.") // Error
SCLAlertView().showNotice("Hello Notice", subTitle: "This is a more descriptive notice text.") // Notice
SCLAlertView().showWarning("Hello Warning", subTitle: "This is a more descriptive warning text.") // Warning
SCLAlertView().showInfo("Hello Info", subTitle: "This is a more descriptive info text.") // Info
SCLAlertView().showEdit("Hello Edit", subTitle: "This is a more descriptive info text.") // Edit

Raw call to showTitle()

SCLAlertView().showTitle(
    "Congratulations", // Title of view
    subTitle: "Operation successfully completed.", // String of view
    duration: 2.0, // Duration to show before closing automatically, default: 0.0
    completeText: "Done", // Optional button value, default: ""
    style: .success, // Styles - see below.
    colorStyle: UIColorFromRGB(0xA429FF),
    colorTextButton: .white
)

Controls

Custom Appearance

// SCLAlertView.SCLAppearanc has more than 15 different properties to customize. See below.

let appearance = SCLAlertView.SCLAppearance(
    kTitleFont: UIFont(name: "HelveticaNeue", size: 20)!,
    kTextFont: UIFont(name: "HelveticaNeue", size: 14)!,
    kButtonFont: UIFont(name: "HelveticaNeue-Bold", size: 14)!,
    showCloseButton: false
)

let alert = SCLAlertView(appearance: appearance)

Add buttons

let alertView = SCLAlertView()
alertView.addButton("First Button", target:self, selector:Selector("firstButton"))
alertView.addButton("Second Button") {
    print("Second button tapped")
}
alertView.showSuccess("Button View", subTitle: "This alert view has buttons")

Hide default close button

let appearance = SCLAlertView.SCLAppearance(
    showCloseButton: false
)
let alertView = SCLAlertView(appearance: appearance)
alertView.showSuccess("No button", subTitle: "You will have hard times trying to close me")

Hide default close button & a duration to close the alert

let appearance = SCLAlertView.SCLAppearance(
    showCloseButton: false
)
let alertView = SCLAlertView(appearance: appearance)
alertView.showWarning("No button", subTitle: "Just wait for 3 seconds and I will disappear", duration: 3)

Hide alert icon

let appearance = SCLAlertView.SCLAppearance(
    showCircularIcon: false
)
let alertView = SCLAlertView(appearance: appearance)
alertView.showSuccess("No icon", subTitle: "This is a clean alert without Icon!")

Use a custom icon

let appearance = SCLAlertView.SCLAppearance(
    showCircularIcon: true
)
let alertView = SCLAlertView(appearance: appearance)
let alertViewIcon = UIImage(named: "IconImage") //Replace the IconImage text with the image name
alertView.showInfo("Custom icon", subTitle: "This is a nice alert with a custom icon you choose", circleIconImage: alertViewIcon)

Add Text fields

// Add a text field
let alert = SCLAlertView()
let txt = alert.addTextField("Enter your name")
alert.addButton("Show Name") {
    print("Text value: \(txt.text)")
}
alert.showEdit("Edit View", subTitle: "This alert view shows a text box")

Use a custom subview instead of a subtitle

// Example of using the view to add two text fields to the alert
// Create custom Appearance Configuration
let appearance = SCLAlertView.SCLAppearance(
    kTitleFont: UIFont(name: "HelveticaNeue", size: 20)!,
    kTextFont: UIFont(name: "HelveticaNeue", size: 14)!,
    kButtonFont: UIFont(name: "HelveticaNeue-Bold", size: 14)!,
    showCloseButton: false,
    dynamicAnimatorActive: true
)

// Initialize SCLAlertView using custom Appearance
let alert = SCLAlertView(appearance: appearance)

// Creat the subview
let subview = UIView(frame: CGRect(x: 0,y: 0,width: 216,height: 70))
let x = (subview.frame.width - 180) / 2

// Add textfield 1
let textfield1 = UITextField(frame: CGRect(x: x,y: 10,width: 180,height: 25))
textfield1.layer.borderColor = UIColor.green.cgColor
textfield1.layer.borderWidth = 1.5
textfield1.layer.cornerRadius = 5
textfield1.placeholder = "Username"
textfield1.textAlignment = NSTextAlignment.center
subview.addSubview(textfield1)

// Add textfield 2
let textfield2 = UITextField(frame: CGRect(x: x,y: textfield1.frame.maxY + 10,width: 180,height: 25))
textfield2.isSecureTextEntry = true
textfield2.layer.borderColor = UIColor.blue.cgColor
textfield2.layer.borderWidth = 1.5
textfield2.layer.cornerRadius = 5
textfield1.layer.borderColor = UIColor.blue.cgColor
textfield2.placeholder = "Password"
textfield2.textAlignment = NSTextAlignment.center
subview.addSubview(textfield2)

// Add the subview to the alert's UI property
alert.customSubview = subview
_ = alert.addButton("Login") {
    print("Logged in")
}

// Add Button with visible timeout and custom Colors
let showTimeout = SCLButton.ShowTimeoutConfiguration(prefix: "(", suffix: " s)")
_ = alert.addButton("Timeout Button", backgroundColor: UIColor.brown, textColor: UIColor.yellow, showTimeout: showTimeout) {
    print("Timeout Button tapped")
}

let timeoutValue: TimeInterval = 10.0
let timeoutAction: SCLAlertView.SCLTimeoutConfiguration.ActionType = {
    print("Timeout occurred")
}

_ = alert.showInfo("Login", subTitle: "", timeout: SCLAlertView.SCLTimeoutConfiguration(timeoutValue: timeoutValue, timeoutAction: timeoutAction))

List of properties to customize

// Button 
kButtonFont: UIFont                     
buttonCornerRadius : CGFloat            
showCloseButton: Bool                   
kButtonHeight: CGFloat                  

// Circle Image
showCircularIcon: Bool
kCircleTopPosition: CGFloat
kCircleBackgroundTopPosition: CGFloat
kCircleHeight: CGFloat
kCircleIconHeight: CGFloat

// Text
kTitleFont: UIFont
kTitleTop:CGFloat
kTitleHeight:CGFloat
kTextFont: UIFont
kTextHeight: CGFloat
kTextFieldHeight: CGFloat
kTextViewdHeight: CGFloat

// View 
kDefaultShadowOpacity: CGFloat          
kWindowWidth: CGFloat
kWindowHeight: CGFloat
shouldAutoDismiss: Bool // Set this false to 'Disable' Auto hideView when SCLButton is tapped
fieldCornerRadius : CGFloat
contentViewCornerRadius : CGFloat
disableTapGesture: Bool // set this to true if adding tableview to subView

Alert View Styles

enum SCLAlertViewStyle: Int {
    case success, error, notice, warning, info, edit, wait, question
}

Alert show animation Styles

// Animation Styles
public enum SCLAnimationStyle {
    case noAnimation, topToBottom, bottomToTop, leftToRight, rightToLeft
}

Installation

SCLAlertView is available through

To install add the following line to your Podfile:

pod 'SCLAlertView'

To install add the following line to your Cartfile:

github "vikmeup/SCLAlertView-Swift" "master"

Collaboration

I tried to build an easy to use API, while beeing flexible enough for multiple variations, but I'm sure there are ways of improving and adding more features, so feel free to collaborate with ideas, issues and/or pull requests.

Incoming improvements

  • More animations
  • Performance tests

Has been developed initially for the Scroll Feed app

sclalertview-swift's People

Contributors

alec-c4 avatar algrid avatar andriygo avatar aymenworks avatar blazierkyle avatar chancywu avatar christiancabarrocas avatar christiansteffens avatar dsxniubility avatar fahimf avatar filmhomage avatar frantzmiccoli avatar hslightnin avatar jerome1210 avatar joseph-montanez avatar kam800 avatar kee23 avatar lastmove avatar m-tatsuto avatar mbutan avatar ncerezo avatar oswagner avatar pgmy avatar rizanha avatar rkorimba avatar ssut avatar tache avatar vikmeup avatar ytakzk avatar zeusent 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  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

sclalertview-swift's Issues

Keyboard Hiding SCLAlertView

First of all, Thank you for this great project.

One little problem: After adding textfield to the alert view, whenever keyboard pops up, it's blocking everything below the textview.

Any advice?

Argument 'subTitle' must precede 'title'

I am getting the following error "Argument 'subTitle' must precede 'title' "

My code is correct only , and here is the snippet,

let alert = SCLAlertView()
alert.addButton("First Button", target:self, selector:Selector("firstButton"))
alert.addButton("Second Button") {
println("Second button tapped")
}
alert.showSuccess(self, title: "Button View", subTitle: "This alert view has buttons")

Cocoapods Version Out of Date

The most recent version of SCLAlertView-Swift on Cocoapods is 0.3.1, which suffers from issue #56 - not being updated to support Swift 1.2. The master branch (which is tag 0.3.2) includes the required fixes, and so it would be great if the Cocoapods version could be updated to match the latest master.

Alert with one button and custom close text

Hi. First of all, thank you for great alert view! I'm trying to create alert view with one action button and one close button with custom text, but I can't achieve that. I can do it separately: alert view with one action button and with "Done" close button text or an simple alert without action button with my own custom close text. But how to make both of them? Thank you.

subtitle gets cut off in a certain specific way

There's something about the character count or word wrapping that causes this.
Unable to determine your location is shown as Unable to determine your

Trying these two will display exactly as intended though:
Unable to determine your locatio
Unable to determine your location.

It does not work when use the AlertView in the present ViewController

When i use the SCLAlertView in the presented ViewController it will not work.

And then i change the code from:

let rv = UIApplication.sharedApplication().keyWindow.subviews.first as UIView

to

let rv = UIApplication.sharedApplication().keyWindow.subviews.last as UIView

then it works!

How to use in a navigation controller

Hey there, I've got a table view controller I'm passing in as "self" for the alert view. However, this table view controller is nested in a navigation controller, so when the alert view shows up, the navigation bar is not darkened and the alert view is centered between the bottom of the device and the navigation bar, not the top of the device.

How do I solve this?

Compile Error for Swift

I attempted to install this library as a pod, and get these errors right away when compiling
screen shot 2014-10-20 at 12 20 39 pm

Beta 6

Couple of issues with beta 6 that was released today. Appreciate your work. :)

Podfile update?

Hi vikmeup, I'm integrating this using Cocoapods into a new app, and after running pod update everything was pulled in correctly, but did not include the recent changes that you merged. Is there an easy way to fix that?

Xcode6-Beta4 Mach-O Librarian Error

Hi there,

I added the project through Cocoapods but I am getting the following error when trying to compile:

error: /Applications/Xcode6-Beta4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: unknown option character `X' in: -Xlinker

any help would be much appreciated.
thank you in advance.

no fading when tapping 'Done' (double calling 'hideView' method) & odd Circle Position

Hello,

First of all, thank you so much for your great work.


It seems 'hideView' method called twice when the 'Done' button tapped. Due to that 'double function calling' the fading animation always cancels as I titled this issue. It happens not only in my project but in SCLAlertViewExample project as well. Please have a check.

Another one, I found the Y positions of CircleView & CircleBG are a bit irregular in current version. I made a fixed fork for this.

Tested with xcode6.3.1 + Yosemite 10.10.3 / iPhone5 & 6simulator

Doesn't Compile in Beta4

Hi there...
Thanks so much for the brilliant component.

I added the project via pods in Beta4, get a compilation error
["X" not found ... ]

Using showCloseButton raises an EXC_BAD_ACCESS error once tapping a button

Reproduciblity

I have been experiencing this in one of my project and been able to reproduce this just starting from the simple "Single View Application template", adding a button and connecting it to the IBOutlet below:

import UIKit

import SCLAlertView

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

    @IBAction func onTouchUpInside(sender: AnyObject) {
        let alertView = SCLAlertView()

        // if you comment the line below you won't get anymore crash
        alertView.showCloseButton = false

        alertView.addButton("button 1", action: {
            println("action 1")
        })

        alertView.showError("Some Error", subTitle: "Some text")

    }

}

I have been using the last revision e8fd675 installed through CocoaPods. The Podfile is:

source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
platform :ios, '8.0'

pod 'SCLAlertView', :git => 'https://github.com/vikmeup/SCLAlertView-Swift.git', :branch => 'master'

Environment

The problem has been reproduced using:

  • Swift 1.2
  • XCode 6.3.2 and 6.4.3
  • iOS 8.3

More information

Unfortunately the error is not very explicit, though tweaking on my original project (adding breakpoints) I saw at some point some unrecognized selector sent to instance that was related with handling the tap on the buttons and the buttons state. I am not able to get that full message back unfortunately, nor I have yet found a solution to this bug.

ccing @ncerezo author of the showCloseButton feature visible in 2c29b16 that looks ok to me. I am curious to know if you reproduce this as well.

BAD_ACCESS on button tap

Hi, I've opened your example project and when I tap any button it throws an exception EXC_BAD_ACCESS into class AppDelegate: UIResponder, UIApplicationDelegate {. What I am doing wrong?

Thanks.

no option to disable fly from top Animation

Please add an option to disable the alert presenting animation.

Either add an animation interval parameter or a bool to enable or disable it

self.baseView.frame.origin.y = -400
        UIView.animateWithDuration(animationInterval, animations: {
            self.baseView.center.y = rv.center.y + 15
            self.view.alpha = 1
            }, completion: { finished in
                UIView.animateWithDuration(0.2, animations: {
                    self.baseView.center = rv.center
                })
        })

Draw all graphics (icons) programatically

I've noticed you use .xcassets containing all the graphic files related to the alert view. However, you could make it much more easier (and faster) if all the graphics were drawn using code. Have a look at PaintCode, they have just released an update which can generate Swift code.

If you are interested, I can make the changes and then create the pull request. If you have the original vector files, that would make it even easier.

Standard Button always hides the AlertView?

Hi, i cant find an option to change the behavior of the standard button. What i want to achieve is an alertview with only one button and an custom action.

thanks in advance

Inconsistency between completeText and closeButtonTitle

While working on the documentation I have seen that some functions use the wording completeText while others use closeButtonTitle. I think that this is inconsistent and should be unified.

I can do the update if needed but I want to know what wording to pick.

In my opinion completeText seems the most appropriate, but if I had to pick I would be explicit that it is a button label and pick closeButtonLabel.

What do you think about it @hackua?

Use of unresolved identifier 'SCLAlertView'

Hi,
Installed via Cocoapods and Podfile , (gem install cocoapods --pre Fetching: cocoapods-core 0.37.0.beta.1.gem (100%)) xCode Version 6.3 (6D570)

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'SwiftHTTP', '> 0.9.4'
pod 'JSONJoy-Swift', '
> 0.9.2'
pod 'SCLAlertView'

SwiftHTTP and other is working but SCLAlertView cudnt resolved, Use of unresolved identifier 'SCLAlertView', if i add import SCLAlertView that time gives no such module SCLAlertView

Thank you

AlertView without the default button

Is it possible to show an AlertView with just one button that performs a function?

As far as I can tell, I can't get rid of the default "Done" button, which only seems to allow me to close the alert. If possible, I would like this Done button to either allow me to segue when pressed, or to be hidden completely so that I can use a custom button to perform this function.

Thanks.

Error occurred when creating new SCLAlertView

Error message from XCode's lldb

Assertion failure in void _UIPerformResizeOfTextViewForTextContainer(NSLayoutManager *,
UIView<NSTextContainerView> *, NSTextContainer *, NSUInteger)(), /SourceCache/UIFoundation_Sim/UIFoundation-376.14/UIFoundation/TextSystem/NSLayoutManager_Private.m:1547
2015-07-24 19:49:25.599 Go RSS[93924:1895263] <NSATSTypesetter: 0x7fe20b12ca80>: Exception Only run on the main thread! raised during typesetting layout manager <NSLayoutManager: 0x7fe20b1f2b50>
    1 containers, text backing has 0 characters
    Currently holding 0 glyphs.
    Glyph tree contents:  0 characters, 0 glyphs, 1 nodes, 64 node bytes, 0 storage bytes, 64 total bytes, 0.00 bytes per character, 0.00 bytes per glyph
    Layout tree contents:  0 characters, 0 glyphs, 0 laid glyphs, 0 laid line fragments, 1 nodes, 64 node bytes, 0 storage bytes, 64 total bytes, 0.00 bytes per character, 0.00 bytes per glyph, 0.00 laid glyphs per laid line fragment, 0.00 bytes per laid line fragment
, glyph range {0 0}. Ignoring...
2015-07-24 19:49:25.599 Go RSS[93924:1895263] *** Assertion failure in void _UIPerformResizeOfTextViewForTextContainer(NSLayoutManager *, UIView<NSTextContainerView> *, NSTextContainer *, NSUInteger)(), /SourceCache/UIFoundation_Sim/UIFoundation-376.14/UIFoundation/TextSystem/NSLayoutManager_Private.m:1547
2015-07-24 19:49:25.654 Go RSS[93924:1895263] <NSATSTypesetter: 0x7fe20b12ca80>: Exception Only run on the main thread! raised during typesetting layout manager <NSLayoutManager: 0x7fe20b1f2b50>
    1 containers, text backing has 0 characters
    Currently holding 0 glyphs.
    Glyph tree contents:  0 characters, 0 glyphs, 1 nodes, 64 node bytes, 0 storage bytes, 64 total bytes, 0.00 bytes per character, 0.00 bytes per glyph
    Layout tree contents:  0 characters, 0 glyphs, 0 laid glyphs, 0 laid line fragments, 1 nodes, 64 node bytes, 0 storage bytes, 64 total bytes, 0.00 bytes per character, 0.00 bytes per glyph, 0.00 laid glyphs per laid line fragment, 0.00 bytes per laid line fragment
, glyph range {0 0}. Ignoring...
2015-07-24 19:49:25.655 Go RSS[93924:1895263] *** Assertion failure in void _UIPerformResizeOfTextViewForTextContainer(NSLayoutManager *, UIView<NSTextContainerView> *, NSTextContainer *, NSUInteger)(), /SourceCache/UIFoundation_Sim/UIFoundation-376.14/UIFoundation/TextSystem/NSLayoutManager_Private.m:1547
2015-07-24 19:49:25.655 Go RSS[93924:1895263] <NSATSTypesetter: 0x7fe20b12ca80>: Exception Only run on the main thread! raised during typesetting layout manager <NSLayoutManager: 0x7fe20b1f2b50>
    1 containers, text backing has 0 characters
    Currently holding 0 glyphs.
    Glyph tree contents:  0 characters, 0 glyphs, 1 nodes, 64 node bytes, 0 storage bytes, 64 total bytes, 0.00 bytes per character, 0.00 bytes per glyph
    Layout tree contents:  0 characters, 0 glyphs, 0 laid glyphs, 0 laid line fragments, 1 nodes, 64 node bytes, 0 storage bytes, 64 total bytes, 0.00 bytes per character, 0.00 bytes per glyph, 0.00 laid glyphs per laid line fragment, 0.00 bytes per laid line fragment
, glyph range {0 0}. Ignoring...
2015-07-24 19:49:25.656 Go RSS[93924:1895263] *** Assertion failure in void _UIPerformResizeOfTextViewForTextContainer(NSLayoutManager *, UIView<NSTextContainerView> *, NSTextContainer *, NSUInteger)(), /SourceCache/UIFoundation_Sim/UIFoundation-376.14/UIFoundation/TextSystem/NSLayoutManager_Private.m:1547
2015-07-24 19:49:25.656 Go RSS[93924:1895263] <NSATSTypesetter: 0x7fe20b12ca80>: Exception Only run on the main thread! raised during typesetting layout manager <NSLayoutManager: 0x7fe20b1f2b50>
    1 containers, text backing has 0 characters
    Currently holding 0 glyphs.
    Glyph tree contents:  0 characters, 0 glyphs, 1 nodes, 64 node bytes, 0 storage bytes, 64 total bytes, 0.00 bytes per character, 0.00 bytes per glyph
    Layout tree contents:  0 characters, 0 glyphs, 0 laid glyphs, 0 laid line fragments, 1 nodes, 64 node bytes, 0 storage bytes, 64 total bytes, 0.00 bytes per character, 0.00 bytes per glyph, 0.00 laid glyphs per laid line fragment, 0.00 bytes per laid line fragment
, glyph range {0 0}. Ignoring...

Property initialed as
var alert: SCLAlertView?
Code block 1

alert = nil
alert = SCLAlertView()
let txt = alert!.addTextField(title: "Enter your feed URL")
alert!.addButton("Add New Feed") {
    self.sourceString = txt.text
}
alert!.showEdit("New Feed", subTitle: "Add a new feed ")

Code block 2

alert = nil
alert = SCLAlertView()

Doesn´t work with Xcode 6.3.1

I updated to Xcode 6.3.1 and i get 7 errors...
I supposed that is for the new version of Swift
Could you or someone take a look?
captura de pantalla 2015-04-28 a las 3 56 44 p m

boundingRectWithSize issue since converting to Swift 2.0

I've converted my app to Swift 2.0, which hasn't gone very successfully so far! I'm getting one issue with SCLAlertView with boundingRectWithSize in the following code:

// Subtitle
if !subTitle.isEmpty {
    viewText.text = subtitle
    // Adjust text view size, if necessary
    let str = subTitle as NSString
    let attr = [NSFontAttributeName:viewText.font]
    let sz = CGSize(width: kWindowWidth - 24, height:90)
    let r = str.boundingRectWithSize(sz, options: NSStringDrawingOptions.UsesLineFragmentOrigin, attributes:attr, context:nil)
    let ht = ceil(r.size.height)
    if ht < kTextHeight {
        kWindowHeight -= (kTextHeight - ht)
        kTextHeight = ht
    }
}

The error reads:

Cannot invoke 'boundingRectWithSize' with an argument list of type '(CGSize, options: NSStringDrawingOptions, attributes: [String : UIFont?], context: nil)'

Is this just me, or have others found this?

Carthage Integration

All is in the title: Cocoapods is good but many developers are migrating from pods to carthage:

https://github.com/Carthage/Carthage

If i try to 'carthage' it into my Cartfile with "github "vikmeup/SCLAlertView-Swift" " and it show me:

   Project "SCLAlertViewExample.xcodeproj" has no shared schemes
   If you believe this to be an error, please file an issue with the maintainers at https://github.com/vikmeup/SCLAlertView-Swift/issues/new

ios 7.1 fatal error

I use xcode 6.4 and when i run this code in ios 7.1 simulator this error becomes

for line 357
let rv = UIApplication.sharedApplication().keyWindow! as UIWindow

fatal error: unexpectedly found nil while unwrapping an Optional value

is any solution for ios 7.1

regards
Orkun

Change default button text

How can I change default button text? I am using default alert and I have a DONE button.

let alertview : SCLAlertViewResponder = SCLAlertView().showError( "Hata!", subTitle: "Lütfen bilgilerinizi kontrol edin." )

I want to change this button text without add any more button.

Examples in read me throw compile errors

Your examples of usage also throw compile errors

Here is an example of one:
SCLAlertView().showNotice(self, title: "Hello Notice", subTitle: "This is a more descriptive notice text.") // Notice

This error is: Missing argument for parameter coder in call.

UITextField Delegate

Great work on this component.

Is there anyway to expose the TextField delegate for input verification?

Can't see the text of two lines

Hello guys,
I have a text like this "No categories. Please create one" that I like to see entirely but... nothing :(.
You can see the problem in these images:

1

2

My code:

SCLAlertView().showError(self, title: NSLocalizedString("AlertWarningTitle", tableName: nil, bundle: NSBundle.mainBundle(), value: "", comment: ""), subTitle: NSLocalizedString("NoNotebookCategoriesErrorDescription", tableName: nil, bundle: NSBundle.mainBundle(), value: "", comment: ""))

Only able to make it work on initial view controller

Hi

Firstly, thank you for this alert view. I really like it!

I am having an issue however with it that.

  1. When the alert view is presented in the initial view controller - ALERTS WORK!
  2. When the user goes through the view controllers - ALERTS NO LONGER WORK :(

Could you advise a novice developer as to why and what I should be looking out for?

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.