Skip to content

Instantly share code, notes, and snippets.

@RyanFriedman
Last active February 9, 2016 04:29
Show Gist options
  • Save RyanFriedman/8fe26e6d768301d1a57f to your computer and use it in GitHub Desktop.
Save RyanFriedman/8fe26e6d768301d1a57f to your computer and use it in GitHub Desktop.
//
// HMNavigationLabel.m
// Hypemarket
//
// Created by Ryan Friedman on 7/31/15.
// Copyright (c) 2015 vibrantlight. All rights reserved.
//
#import "HMNavigationLabel.h"
@implementation HMNavigationLabel
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
// Initialization code
self.backgroundColor = [UIColor clearColor];
self.font = [UIFont fontWithName:@"Bryant-Regular" size:16.0];
self.shadowColor = [UIColor colorWithWhite:0.0 alpha:0.5];
self.textAlignment = NSTextAlignmentCenter;
self.textColor = [UIColor whiteColor];
}
return self;
}
@end
//
// HMNewTermsViewController.h
// Hypemarket
//
// Created by Ryan Friedman on 2/8/16.
// Copyright © 2016 vibrantlight. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "HMViewController.h"
@interface HMNewTermsViewController : HMViewController
@end
//
// HMNewTermsViewController.m
// Hypemarket
//
// Created by Ryan Friedman on 2/8/16.
// Copyright © 2016 vibrantlight. All rights reserved.
//
#import "HMNewTermsViewController.h"
@interface HMNewTermsViewController ()
@end
@implementation HMNewTermsViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
[self.titleLabel setText:@"CONFIRM TERMS"];
[self.titleLabel sizeToFit];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
//
// HMViewController.m
// Hypemarket
//
// Created by Ryan Friedman on 2/8/16.
// Copyright © 2016 vibrantlight. All rights reserved.
//
#import "HMViewController.h"
@interface HMViewController ()
@end
@implementation HMViewController
@synthesize titleLabel;
- (id)init
{
NSLog(@"override the init");
self = [super init];
if (self) {
self.view.backgroundColor = [UIColor whiteColor];
titleLabel = [[HMNavigationLabel alloc] initWithFrame:CGRectZero];
[titleLabel setTextColor:[UIColor whiteColor]];
[titleLabel setShadowColor:[UIColor colorWithWhite:0.0 alpha:0.0]];
self.navigationItem.titleView = self.titleLabel;
UIBarButtonItem *close = [[UIBarButtonItem alloc] initWithTitle:@"Close"
style:UIBarButtonItemStylePlain
target:self
action:@selector(close)];
[self.navigationItem setLeftBarButtonItem:close];
}
return self;
}
- (void)close
{
[self dismissViewControllerAnimated:YES completion:nil];
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment