BeeKit 0.0.11

BeeKit 0.0.11

Maintained by Chenfeng.



BeeKit 0.0.11

  • By
  • yaochenfeng

BeeKit

A Kit for iOS developer.

Travis CI Status Swift 5.0 Version Platform Carthage Compatible SPM

Task

  • Add Carthage、CocoaPods、Swift Package Manager support
  • Add Router for Controller
  • Create documentation

Usage

Router

get object for url

URLRouter.shared.objectFor(type: UIViewController.Type, url: <#T##URL?#>)

show controller for url

URLRouter.shared.open(<#T##url: URL?##URL?#>, source: UIViewController.bee.topVisibleViewController(), options: <#T##[String : Any]?#>)

URLRouterable

extension WebViewController: URLRouterableExact {
    /** optional
    var bee_router: String = "beelink://nativePage/webview"
    */
    static func initWith(req request: URLActionRequest) -> UIViewController? {
        return WebViewController(request.url)
    }
}

URLRouterSchemeAble

extension WebViewController: URLRouterableScheme {
    static var bee_scheme: String = "http,https"
    
    static func initWith(req request: URLActionRequest) -> UIViewController? {
        return WebViewController(request.url)
    }
}

Installation

CocoaPods

CocoaPods 1.8.4+ is recommand to build BeeKit.

To integrate SnapKit into your Xcode project using CocoaPods, specify it in your Podfile:

target '<Your Target Name>' do
  pod 'BeeKit'
end

Replace YOUR_TARGET_NAME and then run a pod install inside your terminal, or from CocoaPods.app.

Carthage

Add this to Cartfile

github "yaochenfeng/BeeKit"

Run carthage update to build the framework and drag the built BeeKit.framework into your Xcode project.

Carthage as a Static Library

Carthage defaults to building BeeKit as a Dynamic Library.

If you wish to build BeeKit as a Static Library using Carthage you may use the script below to manually modify the framework type before building with Carthage:

carthage update RxSwift --platform iOS --no-build
sed -i -e 's/MACH_O_TYPE = mh_dylib/MACH_O_TYPE = staticlib/g' Carthage/Checkouts/BeeKit/BeeKit.xcodeproj/project.pbxproj
carthage build BeeKit --platform iOS