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

Exposing some elements for customization; fixing deprecations #203

Open
wants to merge 3 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 17 additions & 2 deletions Example/TSMessages/TSDemoViewController.m
Expand Up @@ -19,7 +19,15 @@ - (void)viewDidLoad

[TSMessage setDefaultViewController:self];
[TSMessage setDelegate:self];
self.wantsFullScreenLayout = YES;

if ([self respondsToSelector:@selector(edgesForExtendedLayout)])
self.edgesForExtendedLayout = UIRectEdgeAll;
else
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
self.wantsFullScreenLayout = YES;
#pragma clang diagnostic pop

[self.navigationController.navigationBar setTranslucent:YES];
}

Expand Down Expand Up @@ -82,7 +90,14 @@ - (IBAction)didTapToggleNavigationBarAlpha:(id)sender

- (IBAction)didTapToggleWantsFullscreen:(id)sender
{
self.wantsFullScreenLayout = !self.wantsFullScreenLayout;
if ([self respondsToSelector:@selector(edgesForExtendedLayout)])
self.edgesForExtendedLayout = UIRectEdgeAll;
else
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
self.wantsFullScreenLayout = YES;
#pragma clang diagnostic pop

[self.navigationController.navigationBar setTranslucent:!self.navigationController.navigationBar.isTranslucent];
}

Expand Down
5 changes: 5 additions & 0 deletions Pod/Classes/TSMessageView.h
Expand Up @@ -34,6 +34,11 @@
/** Is the message currenlty fully displayed? Is set as soon as the message is really fully visible */
@property (nonatomic, assign) BOOL messageIsFullyDisplayed;

/** UI elements **/
@property (nonatomic, strong, readonly) UILabel *titleLabel;
@property (nonatomic, strong, readonly) UILabel *contentLabel;
@property (nonatomic, strong, readonly) UIButton *button;

/** Inits the notification view. Do not call this from outside this library.
@param title The title of the notification view
@param subtitle The subtitle of the notification view (optional)
Expand Down
2 changes: 1 addition & 1 deletion Pod/Classes/TSMessageView.m
Expand Up @@ -39,8 +39,8 @@ @interface TSMessageView () <UIGestureRecognizerDelegate>
/** Internal properties needed to resize the view on device rotation properly */
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UILabel *contentLabel;
@property (nonatomic, strong) UIImageView *iconImageView;
@property (nonatomic, strong) UIButton *button;
@property (nonatomic, strong) UIImageView *iconImageView;
@property (nonatomic, strong) UIView *borderView;
@property (nonatomic, strong) UIImageView *backgroundImageView;
@property (nonatomic, strong) TSBlurView *backgroundBlurView; // Only used in iOS 7
Expand Down