2017-02-02 03:45:10 +02:00

42 lines
889 B
Objective-C

//
// ViewController.m
// Example for lottie-macos
//
// Created by Oleksii Pavlovskyi on 2/2/17.
// Copyright © 2017 Brandon Withrow. All rights reserved.
//
#import "ViewController.h"
#import <Lottie/Lottie.h>
@interface ViewController ()
@property (nonatomic, strong) LAAnimationView *lottieLogo;
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.lottieLogo = [LAAnimationView animationNamed:@"LottieLogo1"];
self.lottieLogo.contentMode = LAViewContentModeScaleAspectFill;
self.lottieLogo.frame = self.view.bounds;
self.lottieLogo.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
[self.view addSubview:self.lottieLogo];
}
- (void)viewDidAppear {
[super viewDidAppear];
[self.lottieLogo play];
}
- (void)viewDidDisappear {
[super viewDidDisappear];
[self.lottieLogo pause];
}
@end