From a609d13ff3c5f4b58b286dbb9419fc9670799c99 Mon Sep 17 00:00:00 2001
From: AceSL <1093788164@qq.com>
Date: Sat, 21 Nov 2020 01:08:42 +0000
Subject: [PATCH] first commit
---
MyCircleView/ViewController.m | 22 +++++++++++++++++++++-
1 files changed, 21 insertions(+), 1 deletions(-)
diff --git a/MyCircleView/ViewController.m b/MyCircleView/ViewController.m
index 20e11df..b8627b9 100644
--- a/MyCircleView/ViewController.m
+++ b/MyCircleView/ViewController.m
@@ -7,9 +7,10 @@
//
#import "ViewController.h"
+#import "MyCircleView.h"
@interface ViewController ()
-
+@property (nonatomic,strong) MyCircleView *circleV;
@end
@implementation ViewController
@@ -17,6 +18,25 @@
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
+
+ self.view.backgroundColor = [UIColor colorWithRed:41/255.0 green:133/255.0 blue:266/255.0 alpha:1.0];
+
+ _circleV = [[MyCircleView alloc] initWithFrame:CGRectMake(100, 100, 200, 200)];
+ [self.view addSubview:_circleV];
+ [_circleV circleWithProgress:90 value:128 * 0.9];
+
+ UIButton * button = [UIButton buttonWithType:UIButtonTypeCustom];
+ button.frame = CGRectMake(100, 400, 100, 44);
+ [button setTitle:@"刷新" forState:UIControlStateNormal];
+ [button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
+ [self.view addSubview:button];
+ [button addTarget:self action:@selector(refreshAnimation) forControlEvents:UIControlEventTouchUpInside];
+}
+
+- (void)refreshAnimation
+{
+ NSInteger progress = arc4random_uniform(100);
+ [_circleV circleWithProgress:progress value:128 * progress/100.0];
}
--
Gitblit v1.9.1