UIApplication(FWAdaptive)

@interface UIApplication (FWAdaptive)

/// 是否是调试模式
@property (class, nonatomic, assign, readonly) BOOL fw_isDebug NS_REFINED_FOR_SWIFT;

@end

Undocumented

  • 是否是调试模式

    Declaration

    Objective-C

    @property (class, nonatomic, readonly) BOOL fw_isDebug;

UIApplication+FWToolkit

  • 读取应用名称

    Declaration

    Objective-C

    @property (class, nonatomic, copy, readonly) NS_REFINED_FOR_SWIFT NSString *fw_appName;
  • 读取应用显示名称,未配置时读取名称

    Declaration

    Objective-C

    @property (class, nonatomic, copy, readonly) NS_REFINED_FOR_SWIFT NSString *fw_appDisplayName;
  • 读取应用主版本号,示例:1.0.0

    Declaration

    Objective-C

    @property (class, nonatomic, copy, readonly) NS_REFINED_FOR_SWIFT NSString *fw_appVersion;
  • 读取应用构建版本号,示例:1.0.0.1

    Declaration

    Objective-C

    @property (class, nonatomic, copy, readonly) NS_REFINED_FOR_SWIFT NSString *fw_appBuildVersion;
  • 读取应用唯一标识

    Declaration

    Objective-C

    @property (class, nonatomic, copy, readonly) NS_REFINED_FOR_SWIFT NSString *fw_appIdentifier;
  • 读取应用可执行程序名称

    Declaration

    Objective-C

    @property (class, nonatomic, copy, readonly) NS_REFINED_FOR_SWIFT NSString *fw_appExecutable;
  • 能否打开URL(NSString|NSURL),需配置对应URL SCHEME到Info.plist才能返回YES

    Declaration

    Objective-C

    + (BOOL)fw_canOpenURL:(nonnull id)url;
  • 打开URL,支持NSString|NSURL,即使未配置URL SCHEME,实际也能打开成功,只要调用时已打开过对应App

    Declaration

    Objective-C

    + (void)fw_openURL:(nonnull id)url;
  • 打开URL,支持NSString|NSURL,完成时回调,即使未配置URL SCHEME,实际也能打开成功,只要调用时已打开过对应App

    Declaration

    Objective-C

    + (void)fw_openURL:(nonnull id)url
        completionHandler:(nullable void (^)(BOOL))completion;
  • 打开通用链接URL,支持NSString|NSURL,完成时回调。如果是iOS10+通用链接且安装了App,打开并回调YES,否则回调NO

    Declaration

    Objective-C

    + (void)fw_openUniversalLinks:(nonnull id)url
                completionHandler:(nullable void (^)(BOOL))completion;
  • 判断URL是否是系统链接(如AppStore|电话|设置等),支持NSString|NSURL

    Declaration

    Objective-C

    + (BOOL)fw_isSystemURL:(nonnull id)url;
  • 判断URL是否HTTP链接,支持NSString|NSURL

    Declaration

    Objective-C

    + (BOOL)fw_isHttpURL:(nonnull id)url;
  • 判断URL是否是AppStore链接,支持NSString|NSURL

    Declaration

    Objective-C

    + (BOOL)fw_isAppStoreURL:(nonnull id)url;
  • 打开AppStore下载页

    Declaration

    Objective-C

    + (void)fw_openAppStore:(nonnull NSString *)appId
          completionHandler:(nullable void (^)(BOOL))completion;
  • 打开AppStore评价页

    Declaration

    Objective-C

    + (void)fw_openAppStoreReview:(nonnull NSString *)appId
                completionHandler:(nullable void (^)(BOOL))completion;
  • 打开应用内评价,有次数限制

    Declaration

    Objective-C

    + (void)fw_openAppReview;
  • 打开系统应用设置页

    Declaration

    Objective-C

    + (void)fw_openAppSettings:(nullable void (^)(BOOL))completion;
  • 打开系统邮件App

    Declaration

    Objective-C

    + (void)fw_openMailApp:(nonnull NSString *)email
         completionHandler:(nullable void (^)(BOOL))completion;
  • 打开系统短信App

    Declaration

    Objective-C

    + (void)fw_openMessageApp:(nonnull NSString *)phone
            completionHandler:(nullable void (^)(BOOL))completion;
  • 打开系统电话App

    Declaration

    Objective-C

    + (void)fw_openPhoneApp:(nonnull NSString *)phone
          completionHandler:(nullable void (^)(BOOL))completion;
  • 打开系统分享

    Declaration

    Objective-C

    + (void)fw_openActivityItems:(nonnull NSArray *)activityItems
                   excludedTypes:(nullable NSArray<UIActivityType> *)excludedTypes;
  • 打开内部浏览器,支持NSString|NSURL

    Declaration

    Objective-C

    + (void)fw_openSafariController:(nonnull id)url;
  • 打开内部浏览器,支持NSString|NSURL,点击完成时回调

    Declaration

    Objective-C

    + (void)fw_openSafariController:(nonnull id)url
                  completionHandler:(nullable void (^)(void))completion;
  • 打开短信控制器,完成时回调

    Declaration

    Objective-C

    + (void)fw_openMessageController:
                (nonnull MFMessageComposeViewController *)controller
                   completionHandler:(nullable void (^)(BOOL))completion;
  • 打开邮件控制器,完成时回调

    Declaration

    Objective-C

    + (void)fw_openMailController:(nonnull MFMailComposeViewController *)controller
                completionHandler:(nullable void (^)(BOOL))completion;
  • 打开Store控制器,完成时回调

    Declaration

    Objective-C

    + (void)fw_openStoreController:
                (nonnull NSDictionary<NSString *, id> *)parameters
                 completionHandler:(nullable void (^)(BOOL))completion;
  • 打开视频播放器,支持AVPlayerItem|NSURL|NSString

    Declaration

    Objective-C

    + (nullable AVPlayerViewController *)fw_openVideoPlayer:(nonnull id)url;
  • 打开音频播放器,支持NSURL|NSString

    Declaration

    Objective-C

    + (nullable AVAudioPlayer *)fw_openAudioPlayer:(nonnull id)url;

App

  • Undocumented

    Declaration

    Objective-C

    + (nullable id)fw_appInfo:(NSString *)key NS_REFINED_FOR_SWIFT;

Debug

  • Undocumented

    Declaration

    Objective-C

    @property (class, nonatomic, readonly) BOOL fw_isPirated
  • Undocumented

    Declaration

    Objective-C

    @property (class, nonatomic, readonly) BOOL fw_isTestflight

URL

  • Undocumented

    Declaration

    Objective-C

    + (SystemSoundID)fw_playAlert:(NSString *)file NS_REFINED_FOR_SWIFT;
  • Undocumented

    Declaration

    Objective-C

    + (void)fw_stopAlert:(SystemSoundID)soundId NS_REFINED_FOR_SWIFT;
  • Undocumented

    Declaration

    Objective-C

    + (void)fw_playVibrate NS_REFINED_FOR_SWIFT;
  • Undocumented

    Declaration

    Objective-C

    + (void)fw_readText:(NSString *)text withLanguage:(nullable NSString *)languageCode NS_REFINED_FOR_SWIFT;

UIApplication+OcrObject

  • 识别图片文字,可设置语言(zh-CN,en-US)等,完成时主线程回调结果

    Declaration

    Swift

    @available(iOS 13.0, *)
    @objc(fw_recognizeText:configuration:completion:)
    public static func __fw_recognizeText(in image: CGImage, configuration: ((VNRecognizeTextRequest) -> Void)?, completion: @escaping ([OcrObject]) -> Void)