-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathViewController.m
62 lines (39 loc) · 1.24 KB
/
ViewController.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//
// ViewController.m
// MPV
//
// Created by admin on 2019/6/21.
// Copyright © 2019 李飞恒. All rights reserved.
//
#import "ViewController.h"
#import "AVMutableProgressView.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.7];
}
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[self setupMutableProgressView];
}
- (IBAction)setupMutableProgressView
{
CGRect frame = CGRectMake(0, self.view.center.y, self.view.bounds.size.width, 2);
AVMutableProgressView *avMPV = [AVMutableProgressView progressView];
avMPV.frame = frame;
avMPV.backgroundColor = [[UIColor darkGrayColor] colorWithAlphaComponent:0.1];
[self.view addSubview:avMPV];
}
- (IBAction)senderSliderEvent:(UISlider *)sender {
[[AVMutableProgressView progressView] setupProgressWith:sender.value];
}
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
CGFloat w = self.view.bounds.size.width;
int max = 90 + arc4random() % 812;
[[AVMutableProgressView progressView] setupStartPoint:max];
}
@end