Billie 
  • 首页
  • 归档
  • 分类
  • 标签
  • 关于
  •   
  •   

CoreMotion 陀螺仪

CoreMotion 陀螺仪#import <CoreMotion/CoreMotion.h> @property (nonatomic, strong)CMMotionManager * manager; - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after

2022-07-02
OC

CAAnimation 帧动画

CAAnimation 帧动画 CABasicAnimation通过设定起始点,终点,时间,动画会沿着你这设定点进行移动。可以看做特殊的CAKeyFrameAnimation CAKeyframeAnimationKeyframe顾名思义就是关键点的frame,你可以通过设定CALayer的始点、中间关键点、终点的frame,时间,动画会沿你设定的轨迹进行移动 CAAnimationGroupGr

2022-06-25
OC

iOS 设置时区、AM/PM 并实时显示当前时间

iOS 设置时区、AM/PM 并实时显示当前时间完整代码#import "ViewController.h" @interface ViewController () @property (nonatomic,strong) NSTimer *liveTimer; @property (nonatomic,strong) UILabel *liveBigLocalDateLa

2022-06-05
OC

通过屏幕刷新显示实时时间、倒计时

通过屏幕刷新显示实时时间、倒计时获取屏幕刷新率@property (nonatomic, strong) CADisplayLink *displayLink; - (void)viewDidLoad { [super viewDidLoad]; self.displayLink = [CADisplayLink displayLinkWithTarget:self se

2022-05-08
OC

ReactiveObjC 常用方法

ReactiveObjC 常用方法基本类型 RACSiganl 信号(类) RACSubscriber 订阅者(协议) RACDisposable 用于取消订阅或者清理资源,当信号发送完成或者发送错误的时候,就会自动触发它。 当你不想监听某个信号时,可以通过它主动取消订阅信号。 RACSubject 信号提供者,自己可以充当信号,又能发送信号。通常用来代替代理,有了它,就不必要定义代理了。 RAC

2022-05-03
OC

weakSelf 与 strongSelf

weakSelf 与 strongSelf 避免循环引用的标准做法:weakSelf+strongSelf 调试方法:打印引用计数来看是否 block 会使引用计数 +1 printf("retain count:%ld\n", CFGetRetainCount((__bridge CFTypeRef)(self))); 写法block 里面套 block - (void

2022-04-15
OC

APP 各种状态时发通知调用函数

APP 各种状态时发通知调用函数举例// 检测app从后台进入前台会的观察者 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationBecomeActive) name:UIApplicationWillEnterForegroundNotification object:nil];

2022-03-18
OC

各种延时操作

各种延时操作延时执行方法(可以取消执行)// 5s后执行某方法 NSString *toDoStr = @"play"; NSString *toDoStr2 = @"play02"; // 如果已经 perform 但还没执行,取消上次 perform,并重新计时 [NSObject cancelPreviousPerformRequestsWithTa

2022-03-02
OC

通过类名调用被分类覆盖的原方法

通过类名调用被分类覆盖的原方法在分类中重写方法后,会将原方法进行覆盖。若想继续执行原方法则可通过方法列表和方法指针找到原方法 - (void)viewDidLoad { [super viewDidLoad]; Class currentClass = [TestClass class]; TestClass *my = [[TestClass alloc] in

2022-01-17
OC

WCDB的基本使用

WCDB的基本使用WCDB是微信移动端团队开源的移动端数据库组件https://github.com/Tencent/wcdb pod 'WCDB' @interface ViewController () @property (nonatomic, strong)Message *BLMsg; @end - (void)viewDidLoad { self.B

2022-01-09
OC
1234…6

搜索

Hexo Fluid
总访问量 次 总访客数 人