雪花
来源:互联网 发布:js包含字符串 编辑:程序博客网 时间:2024/04/28 18:45
#import "RootView.h"
#import "UIColor+RandomColor.h"
@implementation RootView
- (instancetype)initWithFrame:(CGRect)frame
{
self =[super initWithFrame:frame];
if (self){
[self addSubviews];
}
returnself;
}
#pragma mark - 添加所有控件
- (void)addSubviews
{
self.backgroundColor = [UIColor cyanColor];
[NSTimerscheduledTimerWithTimeInterval:0.8 target:selfselector:@selector(dingshiqi1) userInfo:nil repeats:YES];
[NSTimerscheduledTimerWithTimeInterval:0.01 target:selfselector:@selector(dingshiqi) userInfo:nil repeats:YES];
}
#pragma mark - 下落定时器的实现
- (void)dingshiqi
{
for (int i =0; i < self.subviews.count; i++) {
CGRect frame = ((UIView *)self.subviews[i]).frame;
frame.origin.y++;
((UIView *)self.subviews[i]).frame = frame;
}
}
#pragma mark - 生成定时器的实现
- (void)dingshiqi1
{
UIView *view= [[UIView alloc] initWithFrame:CGRectMake(random() % 375, random()% 50 + 20, 10, 10)];
view.backgroundColor = [UIColor randomColor];
view.layer.cornerRadius = 5;
[selfaddSubview:view];
[viewrelease];
}
@end
#import "UIColor+RandomColor.h"
@implementation RootView
- (instancetype)initWithFrame:(CGRect)frame
{
}
#pragma mark - 添加所有控件
- (void)addSubviews
{
}
#pragma mark - 下落定时器的实现
- (void)dingshiqi
{
}
#pragma mark - 生成定时器的实现
- (void)dingshiqi1
{
}
@end
0 0
- 雪花
- 雪花
- 雪花
- 雪花
- 雪花
- 雪花
- 雪花
- 血色雪花
- js雪花
- 雪花模式
- 仿雪花
- 雪花飘
- 雪花模型
- 桌面雪花
- 雪花效果
- [SMOJ1814]雪花
- 雪花算法
- 雪花下落+雪花颜色随机+形状随机
- IOS开发概述-10.事件处理概述
- HDU 1016 java 已Ac
- 2040 亲和数
- 聊聊Web App、Hybrid App与Native App的设计差异
- 【智能硬件】Apple Watch交互开发基础
- 雪花
- Leetcode: Minimum Size Subarray Sum
- 架构学习资源
- 第二章 对象的创建和使用 笔记
- 好的程序员绝对是靠练出来的。
- 【bzoj1726】 Usaco2006 Nov Roadblocks第二短路 次短路模板
- 霓虹灯
- 计算机组成原理推荐
- MariaDB与MySQL的主从复制效率对比