UIViewController(FWUIKit)

@interface UIViewController (FWUIKit)

/// 判断当前控制器是否是根控制器。如果是导航栏的第一个控制器或者不含有导航栏,则返回YES
@property (nonatomic, assign, readonly) BOOL fw_isRoot NS_REFINED_FOR_SWIFT;

/// 判断当前控制器是否是子控制器。如果父控制器存在,且不是导航栏或标签栏控制器,则返回YES
@property (nonatomic, assign, readonly) BOOL fw_isChild NS_REFINED_FOR_SWIFT;

/// 判断当前控制器是否是present弹出。如果是导航栏的第一个控制器且导航栏是present弹出,也返回YES
@property (nonatomic, assign, readonly) BOOL fw_isPresented NS_REFINED_FOR_SWIFT;

/// 判断当前控制器是否是iOS13+默认pageSheet弹出样式。该样式下导航栏高度等与默认样式不同
@property (nonatomic, assign, readonly) BOOL fw_isPageSheet NS_REFINED_FOR_SWIFT;

/// 视图是否可见,viewWillAppear后为YES,viewDidDisappear后为NO
@property (nonatomic, assign, readonly) BOOL fw_isViewVisible NS_REFINED_FOR_SWIFT;

/// 是否已经加载完,默认NO,加载完成后可标记为YES,可用于第一次加载时显示loading等判断
@property (nonatomic, assign) BOOL fw_isLoaded NS_REFINED_FOR_SWIFT;

@end

Undocumented

  • 判断当前控制器是否是根控制器。如果是导航栏的第一个控制器或者不含有导航栏,则返回YES

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL fw_isRoot;
  • 判断当前控制器是否是子控制器。如果父控制器存在,且不是导航栏或标签栏控制器,则返回YES

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL fw_isChild;
  • 判断当前控制器是否是present弹出。如果是导航栏的第一个控制器且导航栏是present弹出,也返回YES

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL fw_isPresented;
  • 判断当前控制器是否是iOS13+默认pageSheet弹出样式。该样式下导航栏高度等与默认样式不同

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL fw_isPageSheet;
  • 视图是否可见,viewWillAppear后为YES,viewDidDisappear后为NO

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL fw_isViewVisible;
  • 是否已经加载完,默认NO,加载完成后可标记为YES,可用于第一次加载时显示loading等判断

    Declaration

    Objective-C

    @property (nonatomic) BOOL fw_isLoaded;