Giter VIP home page Giter VIP logo

mtstatusbaroverlay's Introduction

Read Me

No Maintenance Intended This project is out of date, I'd advise you to use a more modern alternative out there.

UIStatusBarStyleDefault (left: full size, right: shrinked)

Description

This class provides a custom iOS (iPhone + iPad) status bar overlay window known from Apps like Reeder, Google Mobile App or Evernote. It currently supports touch-handling, queuing of messages, delegation as well as three different animation modes:

  • MTStatusBarOverlayAnimationShrink: When the user touches the overlay the overlay shrinks and only covers the battery-icon on the right side
  • MTStatusBarOverlayAnimationFallDown: When the user touches the overlay a detail view falls down where additional information can be displayed. You can get a history of all your displayed messages for free by enabling historyTracking!
  • MTStatusBarOverlayAnimationNone: Nothing happens, when the user touches the overlay

MTStatusBarOverlay currently fully supports two different status bar styles, which also can be changed in your app (MTStatusBarOverlay will adopt the style and will be updated the next time you show it):

  • UIStatusBarStyleDefault
  • UIStatusBarStyleBlackOpaque

Usage

You can use the custom status bar like this:

 MTStatusBarOverlay *overlay = [MTStatusBarOverlay sharedInstance];
 overlay.animation = MTStatusBarOverlayAnimationFallDown;  // MTStatusBarOverlayAnimationShrink
 overlay.detailViewMode = MTDetailViewModeHistory;         // enable automatic history-tracking and show in detail-view
 overlay.delegate = self;
 overlay.progress = 0.0;
 [overlay postMessage:@"Following @myell0w on Twitter…"];
 overlay.progress = 0.1;
 // ...
 [overlay postMessage:@"Following myell0w on Github…" animated:NO];
 overlay.progress = 0.5;
 // ...
 [overlay postImmediateFinishMessage:@"Following was a good idea!" duration:2.0 animated:YES];
 overlay.progress = 1.0;

Adding MTStatusBarOverlay to your project

MTStatusBarOverlay is compiled as a static library. You have two options for integrating it into you own project, after cloning the MTStatusBarOverlay git repository with the terminal-command: git clone git://github.com/myell0w/MTStatusBarOverlay.git Since MTStatusBarOverlay now uses ARC, you have to add "-fobjc-arc" to "Other Linker Flags" of your project, If you are using Xcode 4.2 or up with the iOS 5.0 SDK on a non-ARC target.

First option: copy files

  1. Just copy over the files MTStatusBarOverlay.h and MTStatusBarOverlay.m to your project.
  2. import "MTStatusBarOverlay.h" everywhere where you want to use it
  3. If you use MTStatusBarOverlay in a non-ARC project, add "-fobjc-arc" to the Compiler Flags of MTStatusBarOverlay.m in your target's "Build Phases" tab under Compile Sources.
  4. If your project doesn't use ARC be sure to check out the introduction section of "Adding MTStatusBarOverlay to your project"
  5. There is no step 5 :)

Second option: Xcode dependent project

  1. Locate the "MTStatusBarOverlay.xcodeproj" file and drag it onto the root of your Xcode project's "Groups and Files" sidebar. A dialog will appear -- make sure "Copy items" is unchecked and "Reference Type" is "Relative to Project" before clicking "Add".
  2. Add MTStatusBarOverlay as a direct dependency (Xcode 3) or target dependency (Xcode 4) of your target
  3. Drag libMTStatusBarOverlay.a onto the section 'Link Binary with Libraries' of your target
  4. Finally, you need to tell your project where to find the MTStatusBarOverlay-header. Open your "Project Settings" and go to the "Build" tab. Look for "Header Search Paths" and double-click it. Add the relative path from your project's directory to the MTStatusBarOverlay-directory.
  5. If your project doesn't use ARC be sure to check out the introduction section of "Adding MTStatusBarOverlay to your project"
  6. You are good to go, just #import "MTStatusBarOverlay.h" everywhere where you want to use it.

Known Limitations

  • When using UIStatusBarStyleBlackTranslutient the overlay is black opaque
  • User interaction in detail view is not possible yet

mtstatusbaroverlay's People

Contributors

