Skip to content

Commit

Permalink
update readme and add demo.gif
Browse files Browse the repository at this point in the history
  • Loading branch information
hlung committed Mar 19, 2015
1 parent de30fd6 commit 2de8411
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6751" systemVersion="14C1510" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="aFQ-0U-rhW">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6736"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
</dependencies>
<scenes>
<!--Navigation Controller-->
Expand Down Expand Up @@ -33,6 +34,15 @@
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="12G-7Z-3X1">
<rect key="frame" x="122" y="105" width="77" height="30"/>
<state key="normal" title="No Internet">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="noInternet:" destination="BYZ-38-t0r" eventType="touchUpInside" id="cgk-fd-f6u"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="W1J-T4-r3G">
<rect key="frame" x="106" y="215" width="108" height="30"/>
<state key="normal" title="Reconnecting...">
Expand Down Expand Up @@ -60,25 +70,65 @@
<action selector="internetConnected:" destination="BYZ-38-t0r" eventType="touchUpInside" id="9UB-n8-kHk"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="12G-7Z-3X1">
<rect key="frame" x="122" y="105" width="77" height="30"/>
<state key="normal" title="No Internet">
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="g80-Na-8xk">
<rect key="frame" x="208" y="367" width="96" height="30"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="qAe-p3-C6P"/>
</constraints>
<state key="normal" title="White on Blue">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<variation key="default">
<mask key="constraints">
<exclude reference="qAe-p3-C6P"/>
</mask>
</variation>
<connections>
<action selector="noInternet:" destination="BYZ-38-t0r" eventType="touchUpInside" id="cgk-fd-f6u"/>
<action selector="whiteOnBlue:" destination="BYZ-38-t0r" eventType="touchUpInside" id="sza-ym-awq"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="vSb-GQ-qTr">
<rect key="frame" x="16" y="367" width="104" height="30"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="Ql8-4v-4p1"/>
</constraints>
<state key="normal" title="Black on White">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<variation key="default">
<mask key="constraints">
<exclude reference="Ql8-4v-4p1"/>
</mask>
</variation>
<connections>
<action selector="blackOnWhite:" destination="BYZ-38-t0r" eventType="touchUpInside" id="Een-lc-RdL"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Coloring" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zcT-Qu-sks">
<rect key="frame" x="16" y="335" width="288" height="21"/>
<color key="backgroundColor" white="0.86168453469999995" alpha="1" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="centerX" secondItem="12G-7Z-3X1" secondAttribute="centerX" id="3it-wJ-9ry"/>
<constraint firstItem="W1J-T4-r3G" firstAttribute="top" secondItem="9bo-vs-IgJ" secondAttribute="bottom" constant="25" id="Dvc-18-MWY"/>
<constraint firstItem="zcT-Qu-sks" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leadingMargin" id="HxS-9d-FEV"/>
<constraint firstItem="9bo-vs-IgJ" firstAttribute="top" secondItem="12G-7Z-3X1" secondAttribute="bottom" constant="25" id="INa-X1-tNV"/>
<constraint firstAttribute="centerX" secondItem="g80-Na-8xk" secondAttribute="centerX" constant="-96" id="Ob7-Wb-tqs"/>
<constraint firstAttribute="centerX" secondItem="W1J-T4-r3G" secondAttribute="centerX" id="PtW-qp-WqE"/>
<constraint firstItem="AqE-D3-5bn" firstAttribute="top" secondItem="W1J-T4-r3G" secondAttribute="bottom" constant="25" id="Qas-39-HHh"/>
<constraint firstItem="12G-7Z-3X1" firstAttribute="top" secondItem="y3c-jy-aDJ" secondAttribute="bottom" constant="41" id="Z7v-gC-80K"/>
<constraint firstAttribute="centerX" secondItem="AqE-D3-5bn" secondAttribute="centerX" id="aTj-70-7PU"/>
<constraint firstItem="zcT-Qu-sks" firstAttribute="top" secondItem="AqE-D3-5bn" secondAttribute="bottom" constant="35" id="hRb-Et-LPm"/>
<constraint firstItem="zcT-Qu-sks" firstAttribute="trailing" secondItem="8bC-Xf-vdC" secondAttribute="trailingMargin" id="nNU-bf-Rzn"/>
<constraint firstItem="vSb-GQ-qTr" firstAttribute="top" secondItem="zcT-Qu-sks" secondAttribute="bottom" constant="11" id="ptd-eN-N0S"/>
<constraint firstItem="g80-Na-8xk" firstAttribute="top" secondItem="zcT-Qu-sks" secondAttribute="bottom" constant="11" id="sJP-jq-40w"/>
<constraint firstAttribute="centerX" secondItem="zcT-Qu-sks" secondAttribute="centerX" constant="-0.5" id="trd-jd-I16"/>
<constraint firstAttribute="centerX" secondItem="vSb-GQ-qTr" secondAttribute="centerX" constant="92" id="uXZ-TY-RzU"/>
<constraint firstAttribute="centerX" secondItem="9bo-vs-IgJ" secondAttribute="centerX" id="xVB-Hx-Tb9"/>
</constraints>
</view>
Expand Down
35 changes: 21 additions & 14 deletions MTStatusBarOverlayDemo/MTStatusBarOverlayDemo/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,39 +10,46 @@
#import "MTStatusBarOverlay.h"

