UNPhoto
public struct UNPhoto
Holds all the information about a photo.
-
Unique identifier of the photo.
Declaration
Swift
public var id : String
-
Date the photo was created.
Declaration
Swift
public var creationDate : Date?
-
Date the photo was updated.
Declaration
Swift
public var updateDate : Date?
-
Width of the photo in pixels.
Declaration
Swift
public var width : Int
-
Height of the photo in pixels.
Declaration
Swift
public var height : Int
-
Representative color of the photo in hex value.
Declaration
Swift
public var hexColor : String
-
Number of likes the photo has.
Declaration
Swift
public var numberOfLikes : Int
-
Wheter the user liked their own photo or not.
Declaration
Swift
public var isLikedByUser : Bool
-
Description of the photo.
Declaration
Swift
public var description : String?
-
The user that owns the photo.
Declaration
Swift
public var user : UNUser
-
The collections the photo belongs to.
Declaration
Swift
public var collections : [UNCollection]
-
Catogories associated to the photo.
Declaration
Swift
public var categories : [UNCategory]
-
The UIColor object that represents the hex value received from Unsplash.
Declaration
Swift
public var color : UIColor
-
Size of the raw photo.
Declaration
Swift
public var size : CGSize
-
Creates a new instance by decoding from the given decoder.
Throws
If a value that is non-optional is missing the function will throw.Declaration
Swift
public init(from decoder: Decoder) throws
Parameters
decoder
Swift’s decoder.
-
Returns a Boolean value indicating whether two photos represent the same photo.
Discussion: Two photos are considered to be the same if they represent the same photo; that is, if they have the same id, regardless if the other variables are different.
Declaration
Swift
public static func ==(lhs: UNPhoto, rhs: UNPhoto) -> Bool
-
Returns a Boolean value indicating whether the two photos don’t represent the same photo.
Declaration
Swift
public static func !=(lhs: UNPhoto, rhs: UNPhoto) -> Bool
-
The computed hash value for the photo.
Declaration
Swift
public var hashValue: Int