Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Adonis committed Dec 10, 2015
0 parents commit 3dee8d6
Show file tree
Hide file tree
Showing 86 changed files with 4,831 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## Build generated
build/
DerivedData

## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata

## Other
*.xccheckout
*.moved-aside
*.xcuserstate
*.xcscmblueprint

## Obj-C/Swift specific
*.hmap
*.ipa
13 changes: 13 additions & 0 deletions Example/DemoViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// DemoViewController.h
// RMessage
//
// Created by Adonis Peralta on 12/7/15.
// Copyright © 2015 Rendezvous Inc. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface DemoViewController : UIViewController

@end
222 changes: 222 additions & 0 deletions Example/DemoViewController.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,222 @@
//
// DemoViewController.m
// RMessage
//
// Created by Adonis Peralta on 12/7/15.
// Copyright © 2015 Rendezvous Inc. All rights reserved.
//

#import "DemoViewController.h"
#import "RMessage.h"
#import "RMessageView.h"

@interface DemoViewController () <RMessageProtocol>

@end

@implementation DemoViewController

- (void)viewDidLoad
{
[super viewDidLoad];
[RMessage setDefaultViewController:self];
[RMessage setDelegate:self];
[self.navigationController.navigationBar setTranslucent:YES];
self.extendedLayoutIncludesOpaqueBars = YES;
}

- (IBAction)didTapError:(id)sender
{
[RMessage showNotificationWithTitle:NSLocalizedString(@"Something failed", nil)
subtitle:NSLocalizedString(@"The internet connection seems to be down. Please check it!", nil)
type:RMessageTypeError
customTypeString:nil];
}

- (IBAction)didTapWarning:(id)sender
{
[RMessage showNotificationWithTitle:NSLocalizedString(@"Some random warning", nil)
subtitle:NSLocalizedString(@"Look out! Something is happening there!", nil)
type:RMessageTypeWarning
customTypeString:nil];
}

- (IBAction)didTapMessage:(id)sender
{
[RMessage showNotificationWithTitle:NSLocalizedString(@"Tell the user something", nil)
subtitle:NSLocalizedString(@"This is some neutral notification!", nil)
type:RMessageTypeNormal
customTypeString:nil];
}

- (IBAction)didTapSuccess:(id)sender
{
[RMessage showNotificationWithTitle:NSLocalizedString(@"Success", nil)
subtitle:NSLocalizedString(@"Some task was successfully completed!", nil)
type:RMessageTypeSuccess
customTypeString:nil];
}

- (IBAction)didTapButton:(id)sender
{
[RMessage showNotificationInViewController:self
title:NSLocalizedString(@"New version available", nil)
subtitle:NSLocalizedString(@"Please update our app. We would be very thankful", nil)
iconImage:nil
type:RMessageTypeNormal
customTypeString:nil
duration:RMessageDurationAutomatic
callback:nil
buttonTitle:NSLocalizedString(@"Update", nil)
buttonCallback:^{
[RMessage showNotificationWithTitle:NSLocalizedString(@"Thanks for updating", nil)
type:RMessageTypeSuccess
customTypeString:nil];
}
atPosition:RMessagePositionTop
canBeDismissedByUser:YES];
}

- (IBAction)didTapToggleNavigationBar:(id)sender
{
[self.navigationController setNavigationBarHidden:!self.navigationController.navigationBarHidden animated:YES];
}

- (IBAction)didTapToggleNavigationBarAlpha:(id)sender
{
CGFloat alpha = self.navigationController.navigationBar.alpha;
self.navigationController.navigationBar.alpha = (alpha == 1.f) ? 0.5 : 1;
}

- (IBAction)didTapToggleWantsFullscreen:(id)sender
{
self.extendedLayoutIncludesOpaqueBars = !self.extendedLayoutIncludesOpaqueBars;
[self.navigationController.navigationBar setTranslucent:!self.navigationController.navigationBar.isTranslucent];
}

- (IBAction)didTapCustomImage:(id)sender
{
[RMessage showNotificationInViewController:self
title:NSLocalizedString(@"Custom image", nil)
subtitle:NSLocalizedString(@"This uses an image you can define", nil)
iconImage:[UIImage imageNamed:@"NotificationButtonBackground.png"]
type:RMessageTypeNormal
customTypeString:nil
duration:RMessageDurationAutomatic
callback:nil
buttonTitle:nil
buttonCallback:nil
atPosition:RMessagePositionTop
canBeDismissedByUser:YES];
}

- (IBAction)didTapDismissCurrentMessage:(id)sender
{
[RMessage dismissActiveNotification];
}

- (IBAction)didTapEndless:(id)sender
{
[RMessage showNotificationInViewController:self
title:NSLocalizedString(@"Endless", nil)
subtitle:NSLocalizedString(@"This message can not be dismissed and will not be hidden automatically. Tap the 'Dismiss' button to dismiss the currently shown message", nil)
iconImage:nil
type:RMessageTypeSuccess
customTypeString:nil
duration:RMessageDurationEndless
callback:nil
buttonTitle:nil
buttonCallback:nil
atPosition:RMessagePositionTop
canBeDismissedByUser:NO];
}

