- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context{
NSLog(@"____%@",change);
[selfanimationForNumber:[[change valueForKey:@"old"] intValue] newValue:[[change valueForKey:@"new"] intValue]];
}
- (void)animationForNumber:(int)oldValue newValue:(int)newValue{
int oldNum2 = (oldValue / 10) % 10;
int newNum1 = newValue % 10;
int newNum2 = (newValue / 10) % 10;
if (newValue > oldValue || newValue < oldValue) {
NSString *direction = newValue > oldValue ? kCATransitionFromTop : kCATransitionFromBottom;
self.labelSecondNumber.text = [NSString stringWithFormat:@"%d",newNum1];
[UIViewanimationPush:self.labelSecondNumberdirection:direction duration:0.0];
if (oldNum2 != newNum2) {
self.labelFirstNumber.text = [NSString stringWithFormat:@"%d",newNum2];
[UIView animationPush:self.labelFirstNumber direction:direction duration:0.0];
// [UIView animationFlip:self.labelFirstNumber direction:direction]; //这里是不同的动画效果。
}
}
}
- (void)viewDidLoad
{
[superviewDidLoad];
self.view.backgroundColor = [UIColorcolorWithRed:38.0/255.0green:38.0/255.0blue:40.0/255.0alpha:1];
self.date.textColor = [UIColorcolorWithRed:92.0/255.0green:98.0/255.0blue:101.0/255.0alpha:1];
[[NSNotificationCenterdefaultCenter]addObserver:selfselector:@selector(countDown:) name:@"countDown"object:nil];
[self.circularSlideraddTarget:selfaction:@selector(updateProgress:) forControlEvents:UIControlEventValueChanged];
[self.circularSlidersetMinimumValue:0];
[self.circularSlidersetMaximumValue:360];
if (mIsiP5) {
self.statusView.frame = (CGRect){120,170,80,18};
}
}
- (IBAction)updateProgress:(UISlider *)sender {
int value = (75 * (sender.value/360));
NSLog(@"_______%d",value);
[self.circularSlider setValue:sender.value];
[self.numberView setValue:value];
}
相关推荐
+ (UIView *_Nullable)az_gradientViewWithColors:(NSArray*> *_Nullable)colors locations:(NSArray*> *_Nullable)locations startPoint:(CGPoint)startPoint endPoint:(CGPoint)endPoint; - (void)az_...
iOS中对UIView类的扩展,可以方便的获取到控件的各种尺寸。
这是一个ios动画开发的demo(请在github上获取最新代码),内容有 -uiview动画 -CoreAnimation基本动画 -关键帧动画 -TransferAnimation 文章对应的开发说明 ...
自定义NSLayoutConstraint约束库
iOS仅使用UIView+Animation做出来的一个精美的动画效果,简单好玩,核心代码就一两行,封装了一个工具类,可以在任何UIView上无差别使用,简单直接。
uiview+frame,方便UI布局,码农工具,第一次上传,测下好用不
ios中关于uiview
@interface UIView (BorderLine) /** 增加边框 @param borderWidth 边框宽度 @param borderColor 边框颜色 @param cornerRadius 边框圆角 */ - (void)addBorderLineWithBorderWidth:(CGFloat)borderWidth ...
基于UIView扩展的类目,用于设置上下左右圆角,可设置单边圆角,也可设置为圆形 github地址:https://github.com/LQQZYY/UIViewCornerDemo 喜欢的话就给颗星支持一下,感谢!
方便大家计算视图的高度,宽度,上下左右坐标,简化代码操作,更加直观
iOS 中对UIView简单的封装,换个说法:运用帧动画封装了一个HUD,使用起来简单方便,只需要调用 [RKJAnimatingHUD RKJStarAnimatingForView:self];或者 [RKJAnimatingHUD RKJStopAnimatingForView:self];一个类方法...
Objective-C 获取屏幕宽高、左右距离等得工具类
iOS中UIView的翻页动画demo 有几个是私有的api,小心使用。
以前在网上下了个时间选择器Demo,由于封装成UIActionSheet类型,而ios8弃用了UIActionSheet和UIAlertView,不得不对代码进行修改。将封装的UIActionSheet改为UIView,为了多态初始化时添加了枚举(几个时间选择器...
直接调用方法,不用手动添加手势(点击、长按),设置不规则圆角,autolayout
为UIView添加圆角扩展
UIView-Positioning, 在UIView对象中,基于简单属性的框架属性设置 uiview定位收费 UIView Positioning 是一个快速扩展,它提供简单的shorthand 方法,以方便的方式定义任何UIView对象的框架属性( 宽度,高度,x,y ...
一个在iOS中检测UIView (UIView的曝光)印象事件的工具。SwiftUI支持.zip
自己写了一个Dome 实现了UIView或者时UIViewController 缩放动画效果