You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

64 lines
1.7 KiB

//
// CLOnboardingWindowController.m
// Clocker
//
// Created by Abhishek Banthia on 1/19/16.
//
//
#import "CLOnboardingWindowController.h"
#import <QuartzCore/QuartzCore.h>
#import <pop/POP.h>
@interface CLOnboardingWindowController ()
@property (weak) IBOutlet NSTextField *titleLabel;
@property (weak) IBOutlet NSButton *continueButtonOutlet;
@property (strong, nonatomic) CLIntroViewController *introViewController;
@end
static CLOnboardingWindowController *sharedOnboardingWindow;
@implementation CLOnboardingWindowController
- (void)windowDidLoad {
[super windowDidLoad];
self.window.backgroundColor = [NSColor whiteColor];
self.window.titleVisibility = NSWindowTitleHidden;
POPSpringAnimation *shake = [POPSpringAnimation animationWithPropertyNamed:kPOPLayerPositionX];
shake.springBounciness = 35;
shake.velocity = @(1000);
[self.titleLabel.layer pop_addAnimation:shake forKey:@"shakePassword"];
// Implement this method to handle any initialization after your window controller's window has been loaded from its nib file.
}
+ (instancetype)sharedWindow
{
if (sharedOnboardingWindow == nil)
{
/*Using a thread safe pattern*/
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
sharedOnboardingWindow = [[self alloc] initWithWindowNibName:@"CLOnboardingWindow"];
});
}
return sharedOnboardingWindow;
}
- (IBAction)continueButtonPressed:(id)sender
{
self.introViewController = [[CLIntroViewController alloc] initWithNibName:@"CLIntroView" bundle:nil];
[[self.window animator] setContentSize:self.introViewController.view.frame.size];
[[self.window animator] setContentView:self.introViewController.view];
}
@end