首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏每日一篇技术文章

    SceneKit_入门06_行为动画

    )duration; + (SCNAction *)moveBy:(SCNVector3)delta duration:(NSTimeInterval)duration; b.移动到指定的位置 + (SCNAction *)moveTo:(SCNVector3)location duration:(NSTimeInterval)duration; 旋转 a.相对于当前位置旋转 + (SCNAction *)rotateByX:(CGFloat)xAngle y:(CGFloat)yAngle z:(CGFloat)zAngle duration:(NSTimeInterval)duration; + :(NSTimeInterval)sec; b.透明减小到0 + (SCNAction *)fadeOutWithDuration:(NSTimeInterval)sec; c.透明度逐渐递增 + (SCNAction )sec; b.等待随机时间 + (SCNAction *)waitForDuration:(NSTimeInterval)sec withRange:(NSTimeInterval)durationRange

    1.6K10发布于 2018-09-14
  • 来自专栏ShaoYL

    NSTimer类的使用

    + scheduledTimerWithTimeInterval: invocation: repeats: + (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval + timerWithTimeInterval: invocation: repeats: + (NSTimer *)timerWithTimeInterval:(NSTimeInterval)ti invocation run]; 停止 Timer – invalidate Timer设置 – isValid – fireDate – setFireDate: – timeInterval – userInfo NSTimeInterval 类:是一个浮点数字,用来定义秒 例子: iphone为我们提供了一个很强大得时间定时器 NSTimer 他可以完成任何定时功能: 我们使用起来也很简单,只要记住三要素就可以,具体得三要素是:时间间隔NSTimeInterval 浮点型,事件代理 delegate和事件处理方法@selector();就可以用 + (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval)

    1K90发布于 2018-05-11
  • 来自专栏每日一篇技术文章

    SceneKit_中级06_场景的切换

    :(NSTimeInterval)sec; + (SKTransition *)fadeWithColor:(SKColor *)color duration:(NSTimeInterval)sec; :(NSTimeInterval)sec; + (SKTransition *)revealWithDirection:(SKTransitionDirection)direction duration NSTimeInterval)sec; + (SKTransition *)doorsOpenHorizontalWithDuration:(NSTimeInterval)sec; + (SKTransition :(NSTimeInterval)sec; + (SKTransition *)doorsCloseVerticalWithDuration:(NSTimeInterval)sec; + (SKTransition *)doorwayWithDuration:(NSTimeInterval)sec; 动画效果还挺多的,就不一一演示了,我在使用这个方法的时候,遇到了一个大坑。

    1.1K10编辑于 2022-05-13
  • 来自专栏iOS开发攻城狮的集散地

    iOS 获取gif图片循环次数和时长

    //获取gif图片的总时长和循环次数 - (NSTimeInterval)durationForGifData:(NSData *)data{ //将GIF图片转换成对应的图片源 CGImageSourceRef CGImageSourceGetCount(gifSource); //定义数组存储拆分出来的图片 NSMutableArray* frames = [[NSMutableArray alloc] init]; NSTimeInterval UIImage imageWithCGImage:imageRef]; //将图片加入数组中 [frames addObject:imageName]; NSTimeInterval 每一帧时间间隔.png //获取GIF图片每帧的时长 - (NSTimeInterval)gifImageDeleyTime:(CGImageSourceRef)imageSource index:( NSInteger)index { NSTimeInterval duration = 0; CFDictionaryRef imageProperties = CGImageSourceCopyPropertiesAtIndex

    4.1K80发布于 2018-05-22
  • 来自专栏iOS小生活

    自定义一个浮层弹窗视图

    UIView动画 @interface UIView(UIViewAnimationWithBlocks) + (void)animateWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay options:(UIViewAnimationOptions)options animations:(void (^)(void))animations (void (^ __nullable)(BOOL finished))completion NS_AVAILABLE_IOS(4_0); + (void)animateWithDuration:(NSTimeInterval )duration delay:(NSTimeInterval)delay usingSpringWithDamping:(CGFloat)dampingRatio initialSpringVelocity )duration delay:(NSTimeInterval)delay options:(UIViewKeyframeAnimationOptions)options animations:(void

    1.8K30发布于 2019-08-12
  • 来自专栏一“技”之长

    iOS NSTimer 定时器用法总结 原

    尤其是小型游戏,然而对于初学者时常会注意不到其中的内存释放问题,将其基本用法总结如下: 一、初始化方法:有五种初始化方法,分别是 + (NSTimer *)timerWithTimeInterval:(NSTimeInterval :NSDefaultRunLoopMode];     //开始循环     [timer fire]; } + (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval  scheduledTimerWithTimeInterval:1 invocation:invo repeats:YES]; + (NSTimer *)timerWithTimeInterval:(NSTimeInterval self selector:@selector(myLog) userInfo:nil repeats:NO] + (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval @property NSTimeInterval tolerance; 这是7.0之后新增的一个属性,因为NSTimer并不完全精准,通过这个值设置误差范围。

    1.4K10发布于 2018-08-15
  • 来自专栏Guangdong Qi

    iOS 每天某些时间点做某些事情

    没有必要啊,这就是考验我们对时间的操作,代码实现如下: 代码实现 #pragma mark -- 判断是否弹出广告 - (BOOL)isLoadAdvertIn { //当前时间戳 NSTimeInterval interval = [[NSDate date] timeIntervalSince1970]; NSTimeInterval time00 = [GDDateUtil setCurrentlyDaySetHour :00 setMinute:00 setSec:00];//当前天00点的时间戳 NSTimeInterval time12 = [GDDateUtil setCurrentlyDaySetHour :12 setMinute:00 setSec:00];//当前天12点的时间戳 NSTimeInterval time14 = [GDDateUtil setCurrentlyDaySetHour :14 setMinute:00 setSec:00];//当前天14点的时间戳 NSTimeInterval time24 = [GDDateUtil setCurrentlyDaySetHour

    1.1K60发布于 2018-05-24
  • 来自专栏一“技”之长

    iOS网络编程之四——请求类NSURLRequest使用详解

    instancetype)requestWithURL:(NSURL *)URL cachePolicy:(NSURLRequestCachePolicy)cachePolicy timeoutInterval:(NSTimeInterval instancetype)initWithURL:(NSURL *)URL cachePolicy:(NSURLRequestCachePolicy)cachePolicy timeoutInterval:(NSTimeInterval */ @property (readonly) NSURLRequestCachePolicy cachePolicy; //只读属性 获取请求的超时时限 @property (readonly) NSTimeInterval nullable, copy) NSURL *URL; //设置请求的缓存策略 @property NSURLRequestCachePolicy cachePolicy; //设置超时时间 @property NSTimeInterval

    1.6K20发布于 2018-08-15
  • 来自专栏一“技”之长

    iOS动画开发之一——UIViewAnimation动画的使用

    二、UIView动画的几个方法 + (void)animateWithDuration:(NSTimeInterval)duration animations:(void (^)(void))animations UIView animateWithDuration:1 animations:^{         _myView.alpha=0;     }]; + (void)animateWithDuration:(NSTimeInterval         if (finished) {             _myView.alpha=1;         }     }]; + (void)animateWithDuration:(NSTimeInterval )duration delay:(NSTimeInterval)delay options:(UIViewAnimationOptions)options animations:(void (^)(void + (void)animateWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay usingSpringWithDamping

    1.8K30发布于 2018-08-16
  • 来自专栏iOS开发攻城狮的集散地

    iOS屏幕旋转

    )willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval willAnimateFirstHalfOfRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval willAnimateSecondHalfOfRotationFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation duration:(NSTimeInterval 视图旋转之前自动调用 -(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval

    2.2K60发布于 2018-05-22
  • 来自专栏陈满iOS

    iOS开发·NSDate日期基本操作方法

    从现在开始的24小时 NSTimeInterval secondsPerDay = 24*60*60; NSDate *tomorrow = [NSDate dateWithTimeIntervalSinceNow 根据已有日期创建日期 NSTimeInterval secondsPerDay1 = 24*60*60; NSDate *now = [NSDate date]; NSDate 两个日期之间相隔多少秒 NSTimeInterval secondsBetweenDates= [yesterDay timeIntervalSinceDate:now]; NSLog(

    1.3K10发布于 2018-09-10
  • 来自专栏好派笔记

    NSDate 的一些操作

    创建当前时间 NSDate *date = [NSDate date]; 从现在开始的24小时 NSTimeInterval a_day = 24*60*60; NSDate *tomorrow = [NSDate dateWithTimeIntervalSinceNow:a_day]; 根据已有日期创建日期 NSTimeInterval a_day = 24*60 laterDate = [tomorrow laterDate:date]; NSLog(@"laterDate = %@",laterDate); //两个日期之间相隔多少秒 NSTimeInterval

    64200发布于 2021-10-31
  • 来自专栏代码伴一生

    NSDate 的一些操作

    创建当前时间 NSDate *date = [NSDate date]; 从现在开始的24小时 NSTimeInterval a_day = 24*60*60; NSDate *tomorrow = [NSDate dateWithTimeIntervalSinceNow:a_day]; 根据已有日期创建日期 NSTimeInterval a_day = 24*60 laterDate = [tomorrow laterDate:date]; NSLog(@"laterDate = %@",laterDate); //两个日期之间相隔多少秒 NSTimeInterval

    64000发布于 2021-09-22
  • 来自专栏日常技术分享

    ios 两个时间相差多少天多少小时多少分多少秒

    startDate =[date dateFromString:startTime]; NSDate *endDdate = [date dateFromString:endTime]; NSTimeInterval startInterval = [startDate timeIntervalSince1970]*1; NSTimeInterval endInterval = [endDdate timeIntervalSince1970 ]*1; NSTimeInterval value = endInterval - startInterval; // 天 int day = (int)value /

    2.9K20发布于 2018-09-13
  • 来自专栏APP自动化测试

    Objective-C三种定时器CADisplayLink / NSTimer / GCD的使用

    -- 下面说说NSTImer, 一样我们直接看头文件并用注释说明 @interface NSTimer : NSObject + (NSTimer *)timerWithTimeInterval:(NSTimeInterval 响应事件用的NSIvocation, 系统为自动帮你将timer添加到currentRunLoop中,defaultMode + (NSTimer *)timerWithTimeInterval:(NSTimeInterval PerformanceSelector, userInfo中可以用来传参数,需要手动添加到RunLoop中 + (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval userInfo可以用来传递参数, 系统会自动帮你将timer添加到currentRunLoop中, defaultMode + (NSTimer *)timerWithTimeInterval:(NSTimeInterval timeInterval;  //只读属性, 获取当前timer的触发间隔 @property NSTimeInterval tolerance NS_AVAILABLE(10_9, 7_0);

    3.3K31发布于 2019-10-15
  • 来自专栏一“技”之长

    iOS视频功能模块的开发 原

    MPMovieSourceTypeFile,     // 文件类型     MPMovieSourceTypeStreaming // 数据流 }; @property (nonatomic, readonly) NSTimeInterval duration; 视频文件的时长 @property (nonatomic, readonly) NSTimeInterval playableDuration; 缓存完成能够播放的时长 @property (nonatomic, readonly) CGSize naturalSize; 视频的原始大小 @property (nonatomic) NSTimeInterval initialPlaybackTime ; 播放器开始播放的时间 @property (nonatomic) NSTimeInterval endPlaybackTime; 播放器结束播放的时间 @property (nonatomic) BOOL play; //调用此方法进行视频播放的暂停操作 - (void)pause; //调用此方法停止视频播放 - (void)stop; //当前视频已播放的时间 @property(nonatomic) NSTimeInterval

    1.5K70发布于 2018-08-16
  • 来自专栏非典型技术宅

    简单放置一张图片,实现放大缩小旋转效果1 image和imageView的区别2 创建控件显示到view上的标准步骤3 CGRectOffset函数的含义4 小飞机-监听四个按钮的点击事件(代码)5

    setAnimationDuration:5]; 提交动画(真正开始做动画) [UIView commitAnimations]; 13 块动画 +(void)animateWithDuration:(NSTimeInterval void))animations completion:(void (^__nullable)(BOOL finished))completion; +(void)animateWithDuration:(NSTimeInterval )duration animations:(void (^)(void))animations; +(void)animateWithDuration:(NSTimeInterval)**duration ** delay:(NSTimeInterval)**delay** usingSpringWithDamping:(CGFloat)**dampingRatio** initialSpringVelocity

    1.4K30发布于 2018-06-28
  • 来自专栏一“技”之长

    iOS开发音频播放基础——AVAudioPlayer的应用

    - (BOOL)prepareToPlay; 开始播放音频 - (BOOL)play; 在一段时间间隔后播放 - (BOOL)playAtTime:(NSTimeInterval)time; 暂停播放, BOOL playing; 获取当前音频声道数 @property(readonly) NSUInteger numberOfChannels; 获取当前音频时长 @property(readonly) NSTimeInterval 设置播放速度,1为正常,0.5为一半速度,2.0为2倍速度 @property float rate; 设置当前播放的时间点 @property NSTimeInterval currentTime;

    2K20发布于 2018-08-16
  • 来自专栏一“技”之长

    iOS动画开发之三——UIView的转场切换 原

    两个方法: + (void)transitionWithView:(UIView *)view duration:(NSTimeInterval)duration options:(UIViewAnimationOptions + (void)transitionFromView:(UIView *)fromView toView:(UIView *)toView duration:(NSTimeInterval)duration

    1.3K10发布于 2018-08-16
  • 来自专栏关键帧Keyframe

    iOS 不用 libyuv 也能高效实现 RGB/YUV 数据转换丨音视频工业实战

    kCVPixelBufferLock_ReadOnly); CVPixelBufferLockBaseAddress(dstPixelBuffer, kCVPixelBufferLock_ReadOnly); NSTimeInterval width:CVPixelBufferGetHeight(srcPixelBuffer) height:CVPixelBufferGetWidth(srcPixelBuffer)]; NSTimeInterval dstPixelBuffer),CVPixelBufferGetHeight(srcPixelBuffer),CVPixelBufferGetWidth(srcPixelBuffer)); NSTimeInterval CVPixelBufferGetWidthOfPlane(srcPixelBuffer, 0), CVPixelBufferGetHeightOfPlane(srcPixelBuffer, 0)); NSTimeInterval CVPixelBufferGetWidthOfPlane(srcPixelBuffer, 0), CVPixelBufferGetHeightOfPlane(srcPixelBuffer, 0)); NSTimeInterval

    1.3K31编辑于 2023-11-09
领券