terryworona / twmessagebarmanager Goto Github PK
View Code? Open in Web Editor NEWAn iOS manager for presenting system-wide notifications via a dropdown message bar.
License: MIT License
An iOS manager for presenting system-wide notifications via a dropdown message bar.
License: MIT License
It could be a good idea, to reveal to option, to let the user decide, if he wether want's to hide or show it. It works perfectly, out of the box, by just adding - (BOOL)prefersStatusBarHidden
.
Status bar style and visibility not restored after call hideAll
and hideAllAnimated:
while message view on screen.
Unfortunately, the persistent StatusBar bug is still not completely solved.
I show a TWMassageBar
after dismissing a ABPeoplePickerNavigationController
, and the StatusBar is still visible after the TWMessageBar
has been hidden.
Firstly this lib works fine for me both in iPhone5(iOS 7.1beta), iPhone5(iOS 6.1.2) and iPad mini 1(iOS 7.0.4), the message view can be displayed under status bar correctly. But in my iPad 3(iOS 6.1), the message view can not be displayed fully, a part of it(begin from top) is missing...
Currently defaulted to white - expose via optional style sheet protocol.
Remove deprecated sizeWithFont: calls for iOS 7
Does this library support Swift? Are there any plans to?
Would it be possible to support iOS 6.0?
I hide the statusbar through prefersStatusBarHidden
, but after showing the MessageBar, the StatusBar is still visible.
Calling setNeedsStatusBarAppearanceUpdate
doesn't change anything.
I've investigated a bit, and the TWMessageWindow
doesn't get hidden after it has been showed for the first time. It adds two completely unnecessary and translucent views to the application.
Hey,
Thanks for your work, it's so great!! However, I'm still striving by using my custom protocol.
How Am I supposed to use when I call showMessageWithTitle?
Thanks for your help
If app has no status bar, -statusBarFrame
will return CGRectZero
, making -width
returns 0, which makes message bar not appear at all.
- (CGFloat)width
{
return [self statusBarFrame].size.width;
}
- (CGRect)statusBarFrame
{
return [self orientFrame:[UIApplication sharedApplication].statusBarFrame];
}
Suggested fix...
- (CGRect)statusBarFrame
{
if ([UIApplication sharedApplication].isStatusBarHidden) {
return CGRectMake(0, 0, [UIApplication sharedApplication].keyWindow.frame.size.width, 0);
}
else {
return [self orientFrame:[UIApplication sharedApplication].statusBarFrame];
}
}
Sometimes messages should be cancel and clear all after switch between UIViewControllers, so if possible can you support a method maybe called "cancelAllMessages" to clean the whole messageQueue including the message which is visible?
I've tested the notifications (copied Classes folder) in one demo project and it worked flawlessly. After that I decided to try it out in the main project I'm working on, and it simply doesn't show messages. I did some debugging, and realized that showNextMessage is being called, and the message queue works just fine, but the messages are not visible. I've also tested the messages from every possible view in the app. Any ideas what might be stopping the messages from showing?
I'm not sure if I should be asking this here, but I couldn't find anything that might be blocking it, so I thought you might want to know.
when title == no ,the description not align icon
Great work!
Is it possible to incorporate uiblur for the background of the alert view?
When the device is using like Hotspot for providing internet access there is a Blue view indicating the number of connections , the messages that display your demo are behaving in a strange way , this problem also complicates meanwhile testing the device rotation:
The behaviour of Error and Success if you try with the device in landscape show the image 1 & 2 result
The test was performed in a iphone 5S with IOS version 7.1
whithout consider this error is a very good componen.
thanks
It would be more awesome if the message background covers the status bar on iOS 7
This way on dont depend on app design for the warning box to make sense.
TWMessageBarManager.m uses [UIApplication sharedApplication].keyWindow.frame
to calculate the size of the message bar frame. The use of [UIApplication sharedApplication]
means that this library can't be used in an extension. Would it be possible to optionally configure the frame externally?
Thanks a lot, love the library!
If TWMessageBarManager is called from an onscreen VC that has status bar with light content, and requests a dark background for the message, the status bar is left with dark text on dark background after message displayed.
I have look for a couple of days into this and fond the best way to handle this, is if the bar style is to be retained, it must be passed to TWMessageBarManager.
I will create a PR with my proposed fix.
If either title or description text is empty then message displayed is not vertically centered.
I have tested with a big message and the icon stays on top.
Would be better if the image stays in the middle of it...
Would be nice to animated hide all calls.
How can i use this library in a swift project ?
I've tried the object with a callback and i get an exception on line 245 at TWMessageBarManager.m
Thanks
Instead of using a PNG, use font awesome for more flexibility
I read the other issue dealing with handling pushes, and respect the ideal of keeping this clean, but most new apps will have notifications, and as such, one tweak to manage this:
Allow one dictionary param to be set into the TW notice. Have it get sent to the completion so allow us easy access to the required data that the push represents.
I don't see this as diluting the focus at all.. just thinking aloud, determining if this is the way to go, as this is critical for my needs. Cheers.
'drawInRect:withFont:lineBreakMode:alignment:' is deprecated: first deprecated in iOS 7.0 - Use -drawInRect:withAttributes:
'sizeWithFont:constrainedToSize:lineBreakMode:' is deprecated: first deprecated in iOS 7.0 - Use -boundingRectWithSize:options:attributes:context:
can I display message above status bar on IOS 6, any suggestions? Thanks!
Please update your cocoapods.org implementation. It is downloading the old version of this class.
thanks.
How could this be fixed?
Messages work fine with portrait orientation, but they are either cut off (iPhone) or all over the screen (iPad). iOS 7 works like a charm, both orientations.
Thank you.
Great control
Would be nice if there was an option to show from the bottom
Xcode 6 can handle PDF files to generate images so replace all images by their respective PDF file could save time.
Furthermore by adding vector source files format user can tweaks the image.
This would either entail external access to the messageBarQueue
, or a facade, that lets you add tags of some sort to a TWMessageView
, and be able to cancel a specific view.
There are times where I don't just want to show subsequent messages, but may want to cancel one.
@terryworona Do you have any thoughts, or ideas?
It would be nice to customize the fonts of the title and message "labels" (I saw you render the text in drawRect).
I discovered the static constants in the implementation file (kTWMessageViewTitleFont and kTWMessageViewDescriptionFont - didn't dive into details).
Wouldn't that be a nice and a low hanging fruit enhancement?
Greetings.
Hi, similar to the given demo i have a view controller which only support portrait mode.
Before creating any message with TWMessageBarManager, the status bar does not rotate when the phone is in landscape mode.
After creating a message with TWMessageBarManager, the status bar rotates when the phone rotates.
Any idea how to fix this? The status bar shouldn't rotate when it is in landscape mode after displaying the message.
Message is shown of full screen iPad portrait size on iPad landscape app with iOS 8. Tried with iPad 2 (iOS 8) simulator. Success message type. I didn't find any info about it being not supported for iPad, therefore wondering has anybody tried it to use on iPad?
I receive this warning in XCode:
TWMessageBarManager.m:728:112: Implicit conversion from enumeration type 'UIInterfaceOrientation' (aka 'enum UIInterfaceOrientation') to different enumeration type 'UIDeviceOrientation' (aka 'enum UIDeviceOrientation')
The class works fine, just get this warning when I build. 8.1SDK.
Currently programmatically or with delay we can hide the notification. If we can add / expose a method to hide the notification by pushing upwards (like we do in iOS push notification)
This bring resolution independence and give the user abilities to tweak images.
Would be oh so sweet if the user could flick to dismiss, just like the build-in notifications... i noticed you could tap, but users are used to flicking :)
MessageBarManager seems ideal for dealing with push notifications when the user is actually running the app. Could MessageBarManager be made to deal with the push notification userInfo when the app is running? Something like:
-(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
{
if ( application.applicationState == UIApplicationStateActive)
{
[[MessageBarManager sharedInstance] showMessageWithUserInfo:userInfo
type:MessageBarMessageTypeInfo
];
} else ...
... there is quite a lost of complexity that is handled with normal notifications ("loc-args", "loc-key" etc), so I'm guessing it might be difficult.
Alright I can't figure out this one for the life of me. In the majority of the application the message bar works totally fine, but in one scenario it starts to display it and then immediately disappears.
http://www.screencast.com/t/zv3zbyox
[[TWMessageBarManager sharedInstance] showMessageWithTitle:@"Success!" description:@"You re-asked the question!" type:TWMessageBarMessageTypeSuccess callback:nil];
It's definitely called on the main thread, doesn't appear to be called twice, and hideAll
is never called.
Any ideas where to look?
Any chance on fixing Deprecation warnings (4) - drawInRect and sizeWithFont - warnings? I keep doing it manually which is probably not the best way to go about it with updates and new projects. Thank you
The TWMessageViewController will retain control over the status bar's style when message is removed. Client program will have wrong status bar style on subsequent views.
Submitting a PR to fix.
Add implementation of UIAccessibilityProtocol to the class
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.