SBLApplication 0.0.2

SBLApplication 0.0.2

测试已测试
语言语言 SwiftSwift
许可 MIT
发布最后发布2017年3月
SwiftSwift 版本3.0
SPM支持 SPM

Takuya Otani 维护。




  • 作者:
  • Takuya Otani

SBLApplication

示例

要运行示例项目,请先克隆仓库,然后从 Example 目录中运行 pod install

要求

  • Swift 3
  • iOS9 或更高版

安装

SBLApplication 可以通过 CocoaPods 获得。要安装它,只需将以下行添加到您的 Podfile 中

pod "SBLApplication"

您还需要引入以下代码的 main.swift

import SBLApplication

UIApplicationMain(
  CommandLine.argc,
  UnsafeMutableRawPointer(CommandLine.unsafeArgv).bindMemory(to: UnsafeMutablePointer<Int8>.self,
                                                             capacity: Int(CommandLine.argc)),
  NSStringFromClass(SBLApplication.self),
  NSStringFromClass(AppDelegate.self) // it should be matched to your AppDelegate class
)

然后从您的 AppDelegate 中移除 @UIApplicationMain

要启用触摸指示器,您可能需要将 UIApplication 的实例强制转换为 SBLApplication

import UIKit
import SBLApplication

class AppDelegate: UIResponder {
  // ... snip ...
  func application(_ application: UIApplication,
                   didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    if let app = application as? SBLApplication {
      app.isShowingTouchIndicators = true
    }
    return true
  }
  // ... snip ...
}

版权

SBLApplication 由 Takuya Otani / SimpleBoxes 开发。

版权 © 2017 Takuya Otani

版权 © 2017 SerendipityNZ Ltd.

许可

SBLApplication 可在 MIT 许可下使用。有关更多信息,请参阅 LICENSE 文件。