chore: Initial clean commit

- Removed YuMi/Library/ (138 MB, not tracked)
- Removed YuMi/Resources/ (23 MB, not tracked)
- Removed old version assets (566 files, not tracked)
- Excluded Pods/, xcuserdata/ and other build artifacts
- Clean repository optimized for company server deployment
This commit is contained in:
edwinQQQ
2025-10-09 16:19:14 +08:00
commit a35a711be6
5582 changed files with 408913 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
//
// SGYProgressView.h
// xplan-ios
//
// Created by duoban on 2022/12/29.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SGYProgressView : UIView
/// 初始化方法
/// @param frame 圆形环的绘制区域
/// @param trackWidth 圆形环的宽度
- (instancetype)initWithFrame:(CGRect)frame trackWidth:(CGFloat)trackWidth NS_DESIGNATED_INITIALIZER;
- (instancetype)init NS_UNAVAILABLE;
- (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE;
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_UNAVAILABLE;
@property (nonatomic, strong) UIColor *progressColor; //进度条颜色
@property (nonatomic, strong) UIColor *progressBgColor; //进度条背景颜色
@property (nonatomic,assign)CGFloat progress; // 0.0 .. 1.0, default is
- (void)setProgress:(CGFloat)progress animated:(BOOL)animated;
/// 设置进度条
/// @param progress 进度条百分比
/// @param animated 是否开启动画
/// @param startAngle 起始角度
/// @param clockwise 进度条方向(是否顺时针)
- (void)setProgress:(CGFloat)progress animated:(BOOL)animated startAngle:(CGFloat )startAngle clockwise:(BOOL)clockwise;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,112 @@
//
// SGYProgressView.m
// xplan-ios
//
// Created by duoban on 2022/12/29.
//
#import "SGYProgressView.h"
@interface SGYProgressView ()
@property (nonatomic, strong) CAShapeLayer *backgroundLayer; //
@property (nonatomic, strong) CAShapeLayer *frontFillLayer; //
@property (nonatomic, assign) CGFloat trackWidth; //
@property (nonatomic, assign) CGFloat width; //
@end
@implementation SGYProgressView
#pragma mark -- initialization
- (instancetype)initWithFrame:(CGRect)frame trackWidth:(CGFloat)trackWidth
{
if (self = [super initWithFrame:frame])
{
_trackWidth = trackWidth;
_width = frame.size.width;
[self setupSubviews];
}
return self;
}
#pragma mark -- setupSubviews
- (void)setupSubviews
{
//
_backgroundLayer = [CAShapeLayer layer];
_backgroundLayer.fillColor = nil;
//
_frontFillLayer = [CAShapeLayer layer];
_frontFillLayer.fillColor = nil;
_frontFillLayer.lineCap = kCALineCapRound;
[self.layer addSublayer:_backgroundLayer];
[self.layer addSublayer:_frontFillLayer];
//
_frontFillLayer.strokeColor = [UIColor colorWithRed:218/255.0 green:165/255.0 blue:32/255.0 alpha:1.0].CGColor;
_backgroundLayer.strokeColor = [UIColor lightGrayColor].CGColor;
}
-(void)layoutSubviews {
[super layoutSubviews];
CGFloat width = self.width;
UIBezierPath *backgroundBezierPath = [UIBezierPath bezierPathWithArcCenter:CGPointMake(width/2.0f, width/2.0f) radius:(CGRectGetWidth(self.bounds)- self.trackWidth)/2.f startAngle:0 endAngle:M_PI*2
clockwise:YES];
_backgroundLayer.path = backgroundBezierPath.CGPath;
//线
_frontFillLayer.lineWidth = self.trackWidth;
_backgroundLayer.lineWidth = self.trackWidth;
}
#pragma mark -- setter
- (void)setProgressColor:(UIColor *)progressColor{
_progressColor = progressColor;
_frontFillLayer.strokeColor = progressColor.CGColor;
}
- (void)setProgressBgColor:(UIColor *)progressBgColor{
_progressBgColor = progressBgColor;
_backgroundLayer.strokeColor = progressBgColor.CGColor;
}
- (void)setProgress:(CGFloat)progress
{
[self setProgress:progress animated:NO startAngle:-M_PI_2 clockwise:NO];
}
- (void)setProgress:(CGFloat)progress animated:(BOOL)animated{
[self setProgress:progress animated:animated startAngle:-M_PI_2 clockwise:NO];
}
- (void)setProgress:(CGFloat)progress animated:(BOOL)animated startAngle:(CGFloat )startAngle clockwise:(BOOL)clockwise{
progress = MAX( MIN(progress, 1.0), 0.0);
_progress = progress;
CGFloat width = self.width;
CGFloat endAngle = startAngle + (clockwise?(2*M_PI)*progress:(-2*M_PI)*progress);
UIBezierPath *frontFillBezierPath = [UIBezierPath bezierPathWithArcCenter:CGPointMake(width/2.0f, width/2.0f) radius:(CGRectGetWidth(self.bounds)-self.trackWidth)/2.f startAngle:startAngle endAngle:endAngle clockwise:clockwise];
_frontFillLayer.path = frontFillBezierPath.CGPath;
if (animated) {
CABasicAnimation *basicAnimation=[CABasicAnimation animationWithKeyPath:@"strokeEnd"];
basicAnimation.duration = 0.75;//
basicAnimation.fromValue=[NSNumber numberWithInteger:0];
basicAnimation.toValue=[NSNumber numberWithInteger:1];
[_frontFillLayer addAnimation:basicAnimation forKey:@"strokeKey"];
}
}
@end