Khala

@objcMembers
public class Khala : NSObject

Undocumented

  • Rewrite module

    Declaration

    Swift

    public static var rewrite: KhalaRewrite
  • Logs module

    Declaration

    Swift

    public static var history: KhalaHistory
  • url and params

    Declaration

    Swift

    public var urlValue: KhalaNode
  • init

    Declaration

    Swift

    public init(url: URL, params: [AnyHashable: Any] = [:])

    Parameters

    url

    URL

    params

    Use it when you need to pass NSObject/UIImage, etc.

  • init

    Declaration

    Swift

    public init?(str: String, params: [AnyHashable: Any] = [:])

    Parameters

    str

    String type URL

    params

    Use it when you need to pass NSObject/UIImage, etc.

  • Language

    • en: English
    • cn: Chinese(中文)
    See more

    Declaration

    Swift

    public enum Language : String
  • Whether to enable assertions, the default is enabled

    Declaration

    Swift

    public static var isEnabledAssert: Bool { get set }
  • Whether to enable the log, the default is not enabled

    Declaration

    Swift

    public static var isEnabledLog: Bool { get set }
  • assertions language

    Declaration

    Swift

    public static var language: Language { get set }
  • add PseudoClass to PseudoClass.cache

    You can also use PseudoClass.cache to achieve the same effect.

    Declaration

    Swift

    @discardableResult
    public func register() -> Bool

    Return Value

    whether registration is successful

  • remove PseudoClass from PseudoClass.cache

    You can also use PseudoClass.cache to achieve the same effect.

    Declaration

    Swift

    @discardableResult
    public func unregister() -> Bool

    Return Value

    Whether to successfully cancel the registration

  • remove all value with PseudoClass.cache

    You can also use PseudoClass.cache to achieve the same effect.

    Declaration

    Swift

    public class func unregisterAll()
  • call routing function

     let value = Khala(str: "kl://AModule/doSomething")?.call()
    

    Declaration

    Swift

    @discardableResult
    public func call() -> Any?

    Return Value

    Any?

  • call routing function with closure

     let value = Khala(str: "kl://AModule/doSomething")?.call(block: { (item) in
     item is [String: AnyHashable]
     })
    

    Declaration

    Swift

    @discardableResult
    public func call(block: @escaping KhalaClosure) -> Any?

    Parameters

    block

    KhalaClosure

    Return Value

    Any?

  • call routing function with closure

     let value = Khala(str: "kl://AModule/doSomething")?.call(blocks: [{ (item) in
     // 1 block
     }, { (item) in
     // 2 block
     }, { (item) in
     // 3 block
     }])
    

    Declaration

    Swift

    @discardableResult
    public func call(blocks: [KhalaClosure]) -> Any?

    Parameters

    blocks

    [KhalaClosure]

    Return Value

    Any?

  • call routing function with closure

     let value = Khala(str: "kl://AModule/doSomething")?.call(blocks: { (item) in
     // 1 block
     }, { (item) in
     // 2 block
     }, { (item) in
     // 3 block
     })
    

    Declaration

    Swift

    public func call(blocks: KhalaClosure...) -> Any?

    Parameters

    blocks

    [KhalaClosure]

    Return Value

    Any?

  • get viewController

    Declaration

    Swift

    @objc
    var viewController: UIViewController? { get }

    Return Value

    viewController

  • get view

    Declaration

    Swift

    @objc
    var view: UIView? { get }

    Return Value

    view

  • Declaration

    Swift

    public static let appDelegate: KhalaAppDelegate
  • Unified registration of classes that follow the Protocol protocol.

    Declaration

    Swift

    public static func regist(protocol: Protocol) -> [String]