Functions
The following functions are available globally.
-
Returns a Boolean value indicating whether the font names of two
UIFontProviderfont text styles are equal.Declaration
Swift
public func == (lhs: UIFontProvider?, rhs: UIFontProvider?) -> Bool -
Sets an associated value for a given object using a given key and association policy, whether it is a value type or a class.
Note
It uses the objc runtime through objc_setAssociatedObject, but wraps the value if it is a struct.
Warning
Using associated objects should be avoided, as they are used in runtime and not in compile time, and could lead to performance issues.
Seealso
Declaration
Swift
public func setAssociatedObject<T>(_ object: AnyObject, key: UnsafeRawPointer, value: T?, policy: objc_AssociationPolicy = .OBJC_ASSOCIATION_RETAIN)Parameters
objectThe source object for the association.
valueThe value to associate with the key for object.
keyThe key for the association.
policyThe policy for the association.
-
Returns the value associated with a given object for a given key, whether it is a value type or a class.
Note
It uses the objc runtime through objc_setAssociatedObject, but wraps the object if it is a struct.Warning
Using associated objects should be avoided, as they are used in runtime and not in compile time, and could lead to performance issues.Seealso
objc_getAssociatedObject.Declaration
Swift
public func getAssociatedObject<T>(_ object: AnyObject, key: UnsafeRawPointer) -> T?Parameters
objectThe source object for the association.
keyThe key for the association.
Return Value
The value associated with the key key for object.
-
Returns the type’s simple name. That is to say: without scope prefixes, without properties’ values if it’s a struct.
Declaration
Swift
public func SimpleName(ofType type: Any.Type) -> String -
Returns the concrete type’s simple name. That is to say: without scope prefixes, without properties’ values if it’s a struct.
Seealso
type(of:)Declaration
Swift
public func SimpleName<T>(of element: T) -> String -
Returns the concatenation of the given NSAttributedStrings
Declaration
Swift
public func + (left: NSAttributedString, right: NSAttributedString) -> NSAttributedString -
Convenience method to grab the main thread and perform closure
For more information on why do we need to use this see: https://medium.com/@johnsundell/reducing-flakiness-in-swift-tests-5942e5677394
Declaration
Swift
func performUIUpdate(using closure: @escaping () -> Void)Parameters
closurethe closure to execute
-
Appends a path component to the string, similar to web resource addressing.
Seealso
appendingPathComponentfrom NSString.Declaration
Swift
public func / (basePath: String, pathComponent: PathAppendable) -> StringParameters
basePathbase string.
pathComponentPathAppendable that will be appended.
Return Value
The new String, with pathComponent appended to basePath.
-
Appends a path component to a URL.
Declaration
Swift
public func / (baseURL: URL, pathComponent: PathAppendable) -> URLParameters
baseURLbase URL.
pathComponentPathAppendable that will be appended.
Return Value
The new URL, with pathComponent appended to baseURL
Functions Reference