GithubHelp home page GithubHelp logo

terryworona / twmessagebarmanager Goto Github PK

View Code? Open in Web Editor NEW
1.8K 1.8K 191.0 1.01 MB

An iOS manager for presenting system-wide notifications via a dropdown message bar.

License: MIT License

Objective-C 98.66% Ruby 1.34%

twmessagebarmanager's People

Contributors

amyworrall avatar danielkrofchick avatar dasmer avatar grantjk avatar jonathanng avatar leandros avatar lukaswelte avatar mdelaporta avatar pearapps avatar sascha-wolf avatar setoff avatar skyylex avatar terryworona 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

twmessagebarmanager's Issues

Reveal option for prefersStatusBarHidden

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.

StatusBar persists after showing

Unfortunately, the persistent StatusBar bug is still not completely solved.
I show a TWMassageBarafter dismissing a ABPeoplePickerNavigationController, and the StatusBar is still visible after the TWMessageBar has been hidden.

Message view display location wrong in iPad 6.1

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

Swift support?

Does this library support Swift? Are there any plans to?

StatusBar doesn't get hidden again after showing

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.

Customization

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

MessageBar doesn't appear if app has no status bar.

From https://github.com/terryworona/TWMessageBarManager/blob/master/Classes/TWMessageBarManager.m#L587-L590

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];
    }
}

API to cancel all messages

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?

Not showing messages in one project

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.

Display problem using device like hotspot

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
photo 2
photo 1

The test was performed in a iphone 5S with IOS version 7.1
whithout consider this error is a very good componen.
thanks

Use of [UIApplication sharedApplication]

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!

Status Bar is left with wrong style in called from a VC with UIStatusBarStyleLightContent

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.

Callback exception

I've tried the object with a callback and i get an exception on line 245 at TWMessageBarManager.m

Thanks

Multi-Line problem with iOS SDK 7.1

I updated the SDK to 7.1 and now the MultiLine doesn't work anymore. I have looked in to the code but can't find anything. The screenshot will show you more, i hope you could help me asap because i have to update like 50 apps this weekend

screen shot 2014-03-14 at 10 26 38 am

Icon

Instead of using a PNG, use font awesome for more flexibility

managing push notification payload

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.

deprecated methods

'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:

iOS 8 landscape orientation issue

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.

Display from bottom

Great control

Would be nice if there was an option to show from the bottom

Add vector files for images

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.

A way to hide a specific view

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?

Provide font customization options

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.

Status bar orientation

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.

ios simulator screen shot apr 3 2014 6 19 28 pm

After creating a message with TWMessageBarManager, the status bar rotates when the phone rotates.

ios simulator screen shot apr 3 2014 6 19 37 pm

Any idea how to fix this? The status bar shouldn't rotate when it is in landscape mode after displaying the message.

Implicit conversion from enumeration type 'UIInterfaceOrientation' (aka 'enum UIInterfaceOrientation') to different enumeration type 'UIDeviceOrientation' (aka 'enum UIDeviceOrientation')

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.

Dismiss via swipe

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)

feature request: dismissable

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

Dealing with push notifications

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.

Rendering glitch / disappearing message bar

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?

Deprecation Warnings

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

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.