lmcd / lmalertview Goto Github PK
View Code? Open in Web Editor NEWOpen Source, customisable clone of UIAlertView for iOS 7
License: MIT License
Open Source, customisable clone of UIAlertView for iOS 7
License: MIT License
Work has started on this in the embedded-vc branch.
CGRect frame;
frame.size = size;
// frame.origin is unitialized. Yeah, its just a spurious warning but thought I'd post it anyway!
_representationView = [[UIView alloc] initWithFrame:frame];
This fixes it (syntax is yours, I just saw it for the first time today! Nice! :-)
frame = (CGRect){.size = size};
Hi!
Just installed this via cocoapods (pointed to this github for latest release). I get an error in LMAlertView.m on row 473 saying that: -[RBBSpringAnimation setCompletion:]: unrecognized selector sent to instance XXXX.
By removing that block, the alertview does show up and seems to work. But obviously the didPresentAlertView in the delegate is not called upon the animation completion. It might just be some reference problem locally, but as it seems to find the CAAnimationBlocks library and not the setter, something is obviously not ok :)
The headers are there since i don't get any compilation errors.
Regards
Alex
This is the first Pod I have worked with that has this issue. Should the include use quotes as suggested by Xcode, or is there something I should be doing in Xcode to add the podfile's include files to the include file search path automatically when I add cocoa pods?
The standard UIAlertView is scrollable when the text is longer than the screen. Would be nice to have that feature when displaying long text blocks.
You can remove this:
After I installed the pod, build failed with:
ld: warning: directory not found for option '-L/Users/robinqu/Desktop/catworks/CatWorks/Pods/build/Debug-iphoneos'
ld: framework not found GPUImage
clang: error: linker command failed with exit code 1 (use -v to see invocation)
GPUImage files do exist in the Pod folders.
Any clue to fix this?
I imported and tried to build just the folder LMAlertView. But it wouldn't build as you require the use of the LMModalItemTableViewCell class, located in the Demo folder. It would be a help to others if you moved that class into the core LMAlertView folder.
When the following code runs ...
var lmAlertView: LMAlertView = LMAlertView(title: "Titre", message: "Message", delegate: self, cancelButtonTitle: "Annuler")
... it crashes the App with the following error message ...
[LMAlertView initWithTitle:message:delegate:cancelButtonTitle:]: unrecognized selector sent to instance 0x7f85e0472b10
Even worse, when I try to add additional buttons but using the otherButtonTitles arguments like this ...
var lmAlertView: LMAlertView = LMAlertView(title: "Titre", message: "Message", delegate: self, cancelButtonTitle: "Cancel", otherButtonTitles: "OK")
... then the App will not even compile. I get the following error message:
Extra argument 'message' in call
In that case, I think that it's because it didn't find the signature of function that contains otherButtonTitles, it is trying to default to the one where you pass a view controller to LMAlertView() ... with 1 single argument.
Has anyone had this kind of problem? Can someone direct me to an example that shows how to use LMAlertView with Swift please?
Thanks everyone.
El Mouhandiss
I fixed this on my side .. If anyone experieced it this is what i added in LMAlertView.m
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil];
When setting a content view with width bigger than the default, the alert's title & message labels are not centered. Is there a workaround for this?
Hello , you could put this framework in Carthage ?
Thanks.
UIAlertView implementation is using UITableViewCells for the buttons. Look into doing this.
Hi,
I'm calling segue on click of the other button, and this throws "message sent to deallocated instance" error on line #532 in LMAlertView.m file. The line is shown below.
if ([self.delegate respondsToSelector:@selector(alertView:didDismissWithButtonIndex:)]) {
[self.delegate alertView:(UIAlertView *)self didDismissWithButtonIndex:buttonIndex];
}
This is my code on alertview delegate.
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
if(buttonIndex==1){
[alertView dismissWithClickedButtonIndex:-1 animated:true];
alertView=nil;
[self performSegueWithIdentifier:@"xxxx" sender:self];
}
}
Any suggestions please advice ?
Hi there,
one question to one line of the code:
In line 241 of LMAlertView.m you write
_alertContainerView = [[UIView alloc] initWithFrame:(CGRect){.size = [[UIScreen mainScreen] bounds].size}];
I have to say that I never saw this syntax before. I even googled it and haven't found anything similar. I'm talking about "(CGRect){.size =" Can you explain how and why this works?
Greets from Germany
Andi
When using the demo app, all works fine, except for rotation of the "VC" example. Once the map is visible and the device is rotated, the app crashes. Xcode gives EXC_BAD_ACCESS on line 42 of CALayer+ModalAlert.m
I'm getting a lot of crashes in [LMAlertView show] with the following message:
A view can only be associated with at most one view controller at a time! View < UIView: 0x14e94050; frame = (0 0; 320 480); autoresize = W+H; layer = < CALayer: 0x14ef3880 > > is associated with < LMEmbeddedViewController: 0x14ee1950 >. Clear this association before associating this view with < LMEmbeddedViewController: 0x14dc7890 >.
-[LMAlertView show]
in LMAlertView.m on Line 442
is there a fix for this?
thanks.
Like in standard AlertView the following has no effect in LMAlertView
[alertView setTransform:CGAffineTransformTranslate(alertView.transform, 0.0, 10.0)];
Maybe there is an alternative method?
First off, thanks for the awesome library. The rating control alone helped me a ton ๐
I have a small problem. I have another instance of the LMAlertView with 2 custom buttons which looks like this,
Clicking on either of those buttons bring up a SLComposeViewController. Now my problem is when I click on those buttons, the compose view controller appears under the alert view. Like so,
If there's a method (like show) to dismiss the alert view, that would be great.
Thank you.
It seems that presenting the LMAlertView
from a view with a view controller that sets preferredStatusBarStyle
to UIStatusBarStyleLightContent
will result in a status bar style reset back to UIStatusBarStyleDefault
when the alert view is visible.
My workaround is now to implement preferredStatusBarStyle
with a fixed return value to LMEmbeddedViewController.m:
- (UIStatusBarStyle)preferredStatusBarStyle
{
return UIStatusBarStyleLightContent;
}
I got crash after selection any button of alert if there is keyboard active before [alert show];
This code leads to crash:
- (void)_addAnimation:(CAAnimation *)anim forKey:(NSString *)key {
UIWindow *keyWindow = [UIApplication sharedApplication].keyWindow;
if ([keyWindow.rootViewController isKindOfClass:[LMEmbeddedViewController class]]) {
UIView *view = [self delegate];
CABasicAnimation *basicAnim = (CABasicAnimation *)anim;
CGFloat modalWidth = 290.0;
// Hide _UIParallaxDimmingView. It's making the transparent nav controller go dark when animating
if ([[[view class] description] hasSuffix:@"DimmingView"]) {
view.hidden = YES;
}
// When pushing a view controller, make the one underneath slide out all the way
///CRASH HERE!!!!
if ([key isEqualToString:@"position"] && basicAnim.fromValue != nil) {
if ([basicAnim.fromValue CGPointValue].x == (modalWidth / 5.0)) {
basicAnim.fromValue = [NSValue valueWithCGPoint:CGPointMake(-(modalWidth / 2.0), [basicAnim.fromValue CGPointValue].y)];
}
}
if (view.frame.origin.x == (-0.3 * modalWidth)) {
CGRect frame = view.frame;
frame.origin.x = -modalWidth;
view.frame = frame;
}
}
// Note: this calls original Apple implementation of addAnimation:forKey:
[self _addAnimation:anim forKey:key];
}
Hello, I'm new to using your class here, and for some reason when my "done" button is pressed, the clickButtonWithIndex method is not being fired. How do I fire off an event when the firstOtherButton is pressed?
If your project is going to depend on another open source project, please add a URL to the README. I don't use CocoaPods, and so I find one using google, but not sure if its the right one (got lots of hits).
Also, why:
and not
The former implies this is a System header file, not a User one.
Storyboard unwind doesnt seems to work
CASpringAnimation
is performing very badly on the iPhone 5S/64-bit iOS simulator
*** WebKit discarding exception: -[WebActionDisablingCALayerDelegate superview]: unrecognized selector sent to instance
I think the problem is caused by
"CALayer+ModalAlert.m"
How can I call a delegate method like in UIAlertView?
For example:
LMAlertView *alert = [[LMAlertView alloc] initWithTitle:@"Are you sure you want to send?"
message:theMessage
delegate:self
cancelButtonTitle:@"Cancel"
otherButtonTitles:@"Send", nil];
in UIAlertView, this method is called:
What's the equivalent in LMAlertView?
Thank you,
Adam
I'm having a hard time getting the RGBA values for some label colours out of LLDB at the moment - still trying to figure it out
I have just used this library and realized that the alertview is not showing up correct when launched in landscape orientation. The issue is fixed be commenting out the [self transformAlertContainerViewForOrientation]; in the show function in LMAlertView.m. Is it possible to have a flag on the initialisation, or any other solution to avoid commenting out this line?
UIKeyboardWillShowNotification observer is only registered in initWithViewController.
Why don't we add this registration logic in other init methods?
I have an issue with keyboard appearance with initWithTitle... method - the keyboard overlaps the alert window.
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.