Creative Technologist at Golin. Building PolitiCall, Candygrams and other apps on the side.
Highlights
- Pro
Pinned Loading
-
Simple square image (Swift)
Simple square image (Swift) 1//Use case: In a context where cropping an image view isn't a viable solution, this function takes an image expressed as binary data and crops it to a square. Quick and dirty.
2func correctImageDimension(data: Data) -> Data{
34guard let image = UIImage(data: data) else {return data}
5let width = image.size.width
Something went wrong, please refresh the page to try again.
If the problem persists, check the GitHub status page or contact support.
If the problem persists, check the GitHub status page or contact support.