Skip to content

Commit

Permalink
번들로드 문제 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
pandoraTVBot committed Sep 30, 2022
1 parent b5cf6fb commit f1db83c
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 101 deletions.
2 changes: 0 additions & 2 deletions ImageViewer/AnimatableImageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ 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")
}
}
}
22 changes: 3 additions & 19 deletions ImageViewer/ImageViewerController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ 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")
closeButton.setImage(closeImage, for: .normal)
}
}

fileprivate var transitionHandler: ImageViewerTransitioningHandler?
fileprivate let configuration: ImageViewerConfiguration?
Expand All @@ -21,7 +15,7 @@ public final class ImageViewerController: UIViewController {

public init(configuration: ImageViewerConfiguration?) {
self.configuration = configuration
super.init(nibName: "ImageViewerController", bundle: nil)
super.init(nibName: String(describing: type(of: self)), bundle: Bundle(for: type(of: self)))

modalPresentationStyle = .overFullScreen
modalTransitionStyle = .crossDissolve
Expand Down Expand Up @@ -104,21 +98,11 @@ private extension ImageViewerController {
dismiss(animated: true)
}

@objc func imageViewDoubleTapped(recognizer: UITapGestureRecognizer) {
func zoomRectForScale(scale: CGFloat, center: CGPoint) -> CGRect {
var zoomRect = CGRect.zero
zoomRect.size.height = imageView.frame.size.height / scale
zoomRect.size.width = imageView.frame.size.width / scale
let newCenter = scrollView.convert(center, from: imageView)
zoomRect.origin.x = newCenter.x - (zoomRect.size.width / 2.0)
zoomRect.origin.y = newCenter.y - (zoomRect.size.height / 2.0)
return zoomRect
}

@objc func imageViewDoubleTapped() {
if scrollView.zoomScale > scrollView.minimumZoomScale {
scrollView.setZoomScale(scrollView.minimumZoomScale, animated: true)
} else {
scrollView.zoom(to: zoomRectForScale(scale: scrollView.maximumZoomScale, center: recognizer.location(in: recognizer.view)), animated: true)
scrollView.setZoomScale(scrollView.maximumZoomScale, animated: true)
}
}

Expand Down
2 changes: 1 addition & 1 deletion ImageViewer/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.1.1</string>
<string>1.2.1</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>NSPrincipalClass</key>
Expand Down
75 changes: 0 additions & 75 deletions ImageViewer/Resources/ImageViewerController.xib

This file was deleted.

4 changes: 0 additions & 4 deletions SimpleImageViewer.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
A0BF70B71EDC758300109F6E /* ImageViewerController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A07E76EB1ECC94EA00B77D46 /* ImageViewerController.swift */; };
A0BF70B81EDC758300109F6E /* AnimatableImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A07E771F1ECE390C00B77D46 /* AnimatableImageView.swift */; };
A0BF70B91EDC759A00109F6E /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A07E76DA1ECC94A400B77D46 /* Main.storyboard */; };
A0BF70BA1EDC75AE00109F6E /* ImageViewerController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A07E76ED1ECC959700B77D46 /* ImageViewerController.xib */; };
A0BF70BB1EDC75AE00109F6E /* ImageViewer-Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A07E77231ECF289800B77D46 /* ImageViewer-Assets.xcassets */; };
A0BF70BC1EDC767B00109F6E /* HeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A07E77211ECF1FC100B77D46 /* HeaderView.swift */; };
/* End PBXBuildFile section */
Expand Down Expand Up @@ -70,7 +69,6 @@
A07E76DB1ECC94A400B77D46 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
A07E76DD1ECC94A400B77D46 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
A07E76EB1ECC94EA00B77D46 /* ImageViewerController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageViewerController.swift; sourceTree = "<group>"; };
A07E76ED1ECC959700B77D46 /* ImageViewerController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = ImageViewerController.xib; path = Resources/ImageViewerController.xib; sourceTree = "<group>"; };
A07E77161ECE0F3500B77D46 /* ImageCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageCell.swift; sourceTree = "<group>"; };
A07E77191ECE2EDF00B77D46 /* ImageViewerPresentationTransition.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageViewerPresentationTransition.swift; sourceTree = "<group>"; };
A07E771B1ECE313E00B77D46 /* ImageViewerTransitioningHandler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageViewerTransitioningHandler.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -186,7 +184,6 @@
children = (
A05E9FA41EF7FB640024CF47 /* ImageViewerConfiguration.swift */,
A07E76EB1ECC94EA00B77D46 /* ImageViewerController.swift */,
A07E76ED1ECC959700B77D46 /* ImageViewerController.xib */,
);
name = ImageViewerController;
sourceTree = "<group>";
Expand Down Expand Up @@ -344,7 +341,6 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
A0BF70BA1EDC75AE00109F6E /* ImageViewerController.xib in Resources */,
A0BF70BB1EDC75AE00109F6E /* ImageViewer-Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down

0 comments on commit f1db83c

Please sign in to comment.