diff --git a/Example/ViewController.swift b/Example/ViewController.swift index ccdc911..4832a69 100644 --- a/Example/ViewController.swift +++ b/Example/ViewController.swift @@ -89,6 +89,8 @@ private extension UIView.ContentMode { return "bottomLeft" case .bottomRight: return "bottomRight" + @unknown default: + fatalError("Unknown contentMode") } } } diff --git a/ImageViewer/AnimatableImageView.swift b/ImageViewer/AnimatableImageView.swift index 26901ca..1fd7e25 100644 --- a/ImageViewer/AnimatableImageView.swift +++ b/ImageViewer/AnimatableImageView.swift @@ -74,6 +74,8 @@ private extension AnimatableImageView { case .bottomRight: imageView.bounds = Utilities.rect(forSize: image.size) imageView.center = Utilities.bottomRight(forSize: image.size, insideSize: bounds.size) + @unknown default: + fatalError("Unkown content mode") } } } diff --git a/ImageViewer/ImageViewerController.swift b/ImageViewer/ImageViewerController.swift index 9634125..f07afe1 100644 --- a/ImageViewer/ImageViewerController.swift +++ b/ImageViewer/ImageViewerController.swift @@ -5,6 +5,12 @@ public final class ImageViewerController: UIViewController { @IBOutlet fileprivate var scrollView: UIScrollView! @IBOutlet fileprivate var imageView: UIImageView! @IBOutlet fileprivate var activityIndicator: UIActivityIndicatorView! + @IBOutlet fileprivate var closeButton: UIButton! { + didSet { + let closeImage = UIImage(named: "closeButton", in: Bundle.module, compatibleWith: nil) + closeButton.setImage(closeImage, for: .normal) + } + } fileprivate var transitionHandler: ImageViewerTransitioningHandler? fileprivate let configuration: ImageViewerConfiguration? @@ -15,7 +21,7 @@ public final class ImageViewerController: UIViewController { public init(configuration: ImageViewerConfiguration?) { self.configuration = configuration - super.init(nibName: String(describing: type(of: self)), bundle: Bundle(for: type(of: self))) + super.init(nibName: "ImageViewerController", bundle: .module) modalPresentationStyle = .overFullScreen modalTransitionStyle = .crossDissolve diff --git a/ImageViewer/Info.plist b/ImageViewer/Info.plist index a246732..fd3e559 100644 --- a/ImageViewer/Info.plist +++ b/ImageViewer/Info.plist @@ -4,6 +4,8 @@ CFBundleDevelopmentRegion en + CFBundleDisplayName + SimpleImageViewer CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier @@ -17,7 +19,7 @@ CFBundleShortVersionString 1.1.1 CFBundleVersion - $(CURRENT_PROJECT_VERSION) + 1 NSPrincipalClass UILaunchStoryboardName diff --git a/ImageViewer/Resources/ImageViewerController.xib b/ImageViewer/Resources/ImageViewerController.xib index 07595fc..f7cf298 100644 --- a/ImageViewer/Resources/ImageViewerController.xib +++ b/ImageViewer/Resources/ImageViewerController.xib @@ -1,18 +1,16 @@ - - - - + + - - + + @@ -45,12 +43,12 @@