Extensions
The following extensions are available globally.
-
This extension for the Bool type adds a convenient method, toInt(), allowing you to convert a boolean value to its integer representation. The function returns 1 for true and 0 for false. This extension is helpful in situations where you need to represent boolean values as integers, such as when working with APIs or databases that expect integer representations for boolean flags.
See moreDeclaration
Swift
public extension Bool
-
The Bundle extensions provide convenient properties to access information from the main bundle.
See moreDeclaration
Swift
public extension Bundle
-
This set of convenience initializers extends UIColor, providing easy ways to create color instances. The first initializer allows creating a color from a hexadecimal string representation with an optional alpha value. The second initializer creates a color from RGB values, and the third initializer adds the flexibility to specify a custom alpha value along with the RGB components. These initializers simplify the process of creating UIColor instances with various color representations.
See more -
These functions provide a variety of date manipulation and comparison operations in Swift. From converting dates to strings with specific formats, adding or subtracting months, days, weeks, or years, to calculating the time components between two dates and comparing dates using a custom enum. These functions offer versatile tools for working with dates in different scenarios.
See moreDeclaration
Swift
public extension Date
-
This bundle of extensions provides utility functions for converting between different numeric representations and obtaining string representations. The toDouble function converts an integer to a double, centsToDollars converts a dollar amount in cents to dollars, and toString converts any supported type to its string representation. These functions enhance the versatility of working with numeric and string data in Swift.
See moreDeclaration
Swift
public extension Int
-
This set of extensions provides a variety of utility functions for common conversions in Swift. It includes functions for converting between numeric types, temperature units, distance units, and power units, as well as formatting a value as a price with a specified currency symbol. The roundTo function allows for rounding a value to a specific number of decimal places and is a mutating function, modifying the value in place.
See moreDeclaration
Swift
public extension Double
-
This set of extensions provides a variety of functionality for string manipulation and validation in Swift. It includes properties for obtaining modified versions of the string, properties for converting the string to coordinate or URL representations, and functions for appending or deleting path components and extensions. Additionally, there are functions for string manipulation, such as checking for digit or alphanumeric content, adding prefixes, and validating email addresses and phone numbers.
See moreDeclaration
Swift
public extension String
-
These UIView extension functions provide additional customization options for the appearance of a view. ‘addCornerRadius’ allows you to set a corner radius for a view, ‘addBorderLine’ adds a customizable border line to a view, and ‘makeRounded’ quickly rounds the corners of a view. These functions are useful for enhancing the visual presentation of UI elements in a Swift application.
See more