FWTask


@interface FWTask : NSOperation

任务基类

  • 错误信息

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) NSError *error;
  • 子类重写,任务执行完成,需调用finishWithError:

    Declaration

    Objective-C

    - (void)executeTask;
  • 标记任务完成,error为空表示任务成功

    Declaration

    Objective-C

    - (void)finishWithError:(nullable NSError *)error;
  • 是否需要主线程执行,会阻碍UI渲染,默认NO

    Declaration

    Objective-C

    - (BOOL)needMainThread;