AI-generated Key Takeaways
-
FetchPhotoRequestis a struct used to request a photo for a specific place, along with its properties. -
It initializes with a
Photoobject and amaxSizeof typeCGSizeto define the desired photo dimensions. -
The returned photo will either be the original if smaller than
maxSizeor scaled down while maintaining aspect ratio. -
maxSizeheight and width must be within the range of 1 to 4800, otherwise, the request will result in an error.
FetchPhotoRequest
struct FetchPhotoRequestextension FetchPhotoRequest : SendableThe request for a specific placeID and place properties to include in the Place response.
-
Request object to use with
PlacesClientto fetch a photo.If the image is smaller than the values specified, the original image will be returned. If the image is larger in either dimension, it will be scaled to match the smaller of the two dimensions, restricted to its original aspect ratio. CGSize height and width should be set to an integer between 1 and 4800. If not, the
PlacesClientrequest callback will return an error.Declaration
Swift
init(photo: Photo, maxSize: CGSize)Parameters
photoThe
Phototo request.maxSizeThe maximum desired size in pixels of the image returned by the Place Photos service.