From 5fede953958ff46f2fee01361e87a0e0c5e9a3ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20B=C3=B8dskov?= Date: Tue, 3 Oct 2017 14:33:50 +0200 Subject: [PATCH] adds autoresizing mask to ImageView it was not centered correctly on iPhone 5 and iPhone plus devices --- .gitignore | 3 ++- Spinner/Spinner.swift | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 5e5d5ce..869744d 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,7 @@ xcuserdata *.moved-aside *.xcuserstate *.xcscmblueprint +.DS_Store ## Obj-C/Swift specific *.hmap @@ -54,7 +55,7 @@ Carthage/Build # fastlane # -# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the +# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the # screenshots whenever they are needed. # For more information about the recommended setup visit: # https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md diff --git a/Spinner/Spinner.swift b/Spinner/Spinner.swift index 6b3ee79..a877fb7 100644 --- a/Spinner/Spinner.swift +++ b/Spinner/Spinner.swift @@ -170,6 +170,7 @@ public extension SpinnerView { if let image = animationImage { let imageView = UIImageView(frame: view.bounds) imageView.contentMode = .center + imageView.autoresizingMask = [.flexibleTopMargin, .flexibleLeftMargin, .flexibleRightMargin, .flexibleBottomMargin] imageView.animationDuration = image.animationDuration imageView.animationImages = image.animationImages imageView.startAnimating()