vikmeup / sclalertview-swift Goto Github PK
View Code? Open in Web Editor NEWBeautiful animated Alert View. Written in Swift
License: MIT License
Beautiful animated Alert View. Written in Swift
License: MIT License
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?
How can I customize colors?
I'm getting this error when adding this project via cocoapods. Anyone else seeing this?
Some info here:
http://stackoverflow.com/questions/24020986/error-when-compiling-a-static-library-using-swift-unknown-option-character-x
Couple of issues with beta 6 that was released today. Appreciate your work. :)
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.
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.
having a custom style with a custom icon/color would be great
Hi there...
Thanks so much for the brilliant component.
I added the project via pods in Beta4, get a compilation error
["X" not found ... ]
can scl add image in alert view?
or will you have plan to add new feature?
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?
Is there a way to allow the buttons to be side by side?
Great work on this component.
Is there anyway to expose the TextField delegate for input verification?
I tried to integrate your project via your pod installation instructions. Completely broke my project. Uninstalled your pod and everything went back to normal.
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.
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?
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
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?
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!
Your example project doesn't even launch.
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.
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")
When the modal is presented, it doesn't update it's Y position to account for the number of buttons that were added so that it stays centered in the screen.
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
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
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.
It would be great the add an ImageView to the SCLAlertView.
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
})
})
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.
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'
The problem has been reproduced using:
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.
Hi,
I just found a strange behaviour if I use it with more than 1 button.
When I change orientation after the Alert is shown only the first button remains clickable.
~Hons
Basically the first time it works but the second time it doesnt
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.
Hi
Firstly, thank you for this alert view. I really like it!
I am having an issue however with it that.
Could you advise a novice developer as to why and what I should be looking out for?
Is there supposed to be any visual feedback when a button on the alertView is pressed?
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()
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'> 0.9.2'
pod 'JSONJoy-Swift', '
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
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:
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: ""))
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.
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
Not working when called inside a UITableViewController
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.
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?
How do I get the "closeButtonTitle" to not show up at all?
I am using the showWait and I dont want the closeButtonTitle at all.
Just try to run the code it's a no go.
Give this a shot as an example: ->
SCLAlertView().showInfo(self, title: "Hello Info", subTitle: "This is a more descriptive info text.") // Info
Taken directly from your git read me
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.