@interface ViewController ()

@property (strong, nonatomic) MTStatusBarOverlay *overlay;
@end

@implementation ViewController

- (void)viewDidLoad {
[super viewDidLoad];

MTStatusBarOverlay *overlay = [MTStatusBarOverlay sharedInstance];
overlay.animation = MTStatusBarOverlayAnimationFallDown; // MTStatusBarOverlayAnimationShrink
overlay.detailViewMode = MTDetailViewModeHistory; // enable automatic history-tracking and show in detail-view
overlay.customTextColor = [UIColor blackColor];
overlay.customBackgroundColor = [UIColor whiteColor];
self.overlay = [MTStatusBarOverlay sharedInstance];
self.overlay.animation = MTStatusBarOverlayAnimationFallDown; // MTStatusBarOverlayAnimationShrink
self.overlay.detailViewMode = MTDetailViewModeHistory; // enable automatic history-tracking and show in detail-view

self.overlay.customTextColor = [UIColor blackColor];
self.overlay.customBackgroundColor = [UIColor whiteColor];
}

- (IBAction)blackOnWhite:(id)sender {
self.overlay.customTextColor = [UIColor blackColor];
self.overlay.customBackgroundColor = [UIColor whiteColor];
}

- (IBAction)whiteOnBlue:(id)sender {
self.overlay.customTextColor = [UIColor whiteColor];
self.overlay.customBackgroundColor = [UIColor blueColor];
}

- (IBAction)noInternet:(id)sender {
MTStatusBarOverlay *overlay = [MTStatusBarOverlay sharedInstance];
[overlay postImmediateErrorMessage:@"No Internet Connection" duration:2 animated:YES];
[self.overlay postImmediateErrorMessage:@"No Internet Connection" duration:2 animated:YES];
}

- (IBAction)internetConnected:(id)sender {
MTStatusBarOverlay *overlay = [MTStatusBarOverlay sharedInstance];
[overlay postFinishMessage:@"Internet Connected" duration:2 animated:YES];
[self.overlay postFinishMessage:@"Internet Connected" duration:2 animated:YES];
}

- (IBAction)reconnecting:(id)sender {
MTStatusBarOverlay *overlay = [MTStatusBarOverlay sharedInstance];
[overlay postImmediateMessage:@"Reconnecting..." animated:YES];
[self.overlay postImmediateMessage:@"Reconnecting..." animated:YES];
}

- (IBAction)hideToast:(id)sender {
MTStatusBarOverlay *overlay = [MTStatusBarOverlay sharedInstance];
[overlay hide];
[self.overlay hide];
}

@end
14 changes: 14 additions & 0 deletions Readme.mdown
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
Read Me
=====================

Hlung's fork
------

- major refactor for iOS 7+
- remove old OS 6 style status bar background "hex" image
- remove old OS 6 style label shadow
- add ability to set custom text/background color, overriding default coloring that depends on UIStatusBarStyle
- add demo project
- add demo.gif

![demo](demo.gif)

-----------------

**If you use MTStatusBarOverlay in your app, please drop me a line so that I can add your app here!**

UIStatusBarStyleDefault (left: full size, right: shrinked)
Expand Down
Binary file added demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2de8411

Please sign in to comment.