- (IBAction)didTapLong:(id)sender
{
[RMessage showNotificationInViewController:self
title:NSLocalizedString(@"Long", nil)
subtitle:NSLocalizedString(@"This message is displayed 10 seconds instead of the calculated value", nil)
iconImage:nil
type:RMessageTypeWarning
customTypeString:nil
duration:10.0
callback:nil
buttonTitle:nil
buttonCallback:nil
atPosition:RMessagePositionTop
canBeDismissedByUser:YES];
}

- (IBAction)didTapBottom:(id)sender
{
[RMessage showNotificationInViewController:self
title:NSLocalizedString(@"Hu!", nil)
subtitle:NSLocalizedString(@"I'm down here :)", nil)
iconImage:nil
type:RMessageTypeSuccess
customTypeString:nil
duration:RMessageDurationAutomatic
callback:nil
buttonTitle:nil
buttonCallback:nil
atPosition:RMessagePositionBottom
canBeDismissedByUser:YES];
}

- (IBAction)didTapText:(id)sender
{
[RMessage showNotificationWithTitle:NSLocalizedString(@"With 'Text' I meant a long text, so here it is", nil)
subtitle:NSLocalizedString(@"Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus.At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus", nil)
type:RMessageTypeWarning
customTypeString:nil];
}

- (IBAction)didTapCustomDesign:(id)sender
{
// this is an example on how to apply a custom design
[RMessage addCustomDesignFromFileWithName:@"AlternativeDesign"];
[RMessage showNotificationWithTitle:NSLocalizedString(@"Updated to custom design file", nil)
subtitle:NSLocalizedString(@"From now on, all the titles of success messages are larger", nil)
type:RMessageTypeCustom
customTypeString:@"alternate-error"];
}


- (IBAction)didTapNavBarOverlay:(id)sender
{
if (self.navigationController.navigationBarHidden){
[self.navigationController setNavigationBarHidden:NO];
}

[RMessage showNotificationInViewController:self.navigationController
title:NSLocalizedString(@"Whoa!", nil)
subtitle:NSLocalizedString(@"Over the Navigation Bar!", nil)
iconImage:nil
type:RMessageTypeSuccess
customTypeString:nil
duration:RMessageDurationAutomatic
callback:nil
buttonTitle:nil
buttonCallback:nil
atPosition:RMessagePositionNavBarOverlay
canBeDismissedByUser:YES];
}



//- (CGFloat)messageLocationOfMessageView:(RMessageView *)messageView
//{
// return 44.0; // any calculation here
//}

//- (void)customizeMessageView:(RMessageView *)messageView
//{
// messageView.alpha = 0.5;
//}

- (IBAction)didTapNavbarHidden:(id)sender
{
self.navigationController.navigationBarHidden = !self.navigationController.navigationBarHidden;
}

@end
4 changes: 4 additions & 0 deletions Example/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source 'https://github.com/CocoaPods/Specs.git'
pod 'HexColors', :git => 'https://github.com/mRs-/HexColors.git'
pod 'PPTopMostController', :git => 'https://github.com/donileo/PPTopMostController.git'
pod 'RMessage', :path => '../'
34 changes: 34 additions & 0 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
PODS:
- HexColors (3.0.0)
- PPTopMostController (0.0.1)
- RMessage (1.0.1):
- HexColors (~> 3.0.0)
- PPTopMostController

DEPENDENCIES:
- HexColors (from `https://github.com/mRs-/HexColors.git`)
- PPTopMostController (from `https://github.com/donileo/PPTopMostController.git`)
- RMessage (from `../`)

EXTERNAL SOURCES:
HexColors:
:git: https://github.com/mRs-/HexColors.git
PPTopMostController:
:git: https://github.com/donileo/PPTopMostController.git
RMessage:
:path: "../"

CHECKOUT OPTIONS:
HexColors:
:commit: aa42656d5fb8ca7942927a4d73696900d7306914
:git: https://github.com/mRs-/HexColors.git
PPTopMostController:
:commit: 9e725746cff79a6286554d76dcce279909c327ab
:git: https://github.com/donileo/PPTopMostController.git

SPEC CHECKSUMS:
HexColors: 8b83e3fe90c0d466dae7b98c9d22da95799f99cb
PPTopMostController: ca6c8fd33abd2895d57d86bfe27ae7425b44eea8
RMessage: 824c881c073427bd3334716630ac4b53dbb2b6a8

COCOAPODS: 0.39.0
1 change: 1 addition & 0 deletions Example/Pods/Headers/Private/HexColors/HexColors.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Example/Pods/Headers/Private/RMessage/RMessage.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Example/Pods/Headers/Private/RMessage/RMessageView.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Example/Pods/Headers/Public/HexColors/HexColors.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Example/Pods/Headers/Public/RMessage/RMessage.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Example/Pods/Headers/Public/RMessage/RMessageView.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions Example/Pods/HexColors/Classes/HexColors.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3dee8d6

Please sign in to comment.