DTBKitStaticWrapper
public struct DTBKitStaticWrapper<T>
Mainly static wrapper.
静态方法容器。
-
Undocumented
Declaration
Swift
public init()
-
Will enumerator main path.
在 main bundle 下的全路径中搜索并创建 bundle.
Declaration
Swift
public func create(_ name: String, cacheable: Bool = true) -> Bundle?
Parameters
name
bundle name.
cacheable
use
bundleIdentifier
to cache.Return Value
Bundle
-
Declaration
Swift
public func clear<Value>(_ key: DTB.ConstKey<Value>)
-
Declaration
Swift
public var fixed: NumberFormatter { get }
-
Declaration
Swift
public var multi: NumberFormatter { get }
-
Declaration
Swift
public var CNY: NumberFormatter { get }
-
Declaration
Swift
public var RMB: NumberFormatter { get }
-
Darkable hex color
sample: 0xFF8534 -> UIColor
Declaration
Swift
public func hex(_ def: Int64, alpha: CGFloat = 1.0, dark: Int64? = nil, darkAlpha: CGFloat? = nil) -> UIColor
-
Create resource image by name.
Proj.xcassets
- same as
UIImage(named:)
- same as
Proj.main
- when you put image in main proj source code
Proj.main/*.bundle/*.*
- when you put bundle in main proj source code
Proj.main/*.bundle/*.{xcassets, car}/*.*
- when you use
*.xcassets
in custom bundle
- when you use
Proj.{SPM, Pods, framework, ...}/
- when your code is third part
Declaration
Swift
public func create(_ imageName: String?, bundle: Bundle? = nil) -> UIImage?
Parameters
imageName
imageName description
bundle
bundle description
Return Value
description
-
Recursion get the top most view controller.
递归取栈顶。
Declaration
Swift
public func topMost() -> UIViewController?
-
Try pop / dismiss / remove top most view controller
依次尝试各种方法去移除
topMost
,在诸如WKWebView
内部的场景下可能会用到。Declaration
Swift
@discardableResult public func popAnyway(animated: Bool = true) -> Bool
Return Value
success == true
-
Declaration
Swift
@available(iOS 13.0, *) public func current() -> DTBKitWrapper<UIWindowScene>?
-
Declaration
Swift
public func keyWindow() -> DTBKitWrapper<UIWindow>?
-
WGS-84 –> GCJ-02
Declaration
Swift
public func getGCJFromWGS(_ p: CLLocationCoordinate2D) -> CLLocationCoordinate2D
-
GCJ-02 –> WGS-84
Declaration
Swift
public func getWGSFromGCJ(_ p: CLLocationCoordinate2D) -> CLLocationCoordinate2D
-
GCJ –> Baidu
Declaration
Swift
public func getBDFromGCJ(_ p: CLLocationCoordinate2D) -> CLLocationCoordinate2D
-
Baidu –> GCJ
Declaration
Swift
public func getGCJFromBD(_ p: CLLocationCoordinate2D) -> CLLocationCoordinate2D
-
WGS –> Baidu
Declaration
Swift
public func getBDFromWGS(_ p: CLLocationCoordinate2D) -> CLLocationCoordinate2D
-
Baidu –> WGS
Declaration
Swift
public func getWGSFromBD(_ p: CLLocationCoordinate2D) -> CLLocationCoordinate2D
-
不在中国区域内 (估算)
Declaration
Swift
public func notInChina(_ p: CLLocationCoordinate2D) -> Bool
-
获取两点之间的距离 (米)
Declaration
Swift
public func distanceBetween(p1: CLLocationCoordinate2D, p2: CLLocationCoordinate2D) -> CLLocationDistance