diff --git a/Cartfile.resolved b/Cartfile.resolved index b27c998..f7a7ee2 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1 +1 @@ -github "onevcat/Kingfisher" "3.10.4" +github "onevcat/Kingfisher" "4.1.1" diff --git a/PhotoBrowser.xcodeproj/project.pbxproj b/PhotoBrowser.xcodeproj/project.pbxproj index cb974fa..65f8ce0 100644 --- a/PhotoBrowser.xcodeproj/project.pbxproj +++ b/PhotoBrowser.xcodeproj/project.pbxproj @@ -80,8 +80,8 @@ 4A52D2371C72F568001C257B /* PhotoPreviewController.swift */, 4A87F61E1C96CF63005A9667 /* PBAnimation.swift */, 4A0739981C98FB3C0004FEA5 /* PBCustomView.swift */, - 4A52D1E51C72CB2E001C257B /* Info.plist */, A18117DF1E83B66900F8CE8E /* CustomPhotoBroswerManager.swift */, + 4A52D1E51C72CB2E001C257B /* Info.plist */, ); path = PhotoBrowser; sourceTree = ""; @@ -125,12 +125,12 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0720; - LastUpgradeCheck = 0800; + LastUpgradeCheck = 0900; ORGANIZATIONNAME = Teambition; TargetAttributes = { 4A52D1DF1C72CB2E001C257B = { CreatedOnToolsVersion = 7.2.1; - LastSwiftMigration = 0800; + LastSwiftMigration = 0900; }; }; }; @@ -190,14 +190,20 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -240,14 +246,20 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -296,7 +308,8 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -319,7 +332,8 @@ PRODUCT_BUNDLE_IDENTIFIER = com.Teambition.PhotoBrowser; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.0; }; name = Release; }; diff --git a/PhotoBrowser.xcodeproj/xcshareddata/xcschemes/PhotoBrowser.xcscheme b/PhotoBrowser.xcodeproj/xcshareddata/xcschemes/PhotoBrowser.xcscheme index 54861dc..af7d98f 100644 --- a/PhotoBrowser.xcodeproj/xcshareddata/xcschemes/PhotoBrowser.xcscheme +++ b/PhotoBrowser.xcodeproj/xcshareddata/xcschemes/PhotoBrowser.xcscheme @@ -1,6 +1,6 @@ + location = "group:PhotoBrowser.xcodeproj"> + location = "group:PhotoBrowserDemo.xcodeproj"> diff --git a/PhotoBrowser/Info.plist b/PhotoBrowser/Info.plist index d3de8ee..3157e47 100644 --- a/PhotoBrowser/Info.plist +++ b/PhotoBrowser/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 1.0 + 0.7.0 CFBundleSignature ???? CFBundleVersion diff --git a/PhotoBrowser/PBActionBarItem.swift b/PhotoBrowser/PBActionBarItem.swift index 8f8862d..b7ea235 100644 --- a/PhotoBrowser/PBActionBarItem.swift +++ b/PhotoBrowser/PBActionBarItem.swift @@ -33,7 +33,7 @@ open class PBActionBarItem: NSObject { self.action = action } - func triggerAction() { + @objc func triggerAction() { guard let photoBrowser = photoBrowser, let action = action else { return } diff --git a/PhotoBrowser/PBCustomView.swift b/PhotoBrowser/PBCustomView.swift index 3c09563..ca68ebf 100644 --- a/PhotoBrowser/PBCustomView.swift +++ b/PhotoBrowser/PBCustomView.swift @@ -150,7 +150,7 @@ class PBNavigationBar: UIView { lazy var leftButton: UIButton = { let button = UIButton() - let image = UIImage(named: "icon-cross", in: Bundle(for: classForCoder()), compatibleWith: nil) + let image = UIImage(named: "icon-cross", in: Bundle(for: classForCoder), compatibleWith: nil) button.setImage(image, for: UIControlState()) button.translatesAutoresizingMaskIntoConstraints = false button.addConstraint(NSLayoutConstraint(item: button, attribute: .width, relatedBy: .greaterThanOrEqual, toItem: nil, attribute: .notAnAttribute, multiplier: 1.0, constant: 40)) @@ -160,7 +160,7 @@ class PBNavigationBar: UIView { lazy var moreButton: UIButton = { let button = UIButton() - var image = UIImage(named: "moreIcon", in: Bundle(for: classForCoder()), compatibleWith: nil) + var image = UIImage(named: "moreIcon", in: Bundle(for: classForCoder), compatibleWith: nil) button.setImage(image, for: .normal) button.translatesAutoresizingMaskIntoConstraints = false button.addConstraint(NSLayoutConstraint(item: button, attribute: .width, relatedBy: .greaterThanOrEqual, toItem: nil, attribute: .notAnAttribute, multiplier: 1.0, constant: 40)) @@ -171,9 +171,9 @@ class PBNavigationBar: UIView { lazy var rightButton: UIButton = { let button = UIButton() - var image = UIImage(named: "icon-share", in: Bundle(for: classForCoder()), compatibleWith: nil) + var image = UIImage(named: "icon-share", in: Bundle(for: classForCoder), compatibleWith: nil) if self.isFromPhotoPicker { - let unselectedImage = UIImage(named: "checkmark_unselected", in: Bundle(for: classForCoder()), compatibleWith: nil) + let unselectedImage = UIImage(named: "checkmark_unselected", in: Bundle(for: classForCoder), compatibleWith: nil) image = self.imageSelected ? self.getCheckedSelectedImage() : unselectedImage } button.setImage(image, for: .normal) diff --git a/PhotoBrowser/PhotoBrowser.swift b/PhotoBrowser/PhotoBrowser.swift index d7c2af6..90c0763 100644 --- a/PhotoBrowser/PhotoBrowser.swift +++ b/PhotoBrowser/PhotoBrowser.swift @@ -322,7 +322,7 @@ extension PhotoBrowser { return itemsArray } - func leftButtonTap(_ sender: AnyObject?) { + @objc func leftButtonTap(_ sender: AnyObject?) { if let delegate = photoBrowserDelegate { delegate.dismissPhotoBrowser(self) } else { @@ -330,7 +330,7 @@ extension PhotoBrowser { } } - func showMoreFiles(_ sender: Any) { + @objc func showMoreFiles(_ sender: Any) { photoBrowserDelegate?.didShowMoreFiles(self) } @@ -347,7 +347,7 @@ extension PhotoBrowser { photoBrowserDelegate?.photoBrowser(self, didHideSkitchButton: isSkitchButtonHidden) } - func rightButtonTap(_ sender: AnyObject) { + @objc func rightButtonTap(_ sender: AnyObject) { guard let photo = currentPhoto else { return } diff --git a/PhotoBrowser/PhotoPreviewController.swift b/PhotoBrowser/PhotoPreviewController.swift index 9c86c33..c61e5c7 100644 --- a/PhotoBrowser/PhotoPreviewController.swift +++ b/PhotoBrowser/PhotoPreviewController.swift @@ -393,7 +393,7 @@ extension PhotoPreviewController: SkitchViewDelegate { extension PhotoPreviewController { - func handleDoubleTap(_ sender: UITapGestureRecognizer) { + @objc func handleDoubleTap(_ sender: UITapGestureRecognizer) { if scrollView.zoomScale != scrollView.minimumZoomScale { scrollView.setZoomScale(scrollView.minimumZoomScale, animated: true) } else { @@ -406,14 +406,14 @@ extension PhotoPreviewController { updateConstraint() } - func handleSingleTap(_ sender: UITapGestureRecognizer) { + @objc func handleSingleTap(_ sender: UITapGestureRecognizer) { guard let delegate = delegate else { return } delegate.isFullScreenMode = !delegate.isFullScreenMode } - func handleLongPress(_ sender: UILongPressGestureRecognizer) { + @objc func handleLongPress(_ sender: UILongPressGestureRecognizer) { guard let delegate = delegate, let photo = photo else { return } @@ -422,7 +422,7 @@ extension PhotoPreviewController { } } - func handleBackgroundSingleTap(_ sender: UITapGestureRecognizer) { + @objc func handleBackgroundSingleTap(_ sender: UITapGestureRecognizer) { delegate?.didTapOnBackground() } } diff --git a/PhotoBrowser/SkitchView.swift b/PhotoBrowser/SkitchView.swift index 8618675..ada1c95 100644 --- a/PhotoBrowser/SkitchView.swift +++ b/PhotoBrowser/SkitchView.swift @@ -81,7 +81,7 @@ class SkitchView: UIView { skitchRectangleButton.tag = PhotoPreviewConstant.skitchButtonTag + index } - func handleSkitchButtonTap(_ button: UIButton) { + @objc func handleSkitchButtonTap(_ button: UIButton) { let index = button.tag - PhotoPreviewConstant.skitchButtonTag UIView.animate(withDuration: 0.15, delay: 0, options: [.curveEaseInOut], animations: { diff --git a/PhotoBrowserDemo.xcodeproj/project.pbxproj b/PhotoBrowserDemo.xcodeproj/project.pbxproj index 2595070..2acc9b4 100644 --- a/PhotoBrowserDemo.xcodeproj/project.pbxproj +++ b/PhotoBrowserDemo.xcodeproj/project.pbxproj @@ -13,8 +13,9 @@ 4A52D2131C72D13B001C257B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4A52D2121C72D13B001C257B /* Assets.xcassets */; }; 4A52D2161C72D13B001C257B /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4A52D2141C72D13B001C257B /* LaunchScreen.storyboard */; }; 4A8EB7231CEF068D0065EAB0 /* Kingfisher.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A6BC7BB1C770DE100DACDA5 /* Kingfisher.framework */; }; - 869D74FB1F6784CF00765F38 /* PhotoBrowser.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 86AEF72D1EDEB9D100034DBA /* PhotoBrowser.framework */; }; AC570BBF1E247C550083620C /* DetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC570BBE1E247C550083620C /* DetailViewController.swift */; }; + D3F284BF1F96059000E8EE4D /* PhotoBrowser.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D3F284BE1F96059000E8EE4D /* PhotoBrowser.framework */; }; + D3F284C01F96059000E8EE4D /* PhotoBrowser.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = D3F284BE1F96059000E8EE4D /* PhotoBrowser.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -24,6 +25,7 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( + D3F284C01F96059000E8EE4D /* PhotoBrowser.framework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -41,6 +43,7 @@ 4A6BC7BB1C770DE100DACDA5 /* Kingfisher.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Kingfisher.framework; path = Carthage/Build/iOS/Kingfisher.framework; sourceTree = ""; }; 86AEF72D1EDEB9D100034DBA /* PhotoBrowser.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PhotoBrowser.framework; path = "../Library/Developer/Xcode/DerivedData/PhotoBrowser-atvddxmpufwrrkfytkysyblmhonv/Build/Products/Debug-iphonesimulator/PhotoBrowser.framework"; sourceTree = ""; }; AC570BBE1E247C550083620C /* DetailViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DetailViewController.swift; sourceTree = ""; }; + D3F284BE1F96059000E8EE4D /* PhotoBrowser.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PhotoBrowser.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -48,7 +51,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 869D74FB1F6784CF00765F38 /* PhotoBrowser.framework in Frameworks */, + D3F284BF1F96059000E8EE4D /* PhotoBrowser.framework in Frameworks */, 4A8EB7231CEF068D0065EAB0 /* Kingfisher.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -59,6 +62,7 @@ 4A52D1FF1C72D13B001C257B = { isa = PBXGroup; children = ( + D3F284BE1F96059000E8EE4D /* PhotoBrowser.framework */, 4A6BC7BB1C770DE100DACDA5 /* Kingfisher.framework */, 4A52D20A1C72D13B001C257B /* PhotoBrowserDemo */, 4A52D2091C72D13B001C257B /* Products */, @@ -125,12 +129,12 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0720; - LastUpgradeCheck = 0800; + LastUpgradeCheck = 0900; ORGANIZATIONNAME = Teambition; TargetAttributes = { 4A52D2071C72D13B001C257B = { CreatedOnToolsVersion = 7.2.1; - LastSwiftMigration = 0800; + LastSwiftMigration = 0900; }; }; }; @@ -223,14 +227,20 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -253,7 +263,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -270,14 +280,20 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -294,7 +310,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; @@ -316,7 +332,8 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.Teambition.PhotoBrowserDemo; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -333,7 +350,8 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.Teambition.PhotoBrowserDemo; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.0; }; name = Release; }; diff --git a/PhotoBrowserDemo.xcodeproj/xcshareddata/xcschemes/PhotoBrowserDemo.xcscheme b/PhotoBrowserDemo.xcodeproj/xcshareddata/xcschemes/PhotoBrowserDemo.xcscheme index bc5e63c..bbaee33 100644 --- a/PhotoBrowserDemo.xcodeproj/xcshareddata/xcschemes/PhotoBrowserDemo.xcscheme +++ b/PhotoBrowserDemo.xcodeproj/xcshareddata/xcschemes/PhotoBrowserDemo.xcscheme @@ -1,6 +1,6 @@ - + + + + + - + + + @@ -13,10 +18,9 @@ - + - - + diff --git a/PhotoBrowserDemo/Base.lproj/Main.storyboard b/PhotoBrowserDemo/Base.lproj/Main.storyboard index ffb769e..7d21e75 100644 --- a/PhotoBrowserDemo/Base.lproj/Main.storyboard +++ b/PhotoBrowserDemo/Base.lproj/Main.storyboard @@ -1,11 +1,11 @@ - + - + @@ -47,7 +47,7 @@ - + @@ -90,7 +90,7 @@ - + diff --git a/PhotoBrowserDemo/DetailViewController.swift b/PhotoBrowserDemo/DetailViewController.swift index e24ae75..61abf98 100644 --- a/PhotoBrowserDemo/DetailViewController.swift +++ b/PhotoBrowserDemo/DetailViewController.swift @@ -31,11 +31,6 @@ class DetailViewController: UIViewController { super.viewWillDisappear(animated) navigationController?.navigationBar.removeObserver(self, forKeyPath: navigationBarHiddenKeyPath, context: &navigationBarKVOContext) } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - // Dispose of any resources that can be recreated. - } } // MARK: - KVO for NavigationBar diff --git a/PhotoBrowserDemo/Info.plist b/PhotoBrowserDemo/Info.plist index 40c6215..af70e57 100644 --- a/PhotoBrowserDemo/Info.plist +++ b/PhotoBrowserDemo/Info.plist @@ -2,6 +2,8 @@ + NSPhotoLibraryAddUsageDescription + 选择"好"来访问相册 CFBundleDevelopmentRegion en CFBundleExecutable @@ -15,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.0 + 0.7.0 CFBundleSignature ???? CFBundleVersion diff --git a/PhotoBrowserDemo/ViewController.swift b/PhotoBrowserDemo/ViewController.swift index 375fa98..30357d3 100644 --- a/PhotoBrowserDemo/ViewController.swift +++ b/PhotoBrowserDemo/ViewController.swift @@ -21,15 +21,11 @@ class ViewController: UIViewController { imageView.addGestureRecognizer(gesture) } - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - } - func saveToAlbum(_ image: UIImage) { UIImageWriteToSavedPhotosAlbum(image, self, #selector(self.image(_:didFinishSavingWithError:contextInfo:)), nil) } - func image(_ image: UIImage, didFinishSavingWithError error:NSError?, contextInfo:UnsafeRawPointer) { + @objc func image(_ image: UIImage, didFinishSavingWithError error:NSError?, contextInfo:UnsafeRawPointer) { if error == nil { print("save success") } else { @@ -39,7 +35,7 @@ class ViewController: UIViewController { } extension ViewController { - func displayPhotoBrowser() { + @objc func displayPhotoBrowser() { let thumbnail1 = UIImage.init(named: "thumbnail1") let photoUrl1 = URL.init(string: "https://www.teambition.com/api/works/575d0bbf93e0f8860d73d88e/download/IMG_0005.JPG.jpeg?signature=eyJhbGciOiJIUzI1NiJ9.eyJfd29ya0lkIjoiNTc1ZDBiYmY5M2UwZjg4NjBkNzNkODhlIiwiZmlsZUtleSI6IjExMGg2MzRhOTg3MDQ5MDJmNDY1MmJhZTYzYjI1MTQyZTUyMSIsIl91c2VySWQiOiI1MmE2Y2MyZGVmNjZiYzk4MGMwMDAzMTIiLCJleHAiOjE0ODIwNjA0ODgsInN0b3JhZ2UiOiJzdHJpa2VyLWh6In0.czjEgDdAKqqOm8fK8lDOiE7wA_5H48bh6phlomGQqWo") let thumbnail2 = UIImage.init(named: "thumbnail2") diff --git a/README.md b/README.md index 7317bd1..18625e5 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ ## Features -A simple photo browser to display remote photos. [Kingfisher] (https://github.com/onevcat/Kingfisher) is used to download and cache images. +A simple photo browser to display remote photos. [Kingfisher](https://github.com/onevcat/Kingfisher) is used to download and cache images. Support: * Double-tap to zoom out & zoom in @@ -28,7 +28,7 @@ If Kingfisher is not used in your project, you have to **drag it your self into ## Run Demo ``` bash -$ git clone git@github.com:teambition/PhotoBrowser.git +$ git clone https://github.com/teambition/PhotoBrowser.git ``` And then