Skip to content
Open
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
58 changes: 49 additions & 9 deletions SF iOS/SF iOS/EventDetails/EventDetailsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#import "DirectionsRequest.h"
#import "Location.h"
#import "Style.h"
#import "UIActivityViewController+Utilities.h"
@import MapKit;


Expand Down Expand Up @@ -174,9 +175,54 @@ - (void)getTravelTimes {
}];
}

- (void)applyStyle:(id<Style>)style {
self.style = style;

self.view.backgroundColor = style.colors.backgroundColor;
self.titleLabel.textColor = style.colors.primaryTextColor;
self.titleLabel.font = style.fonts.primaryFont;
self.subtitleLabel.textColor = style.colors.secondaryTextColor;
self.subtitleLabel.font = style.fonts.subtitleFont;
[self.travelTimesView applyStyle:style];
}

// MARK: Share

- (void)share {
NSString *shareGroupButtonTitle = NSLocalizedString(@"Share Event",
@"Share Event");

NSString *shareAppButtonTitle = NSLocalizedString(@"Share App",
@"Share App");

NSString *cancelButtonTitle = NSLocalizedString(@"Cancel", @"Cancel");

UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil
message:nil
preferredStyle:UIAlertControllerStyleActionSheet];

[alert addAction:[UIAlertAction actionWithTitle:shareGroupButtonTitle
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * _Nonnull action) {
[self shareEvent];
}]];

[alert addAction:[UIAlertAction actionWithTitle:shareAppButtonTitle
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * _Nonnull action) {
[self shareApp];
}]];

[alert addAction:[UIAlertAction actionWithTitle:cancelButtonTitle
style:UIAlertActionStyleDestructive
handler:^(UIAlertAction * _Nonnull action) {

}]];

[self presentViewController:alert animated:true completion:nil];
}

- (void)shareEvent {
// TODO: Use coffeecoffeecoffee.coffee url.
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateStyle:NSDateFormatterMediumStyle];
Expand All @@ -190,15 +236,9 @@ - (void)share {
[self presentViewController:shareSheet animated:true completion:nil];
}

- (void)applyStyle:(id<Style>)style {
self.style = style;

self.view.backgroundColor = style.colors.backgroundColor;
self.titleLabel.textColor = style.colors.primaryTextColor;
self.titleLabel.font = style.fonts.primaryFont;
self.subtitleLabel.textColor = style.colors.secondaryTextColor;
self.subtitleLabel.font = style.fonts.subtitleFont;
[self.travelTimesView applyStyle:style];
- (void)shareApp {
UIActivityViewController *shareSheet = [[UIActivityViewController alloc] shareApp];
[self presentViewController:shareSheet animated:true completion:nil];
}

@end
Expand Down