ImageAlignment
struct ImageAlignment
extension ImageAlignment : Equatable, ExpressibleByArrayLiteral, OptionSet, RawRepresentable, SetAlgebra
Image alignment provides a simple method to set the positioning of the UIImage in the UIImageView.
-
The raw type that can be used to represent all values of the conforming type.
Every distinct value of the conforming type has a corresponding unique value of the
RawValue
type, but there may be values of theRawValue
type that don’t have a corresponding value of the conforming type.Declaration
Swift
typealias RawValue = Int
-
All values for ImageAlignment option set.
Declaration
Swift
static let all: [ImageAlignment]
-
Aligns the image to the bottom side, if column this is on the bottom side, if column reversed this is on on the top side.
Declaration
Swift
static let bottom: ImageAlignment
-
Centers the image vertically and horizontally
Declaration
Swift
static let center: ImageAlignment
-
Horizontally centers the image.
Declaration
Swift
static let centerX: ImageAlignment
-
Vertically centers the image.
Declaration
Swift
static let centerY: ImageAlignment
-
Aligns the image to the ending side, if LTR this is on the right side, if RTL this is on the left side.
Declaration
Swift
static let end: ImageAlignment
-
Creates a new option set from the given raw value.
This initializer always succeeds, even if the value passed as
rawValue
exceeds the static properties declared as part of the option set. This example creates an instance ofShippingOptions
with a raw value beyond the highest element, with a bit mask that effectively contains all the declared static members.let extraOptions = ShippingOptions(rawValue: 255) print(extraOptions.isStrictSuperset(of: .all)) // Prints "true"
Declaration
Swift
init(rawValue: ImageAlignment.RawValue)
-
The corresponding value of the raw type.
A new instance initialized with
rawValue
will be equivalent to this instance. For example:enum PaperSize: String { case A4, A5, Letter, Legal } let selectedSize = PaperSize.Letter print(selectedSize.rawValue) // Prints "Letter" print(selectedSize == PaperSize(rawValue: selectedSize.rawValue)!) // Prints "true"
Declaration
Swift
let rawValue: ImageAlignment.RawValue
-
Aligns the image to the starting side, if LTR this is on the left side, if RTL this is on the right side.
Declaration
Swift
static let start: ImageAlignment
-
Aligns the image to the top side, if column this is on the top side, if column reversed this is on the bottom side.
Declaration
Swift
static let top: ImageAlignment