Giter Site home page Giter Site logo

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?

Beta 6

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

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.

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.

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 ... ]

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?

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

UITextField Delegate

Great work on this component.

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

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

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.

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

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?

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!

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.

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")

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

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

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 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
                })
        })

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.

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.

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.

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?

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()

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

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: ""))

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.

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

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.

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?

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.