Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix malposition for pushed TabbarController, add support for simultaneously message for TabbarController #145

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions ExampleProject/Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
CA0B971E1719CD6800E06F84 /* MainStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CA0B971C1719CD6800E06F84 /* MainStoryboard.storyboard */; };
CA0B97281719CD6800E06F84 /* TSDemoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CA0B97271719CD6800E06F84 /* TSDemoViewController.m */; };
CAA3C9E817C3CD180085E06E /* AlternativeDesign.json in Resources */ = {isa = PBXBuildFile; fileRef = CAA3C9E717C3CD180085E06E /* AlternativeDesign.json */; };
FE493BB9191B63B1001F16FD /* firstViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FE493BB8191B63B1001F16FD /* firstViewController.m */; };
FE493BBC191B63C0001F16FD /* secondViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FE493BBB191B63C0001F16FD /* secondViewController.m */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -42,6 +44,10 @@
CA0B97261719CD6800E06F84 /* TSDemoViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TSDemoViewController.h; sourceTree = "<group>"; };
CA0B97271719CD6800E06F84 /* TSDemoViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TSDemoViewController.m; sourceTree = "<group>"; };
CAA3C9E717C3CD180085E06E /* AlternativeDesign.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = AlternativeDesign.json; sourceTree = "<group>"; };
FE493BB7191B63B1001F16FD /* firstViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = firstViewController.h; sourceTree = "<group>"; };
FE493BB8191B63B1001F16FD /* firstViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = firstViewController.m; sourceTree = "<group>"; };
FE493BBA191B63C0001F16FD /* secondViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = secondViewController.h; sourceTree = "<group>"; };
FE493BBB191B63C0001F16FD /* secondViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = secondViewController.m; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -98,6 +104,10 @@
CA0B97261719CD6800E06F84 /* TSDemoViewController.h */,
CA0B97271719CD6800E06F84 /* TSDemoViewController.m */,
CA0B970B1719CD6800E06F84 /* Supporting Files */,
FE493BB7191B63B1001F16FD /* firstViewController.h */,
FE493BB8191B63B1001F16FD /* firstViewController.m */,
FE493BBA191B63C0001F16FD /* secondViewController.h */,
FE493BBB191B63C0001F16FD /* secondViewController.m */,
);
path = Example;
sourceTree = "<group>";
Expand Down Expand Up @@ -205,6 +215,8 @@
CA0B97111719CD6800E06F84 /* main.m in Sources */,
CA0B97151719CD6800E06F84 /* TSAppDelegate.m in Sources */,
CA0B97281719CD6800E06F84 /* TSDemoViewController.m in Sources */,
FE493BB9191B63B1001F16FD /* firstViewController.m in Sources */,
FE493BBC191B63C0001F16FD /* secondViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,34 @@
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>F6FF7C22-1562-4A01-9CD1-A3C34B7E21C3</string>
<string>3379FE2B-13BB-43D7-A6E1-7B7A4F8B4942</string>
<key>IDESourceControlProjectName</key>
<string>Example</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>56C72571-8325-46B6-BC46-920E7DE5B629</key>
<string>https://github.com/toursprung/TSMessages.git</string>
<key>8403C1EC-6EA0-4DAB-B624-129408DCF536</key>
<string>https://github.com/vilyever/TSMessages.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>ExampleProject/Example.xcworkspace</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>56C72571-8325-46B6-BC46-920E7DE5B629</key>
<key>8403C1EC-6EA0-4DAB-B624-129408DCF536</key>
<string>../..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>https://github.com/toursprung/TSMessages.git</string>
<string>https://github.com/vilyever/TSMessages.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>110</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>56C72571-8325-46B6-BC46-920E7DE5B629</string>
<string>8403C1EC-6EA0-4DAB-B624-129408DCF536</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>56C72571-8325-46B6-BC46-920E7DE5B629</string>
<string>8403C1EC-6EA0-4DAB-B624-129408DCF536</string>
<key>IDESourceControlWCCName</key>
<string>TSMessages</string>
</dict>
Expand Down
45 changes: 32 additions & 13 deletions ExampleProject/Example/TSDemoViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
#import "TSMessage.h"
#import "TSMessageView.h"

@interface TSDemoViewController()

@property (nonatomic, strong) TSMessageView *endlessNotification;

@end

@implementation TSDemoViewController

- (void)viewDidLoad
Expand All @@ -26,28 +32,32 @@ - (IBAction)didTapError:(id)sender
{
[TSMessage showNotificationWithTitle:NSLocalizedString(@"Something failed", nil)
subtitle:NSLocalizedString(@"The internet connection seems to be down. Please check that!", nil)
type:TSMessageNotificationTypeError];
type:TSMessageNotificationTypeError
simultaneously:NO];
}

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

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

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

- (IBAction)didTapButton:(id)sender
Expand All @@ -62,10 +72,12 @@ - (IBAction)didTapButton:(id)sender
buttonTitle:NSLocalizedString(@"Update", nil)
buttonCallback:^{
[TSMessage showNotificationWithTitle:NSLocalizedString(@"Thanks for updating", nil)
type:TSMessageNotificationTypeSuccess];
type:TSMessageNotificationTypeSuccess
simultaneously:YES];
}
atPosition:TSMessageNotificationPositionTop
canBeDismissedByUser:YES];
canBeDismissedByUser:YES
simultaneously:NO];
}

- (IBAction)didTapToggleNavigationBar:(id)sender {
Expand All @@ -92,7 +104,8 @@ - (IBAction)didTapCustomImage:(id)sender
buttonTitle:nil
buttonCallback:nil
atPosition:TSMessageNotificationPositionTop
canBeDismissedByUser:YES];
canBeDismissedByUser:YES
simultaneously:YES];
}

- (IBAction)didTapDismissCurrentMessage:(id)sender
Expand All @@ -102,7 +115,7 @@ - (IBAction)didTapDismissCurrentMessage:(id)sender

- (IBAction)didTapEndless:(id)sender
{
[TSMessage showNotificationInViewController:self
self.endlessNotification = [TSMessage 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)
image:nil
Expand All @@ -112,7 +125,8 @@ - (IBAction)didTapEndless:(id)sender
buttonTitle:nil
buttonCallback:nil
atPosition:TSMessageNotificationPositionTop
canBeDismissedByUser:NO];
canBeDismissedByUser:NO
simultaneously:YES];
}

- (IBAction)didTapLong:(id)sender
Expand All @@ -127,11 +141,13 @@ - (IBAction)didTapLong:(id)sender
buttonTitle:nil
buttonCallback:nil
atPosition:TSMessageNotificationPositionTop
canBeDismissedByUser:YES];
canBeDismissedByUser:YES
simultaneously:NO];
}

- (IBAction)didTapBottom:(id)sender
{
[TSMessage dismissNotification:self.endlessNotification];
[TSMessage showNotificationInViewController:self
title:NSLocalizedString(@"Hu!", nil)
subtitle:NSLocalizedString(@"I'm down here :)", nil)
Expand All @@ -142,14 +158,16 @@ - (IBAction)didTapBottom:(id)sender
buttonTitle:nil
buttonCallback:nil
atPosition:TSMessageNotificationPositionBottom
canBeDismissedByUser:YES];
canBeDismissedByUser:YES
simultaneously:YES];
}

- (IBAction)didTapText:(id)sender
{
[TSMessage 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", nil)
type:TSMessageNotificationTypeWarning];
type:TSMessageNotificationTypeWarning
simultaneously:NO];
}

- (IBAction)didTapCustomDesign:(id)sender
Expand All @@ -158,7 +176,8 @@ - (IBAction)didTapCustomDesign:(id)sender
[TSMessage addCustomDesignFromFileWithName:@"AlternativeDesign.json"];
[TSMessage showNotificationWithTitle:NSLocalizedString(@"Updated to custom design file", nil)
subtitle:NSLocalizedString(@"From now on, all the titles of success messages are larger", nil)
type:TSMessageNotificationTypeSuccess];
type:TSMessageNotificationTypeSuccess
simultaneously:YES];
}


Expand Down
Loading