alloy avatar benjaminscott avatar coneybeare avatar coresystems-krt avatar dwarfland avatar gekitz avatar inamiy avatar jianfeng avatar lickel avatar marclefrancois avatar mxcl avatar myell0w avatar scheinem avatar steipete avatar suhailrashidbhat avatar vguerci 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  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

mtstatusbaroverlay's Issues

-fobjc-arc

target ios5,add -fobjc-arc,run is ok,
but target ios 4,runtime report error:
"dyld: lazy symbol binding failed: Symbol not found: _objc_retain"

Stealing the firstResponder?

Just updated to HEAD, now when the statusbar is animating some key events are "eaten" (thus, i'm typing, statusbar changes... keys are missing that really should be there)

Crashing on callDelegateWithNewMessage

I have been trying to implement MTStatusBarOverlay into my project. I have the status bar messages in several view controllers, and when I start clicking rapidly between view controllers, I end up getting an error in this method:

  • (void)callDelegateWithNewMessage:(NSString *)newMessage {

    if ([self.delegate respondsToSelector:@selector(statusBarOverlayDidSwitchFromOldMessage:toNewMessage:)]) {
    NSString *oldMessage = nil;

    if (self.messageHistory.count > 0) {
        oldMessage = [self.messageHistory lastObject];
    }
    
    [self.delegate statusBarOverlayDidSwitchFromOldMessage:oldMessage
                                              toNewMessage:newMessage];
    

    }
    }

at the first if statement. Any thoughts? Do you need more info?

Status bar is the wrong size on iPad when running in iPhone emulation mode

The status bur shows up as too long when running an iPhone app in emulation mode on an iPad.

I fixed it by making the following changes:

  • Moved kScreenWidth define above the IsIPad macro

  • Changed IsIPad macro to:

        
    #define IsIPad (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) && (kScreenWidth > 480)
    
    • In initWithFrame after setting the initial statusBarFrame, need to correct the frame width because on iPad in emulation mode it gives a statusBarFrame that is too wide (at least in iOS 4.2.1)

      if( statusBarFrame.size.width > kScreenWidth )
      statusBarFrame.size.width = kScreenWidth;

By the way, thank you very much for this library - it's great!

MTDetailViewModeHistory not work for me

Hi myell0w,

I use the below code to test, and want to see the history of the post message, but failed, when I click the status bar, nothing happen. if I change the detailViewMode to MTDetailViewModeDetailText, will animation a black view download from the status bar.

MTStatusBarOverlay *overlay = [MTStatusBarOverlay sharedInstance];
overlay.animation = MTStatusBarOverlayAnimationFallDown; // MTStatusBarOverlayAnimationShrink
overlay.detailViewMode = MTDetailViewModeHistory; // enable automatic history-tracking and show in detail-view
overlay.delegate = self;
overlay.historyEnabled = YES;
[overlay postMessage:@"Following @myell0w on Twitter…"];
[overlay postMessage:@"Following @myell0w on Twitter1…"];
[overlay postMessage:@"Following @myell0w on Twitter2…"];

I have no idear, So get help here.

Best Regards

Thanks Very much.

Disable Gesture

Hello,
I love your Status Bar Project.
The Only Thing I am missing is how to disable gestures on the Status bar!

Maybe you could help me with that, would be great!

The IsIPad macro doesn't work on the iPhone 4

Hi,

I've noticed that the IsIPad macro has changed and now it's like this:

#define IsIPad (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) && (kScreenWidth > 320)

The problem is that on the iPhone 4 it doesn't work anymore. It is true even though it should obviously be false. The problem seems to be with kScreenWidth > 320; removing that part of the condition makes it work again. However, I don't know how this affects running the app on the iPad in iPhone mode.

Crashes when keyWindow does not have any subview after rotating the device.

Download the sample project file from:
http://www.DropBox.pl/file.php?name=CFD5DCF8A13CBBC0BFB344D7EE03C592

  1. Run app in iPad simulator 4.2.
  2. When the message on the status bar appears, rotate the simulator.
  3. Application crashes with stackTrace:

2011-01-17 16:30:27.003 StatusBarOverlayTest[13364:207] * Terminating app due to uncaught exception 'NSRangeException', reason: '* -[NSArray objectAtIndex:]: index 0 beyond bounds for empty array'
*** Call stack at first throw:
(
0 CoreFoundation 0x00db7be9 exceptionPreprocess + 185
1 libobjc.A.dylib 0x00f0c5c2 objc_exception_throw + 47
2 CoreFoundation 0x00dad80c -[__NSArrayI objectAtIndex:] + 236
3 StatusBarOverlayTest 0x00008de7 -[MTStatusBarOverlay currentVisibleViewController] + 568
4 StatusBarOverlayTest 0x00006055 -[MTStatusBarOverlay didRotate:] + 95
5 Foundation 0x0002a6c1 _nsnote_callback + 145
6 CoreFoundation 0x00d8ff99 __CFXNotificationPost_old + 745
7 CoreFoundation 0x00d0f33a _CFXNotificationPostNotification + 186
8 Foundation 0x00020266 -[NSNotificationCenter postNotificationName:object:userInfo:] + 134
9 UIKit 0x00471d0a -[UIDevice setOrientation:animated:] + 228
10 UIKit 0x002ce7d4 -[UIApplication handleEvent:withNewEvent:] + 4127
11 UIKit 0x002c6202 -[UIApplication sendEvent:] + 71
12 UIKit 0x002cb732 _UIApplicationHandleEvent + 7576
13 GraphicsServices 0x016eda36 PurpleEventCallback + 1550
14 CoreFoundation 0x00d99064 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION
+ 52
15 CoreFoundation 0x00cf96f7 __CFRunLoopDoSource1 + 215
16 CoreFoundation 0x00cf6983 __CFRunLoopRun + 979
17 CoreFoundation 0x00cf6240 CFRunLoopRunSpecific + 208
18 CoreFoundation 0x00cf6161 CFRunLoopRunInMode + 97
19 GraphicsServices 0x016ec268 GSEventRunModal + 217
20 GraphicsServices 0x016ec32d GSEventRun + 115
21 UIKit 0x002cf42e UIApplicationMain + 1160
22 StatusBarOverlayTest 0x0000211c main + 102
23 StatusBarOverlayTest 0x000020ad start + 53
)
terminate called after throwing an instance of 'NSException'

Line where it crashes:

UIView *rootView = [[topWindow subviews] objectAtIndex:0];

Use UIViewAnimationOptionAllowUserInteraction When overlay is disappearing.

    [UIView animateWithDuration:self.shrinked ? 0. : kAppearAnimationDuration
                          delay:0 
                        options:UIViewAnimationOptionAllowUserInteraction 
                     animations:^{
        [self setHidden:YES useAlpha:YES];
    } completion:^(BOOL finished) {
        // call delegate
        if ([self.delegate respondsToSelector:@selector(statusBarOverlayDidHide)]) {
            [self.delegate statusBarOverlayDidHide];
        }
    }];

Like above.
or it will slag when user interact with someing.

App slight freezes when posting message

It's really great library and what I really wanted for my app http://lisgo.org/.

But, after I tried implementing this, I realized there is a slight freeze when you fire
[statusBarOveryLay_ postImmediateMessage:@"Archiving article" duration:1.0 animated:YES]; .

Since I want to display a message each time users swipe a table view cell,
you can't swipe each cells in a low smoothly if it posts over lay message.

I tried statusBarOveryLay_.canRemoveImmediateMessagesFromQueue = YES; and so on, but no luck yet.

Maybe, there is no way to handle this issue?

Visibility Bug

If the UIStatusBar is hidden when MTStatusBarOverlay is created, it won't show later, even if UIStatusBar is already visible.

MTStatusBarOverlay inhibits UIScrollView's scrollsToTop property

I have an issue where using MTStatusBarOverlay has now broken the above property in UIScrollView. I assume because the MTStatusBarOverlay consumes the touches?? I'm also referring to when there is currently no message being displayed, and the overlay is in its inactive state.

Regarding that property, from the UIScrollView API Reference below:

scrollsToTop
A Boolean value that controls whether the scroll-to-top gesture is effective

@Property(nonatomic) BOOL scrollsToTop
Discussion
The scroll-to-top gesture is a tap on the status bar; when this property is YES, the scroll view jumps to the top of the content when this gesture occurs. The default value of this property is YES.

Messages don't always appear over the status bar

I'm seeing the problem when I push a modal view controller with a movie player in it

If you use the status bar orientation rather than the device orientation (which might be 'screen up'), then things seem to work:

e.g.

  • (void)rotateToStatusBarFrame:(NSValue *)statusBarFrameValue {

// current device orientation
UIDeviceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];

Detail View User Interaction

User Interaction on the detail view currently doesn't work. This is not as easy as setting userInteractionEnabled to YES because the overlay doesn't respond to touches outside it's frame (which the detail view is)

quick fix to stop crashing on pre 4.0 devices

  • (MTStatusBarOverlay *)sharedInstance {

    if (![[UIView class] respondsToSelector:@selector(animateWithDuration:animations:completion:)])
    {
    return NULL;
    }

etc etc etc

}

this just disables the status bar completely on devices which can't support the animations.

Not as good as making everything work - but better than crashing!

iOS 6 Compatibility

Hi,

This is a very great tool. However, seems it is broken in XCode 4.5. Will there be any updates?

FYI. I've got the following runtime error.

-[__NSCFString stretchableImageWithLeftCapWidth:topCapHeight:]: unrecognized selector sent to instance.

Thanks in advance.

[Fixed]
// Images used as background when status bar style is Default
defaultStatusBarImage_ = [[UIImage imageWithData:MTStatusBarBackgroundImageData(NO)] retain];
defaultStatusBarImageShrinked_ = [[UIImage imageWithData:MTStatusBarBackgroundImageData(YES)] retain];

As an additional green status bar like Evernote

I found your repository while search of a class that would facilitate a custom green status bar (ala incoming phone call) that pushes down and shrinks the existing tableviews on screen when activated. This appears to be a nice customizable overlay (as the name would suggest), but I thought I'd ask to see if you knew of a means of accomplishing this custom green bar, like Evernote has done for their synchronization notification. Perhaps as a feature request?

iOS 7 Crash

It's crashing for me in iOS 7 at this point:

self.statusBarBackgroundImageView.image = [self.defaultStatusBarImage stretchableImageWithLeftCapWidth:2.0f topCapHeight:0.0f];

Status is shown after hiding the overlay

Sometimes if a "hide" comes pretty close to previous status message, the status message appears for a short time, then it's hidden (until now, everything as expected). After that, the previously shown status message is shown again and does not disappear again.

code to display:
[[MTStatusBarOverlay sharedInstance] postImmediateMessage:message animated:YES];

code to hide:
[[MTStatusBarOverlay sharedInstance] hide];

IsIPhoneEmulationMode macro broken

Hi,

Your Macro is broken on the new iPhone 5 (4" screen)

// macro for checking if we are on the iPad in iPhone-Emulation mode

define IsIPhoneEmulationMode (!IsIPad && \

MAX([UIApplication sharedApplication].statusBarFrame.size.width, [UIApplication sharedApplication].statusBarFrame.size.height) > 480.f)

Regards

Crashes upon simple sequence of posting messages

Doesn't pass this:
[[MTStatusBarOverlay sharedInstance] postImmediateMessage:@"a" animated:YES];
[[MTStatusBarOverlay sharedInstance] postImmediateFinishMessage:@"finished" duration:5 animated:YES];
[[MTStatusBarOverlay sharedInstance] postImmediateMessage:@"a" animated:YES];
[[MTStatusBarOverlay sharedInstance] postImmediateFinishMessage:@"finished" duration:5 animated:YES];
[[MTStatusBarOverlay sharedInstance] postImmediateMessage:@"a" animated:YES];
[[MTStatusBarOverlay sharedInstance] postImmediateFinishMessage:@"finished" duration:5 animated:YES];
[[MTStatusBarOverlay sharedInstance] postImmediateMessage:@"a" animated:YES];
[[MTStatusBarOverlay sharedInstance] postImmediateFinishMessage:@"finished" duration:5 animated:YES];

UIActivityIndicatorView is too large in iOS 5

Example

Printing the frame of the activity indicator view when it is set is correct:

Printing description of activityIndicator_:
<UIActivityIndicatorView: 0x9ea3630; frame = (6 3; 14 14); hidden = YES; layer = <CALayer: 0x9e9eab0>>

But the spinner seems to be ignoring the frame

iOS 7 status bar new behavior

Placeholder for a fix to be compatible with iOS 7 new status bar behaviors, otherwise it will just hide the status bar after being dismissed....

MakeKeyWindow

This status overlay is a key thief.

In order to gain window access one needs to override

  • (void) makeKeyWindow
    {
    [[(AppDelegate *) [UIApplication sharedApplication].delegate window] makeKeyAndVisible];
    }

And put a window property with this getter in the app delegate.

Add this to your library so its actually usable.

Your welcome for the fix.

Adam.

On occasion, CoreAnimation throws exception

This is popping up occasionally in my console:

2011-03-09 22:25:36.911 Grape[47500:207] CoreAnimation: ignoring exception: *** -[NSMutableArray removeObjectAtIndex:]: index 0 beyond bounds for empty array

As far as I can tell, it's caused by sending a ton of messages rapidly to the StatusBarOverlay. I have an NSURLConnection that I'm reading data from, and I'm attempting to keep the user updated via the SBO how the download progress is doing. My stopgap will probably be to throttle the messages somehow.

I'll try to come up with a repeatable use case by the end of the week.

Repeating done over and over on iPad.

New to this whole game, but here we go. I have 3 storyboards, 3.5, 4" and iPad. Works flawlessly in simulator (as it always has), but recently I added that iPad storyboard, for more a universal app. One tester reported that it repeats "done" over and over.

I tried returning to default, no luck. Keep in mind I took over our app project for our forum. This is how the previous author implemented it into our app.

// MainViewController.h
//
// Created by Chris on 3/20/2013.
// Copyright (c) 2013 Chris. All rights reserved.
//

import "PullToRefreshView.h"

import <QuartzCore/QuartzCore.h>

import "MTStatusBarOverlay.h"

@interface MainViewController : UIViewController <PullToRefreshViewDelegate, UIWebViewDelegate, UIGestureRecognizerDelegate, MTStatusBarOverlayDelegate, UIScrollViewDelegate> {

IBOutlet UIWebView *webView;    
IBOutlet UIScrollView *currentScrollView;
NSTimer *timer;
UIApplication *app;
double myNumber;
MTStatusBarOverlay *overlay;
IBOutlet UIImageView *splash35Inch;
IBOutlet UIImageView *splash4Inch;
IBOutlet UIImageView *splashPad;
IBOutlet UIImageView *splashPadLandscape;

}

@Property (nonatomic, retain) UIImageView *splash35Inch;
@Property (nonatomic, retain) UIImageView *splash4Inch;
@Property (nonatomic, retain) UIImageView *splashPad;
@Property (nonatomic, retain) UIImageView *splashPadLandscape;

  • (IBAction)goBack:(UISwipeGestureRecognizer *)sender;
  • (IBAction)goForward:(UISwipeGestureRecognizer *)sender;

@EnD

///////////////////////////////////////////////

// MainViewController.m
//
// Created by Chris on 3/20/2013.
// Copyright (c) 2013 Chris. All rights reserved.
//

import "MainViewController.h"

//Random app code//

  • (void)swipeLeftAction:(id)ignored{
    [webView goBack];
    [overlay postMessage:@"Go Back" duration:1 animated:YES];
    }
  • (void)swipeRightAction:(id)ignored{
    [webView goForward];
    [overlay postMessage:@"Go Forward" duration:1 animated:YES];
    }

-(void)pullToRefreshViewShouldRefresh:(PullToRefreshView *)view {
[(UIWebView *)[self.view viewWithTag:999] reload];
[overlay postMessage:@"Reloading" duration:1 animated:YES];
}

  • (void)webViewDidFinishLoad:(UIWebView *)wv
    {
    NSLog(@"Done!" );
    [(PullToRefreshView *)[self.view viewWithTag:998] finishedLoading];
    [overlay postFinishMessage:@"Done!" duration:1 animated:YES];
    [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
    }
  • (void)webViewDidStartLoad:(UIWebView *)webView {
    [UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
    }

If anybody has any ideas why it keeps calling done, I'd appreciate it.

UPDATE:
How our forum is set up, we have ads running, unless your an advanced member. So the status bar overlay is registering that web load, over and over again. Seeing how its not a direct code issue we can mark this as solved.

However, if somebody has an idea on how to get it to distinguish between a forum web page and ads, that would be helpful.

duration during postMessage:duration: method fails

I'm trying to use postMessage:duration: twice and then finish with a regular postMessage: in order to get the result of displaying two messages and then leaving a third message up indefinitely. Although the process works, the duration times of the other two messages (1.5 & 3 seconds) are disregarded. This looks like a bug?

StatusBarOverlay has wrong transform applied when firstly shown in Landscape mode

Take StatusOverlay version from b296913 or download sample project from:
http://www.DropBox.pl/file.php?name=217657578780A35E905C5FACEC9C80B7

Steps to reproduce:

  1. We will deploy the app to the device. Please make sure that device is in LandscapeLeft orientation before the app gets uploaded to the device.
  2. Upload app to the device
  3. StatusOverlay has wrongly setup transform. It is not synchronized with current status bar orientation. I would suggest to check the statusBar orientation in initWithFrame method using [UIApplication sharedApplication].statusBarOrientation.
    The above bug occurs also in a simulator.
    Result image can be found at:
    http://www.DropBox.pl/file.php?name=911648151B4D283D2AD89C86774F27F5

I guess the following is also connected with the above one:

  1. We will deploy app to the device. Please make sure that the device is in LandscapeRight orientation before the app gets uploaded to the device.
  2. Upload to the device.
  3. StatusOverlay is not displayed at all.

iPad Rotation

Rotation on iPad currently doesn't work because the frame gets mixed up

Update tag?

Since there have been a number of commits since November 2011, I was wondering your thoughts on updating the tag from 0.9? Think it'd allow for a cleaner Cocoapods update than using a SHA — what do you think @myell0w?

App Store rejection...

I guess it was bound to happen. I've been successfully using MTStatusBarOverlay to indicate the status of network data updates for well over a year now, and through a mountain of successful app updates without issue. Until today. TexLege was rejected because I was violating HIG by creating a "custom status bar". It's okay to hide the system status bar, but we can't make it seem like we're creating our own because it "causes confusion". My reply outlined how the system's network activity indicator causes more confusion than anything else they provide on the device ...

Error - History Insert

Hello, I really liked your project, more to test the example shown in git an error occurs. iOS5

[self.historyTableView insertRowsAtIndexPaths: [NSArray arrayWithObject: newHistoryMessageIndexPath] withRowAnimation: UITableViewRowAnimationFade];

Assertion failure in -[_UITableViewUpdateSupport _computeRowUpdates], /SourceCache/UIKit_Sim/UIKit-
1912.3/UITableViewSupport.m:386

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid table view update. The application has requested an update to the table view that is inconsistent with the state provided by the data source.

Thank you.

Status bar image is binary data? Can we get pngs?

I'm interested in changing the look of the actual status bar, not just the text in it. However, the image is coded in binary, within the class.

Do you have the original png, or the formula you used for the gradient?

Eliminate UIKit warning about root view controller

If I call [MTStatusBarOverlay sharedInstance] inside application:didFinishLaunchingWithOptions:, I get the following error message logged to console

Application windows are expected to have a root view controller at the end of application launch

Setting self.rootViewController = [[UIViewController alloc] init]; inside the init method of status bar overlay fixes the warning.

Tracking down iPad Landscape orientation issues

Ok, so I'm trying to track down the source of my problem with the MTStatusBarOverlay drawing in the wrong orientation when on an iPad in landscape view at startup. I know there were some issues about instantiating the MT status bar early on in the life cycle, so I've got it instantiating after a 10 second delay to coincide with the network updating process of the app (still in the main thread though).

However, right off the bat inside MT's - (id)initWithFrame:(CGRect)frame, I see a big issue that I can't explain. [UIApplication sharedApplication].statusBarFrame returns the incorrect orientation --- 20px width X 1024px height. So everything MT does after that point is based on a garbage rect.

What in the hell would cause the sharedApplication.statusBarFrame to be jacked up? Looking a little deeper, the headers say a CGRectZero would happen if the status bar weren't visible, but it is visible. I don't see anything that would indicate why this would read incorrectly even without an actual orientation change event.

Any thoughts on what's going on?

EDIT:
Yes, so I'm an idiot. MTStatusBarOverlay is a subclass of UIWindow ... UIWindow sees everything in portrait, even to us it looks like it's landscape. It's the subclasses of UIViewController that see everything in the apparent orientation. So, the dimensions of the statusBarFrame inside MTStatusBarOverlay should be 20px wide by whatever tall when it's in landscape. Right? However, this doesn't exactly explain why the status messages are drawing incorrectly in landscape mode.

Is there anything I can provide that would help resolve this issue?

Status label no longer centered after unshrink (iOS 5)

I noticed a issue when using MTStatusBarOverlayAnimationShrink.

If you display a standard notification message, then shrink the status area, then tap it again to unshrink and expand the status label will no longer be centered. In my app it appears about 12 points to the right of where it should be centered.

Can't seem to figure this out but I suspect it's a frame size issue.

Seems to affect iOS 5, as it is centered as expected in iOS 4.

iOS 5.1 Icon Graphics Not Working

The graphics for the various status bar icons are not displaying properly with iOS 5.1.

This is how the success checkmark its currently rendering, other graphics are also not displaying as expected:

Status Bar issue

Wrong message shown in statusBarOverlay.

Download the project from
http://www.DropBox.pl/file.php?name=CFD5DCF8A13CBBC0BFB344D7EE03C592 and run it with iPad simulator 4.2.
As you can see in the code I'm posting following messages to the StatusBarOverlay:
[[MTStatusBarOverlay sharedInstance] postImmediateMessage:@"a" animated:YES];
[[MTStatusBarOverlay sharedInstance] postImmediateFinishMessage:@"finished" duration:5 animated:YES];
[[MTStatusBarOverlay sharedInstance] postImmediateMessage:@"a" animated:YES];
[[MTStatusBarOverlay sharedInstance] postImmediateFinishMessage:@"finished" duration:5 animated:YES];
[[MTStatusBarOverlay sharedInstance] postImmediateMessage:@"a" animated:YES];
[[MTStatusBarOverlay sharedInstance] postImmediateFinishMessage:@"finished" duration:5 animated:YES];
[[MTStatusBarOverlay sharedInstance] postImmediateMessage:@"a" animated:YES];
[[MTStatusBarOverlay sharedInstance] postImmediateFinishMessage:@"finished" duration:5 animated:YES];
The text I see the last should be "finished", but instead of that I see "a". It does not matter how long do I wait.

Even when progress set to 0 first, progress looks like 0.5 initially

When using the following code (note that doFetch does stuff and updates the progress amount eventually up to 1.0):

MTStatusBarOverlay *overlay = [MTStatusBarOverlay sharedInstance];
overlay.animation = MTStatusBarOverlayAnimationShrink;
overlay.progress = 0.0;
[overlay postMessage:@"Fetching latest items..."];
[self doFetch];

There's a visible glitch: When the "Fetching latest items..." first shows in the status bar, it looks like it has 50% progress. Then the progress shoots back down to zero and it actually starts working up properly.

Progress feature issue

Hi myell0w,

I try to use the progress feature in my project and it doesn't work for me. Messages are displayed but the progress effect is not visible. Even if I use your exemple code:

MTStatusBarOverlay *overlay = [MTStatusBarOverlay sharedInstance];
overlay.animation = MTStatusBarOverlayAnimationFallDown; // MTStatusBarOverlayAnimationShrink
overlay.detailViewMode = MTDetailViewModeHistory; // enable automatic history-tracking and show in detail-view
overlay.delegate = self;
overlay.progress = 0.0;
[overlay postMessage:@"Following @myell0w on Twitter…"];
overlay.progress = 0.1;
// ...
[overlay postMessage:@"Following myell0w on Github…" animated:NO];
overlay.progress = 0.5;
// ...
[overlay postImmediateFinishMessage:@"Following was a good idea!" duration:2.0 animated:YES];
overlay.progress = 1.0;

Is there a code line needed to make it work?

Thank you very much in advance!

Thomas

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.