Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Commit

Permalink
Fix #10, change ImageViewer for a custom one
Browse files Browse the repository at this point in the history
  • Loading branch information
tovkal committed Jun 15, 2017
1 parent b982a33 commit 7928fb3
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 19 deletions.
3 changes: 1 addition & 2 deletions Cartfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ github "Alamofire/Alamofire" ~> 4.4
github "tristanhimmelman/AlamofireObjectMapper" ~> 4.1.0
github "onevcat/Kingfisher" ~> 3.6.2
github "xmartlabs/XLPagerTabStrip" ~> 7.0
github "JanGorman/Agrume" ~> 3.2.1

github "Tovkal/ImageViewer" ~> 0.1
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
github "Alamofire/Alamofire" "4.4.0"
github "Hearst-DD/ObjectMapper" "2.2.7"
github "JanGorman/Agrume" "3.2.1"
github "Tovkal/ImageViewer" "0.1.1"
github "onevcat/Kingfisher" "3.10.1"
github "tristanhimmelman/AlamofireObjectMapper" "4.1.0"
github "xmartlabs/XLPagerTabStrip" "7.0.0"
12 changes: 7 additions & 5 deletions OpenFoodFacts.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
/* Begin PBXBuildFile section */
951FB09D1EB2989A005CAE33 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 951FB09F1EB2989A005CAE33 /* InfoPlist.strings */; };
9525708C1EE9BC91002FC40D /* CellImageTapable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9525708B1EE9BC91002FC40D /* CellImageTapable.swift */; };
9525708E1EE9BE6D002FC40D /* Agrume.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9525708D1EE9BE6D002FC40D /* Agrume.framework */; };
953664F51ECA212100D6D398 /* NutrimentItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 953664F41ECA212100D6D398 /* NutrimentItem.swift */; };
953C2BE41E9EC22200FD99D4 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 953C2BE31E9EC22200FD99D4 /* Alamofire.framework */; };
9543129D1EEC57A1009F0621 /* ImageViewer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9543129C1EEC57A1009F0621 /* ImageViewer.framework */; };
955ED9B71EB2901100BB80BA /* EmptyProductsView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 955ED9B91EB2901100BB80BA /* EmptyProductsView.xib */; };
955ED9BC1EB290F900BB80BA /* Settings.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 955ED9BE1EB290F900BB80BA /* Settings.storyboard */; };
956B95931EB28C8A007C0345 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 956B95921EB28C8A007C0345 /* Localizable.strings */; };
Expand Down Expand Up @@ -84,6 +84,7 @@
9525708D1EE9BE6D002FC40D /* Agrume.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Agrume.framework; path = Carthage/Build/iOS/Agrume.framework; sourceTree = "<group>"; };
953664F41ECA212100D6D398 /* NutrimentItem.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = NutrimentItem.swift; path = Nutriments/NutrimentItem.swift; sourceTree = "<group>"; };
953C2BE31E9EC22200FD99D4 /* Alamofire.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Alamofire.framework; path = Carthage/Build/iOS/Alamofire.framework; sourceTree = "<group>"; };
9543129C1EEC57A1009F0621 /* ImageViewer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ImageViewer.framework; path = Carthage/Build/iOS/ImageViewer.framework; sourceTree = "<group>"; };
955ED9B81EB2901100BB80BA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/EmptyProductsView.xib; sourceTree = "<group>"; };
955ED9BD1EB290F900BB80BA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Settings.storyboard; sourceTree = "<group>"; };
956B95921EB28C8A007C0345 /* Localizable.strings */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; path = Localizable.strings; sourceTree = "<group>"; };
Expand Down Expand Up @@ -159,7 +160,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
9525708E1EE9BE6D002FC40D /* Agrume.framework in Frameworks */,
9543129D1EEC57A1009F0621 /* ImageViewer.framework in Frameworks */,
957094BA1EA24DFC00268236 /* XLPagerTabStrip.framework in Frameworks */,
95CE24E21ED5509300EF3D79 /* Crashlytics.framework in Frameworks */,
957094B11EA163CF00268236 /* Kingfisher.framework in Frameworks */,
Expand Down Expand Up @@ -329,6 +330,7 @@
95C265231E96D5C2004212EC /* Frameworks */ = {
isa = PBXGroup;
children = (
9543129C1EEC57A1009F0621 /* ImageViewer.framework */,
9525708D1EE9BE6D002FC40D /* Agrume.framework */,
95CE24DF1ED5509300EF3D79 /* Fabric.framework */,
95CE24E01ED5509300EF3D79 /* Crashlytics.framework */,
Expand Down Expand Up @@ -525,7 +527,7 @@
"$(SRCROOT)/Carthage/Build/iOS/ObjectMapper.framework",
"$(SRCROOT)/Carthage/Build/iOS/Kingfisher.framework",
"$(SRCROOT)/Carthage/Build/iOS/XLPagerTabStrip.framework",
"$(SRCROOT)/Carthage/Build/iOS/Agrume.framework",
"$(SRCROOT)/Carthage/Build/iOS/ImageViewer.framework",
);
outputPaths = (
);
Expand Down Expand Up @@ -747,7 +749,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = 4;
CURRENT_PROJECT_VERSION = 5;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = JVHN2X67GT;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -768,7 +770,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = 4;
CURRENT_PROJECT_VERSION = 5;
DEVELOPMENT_TEAM = JVHN2X67GT;
FRAMEWORK_SEARCH_PATHS = (
"$(PROJECT_DIR)/Carthage/Build/iOS",
Expand Down
2 changes: 1 addition & 1 deletion OpenFoodFacts/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>4</string>
<string>5</string>
<key>Fabric</key>
<dict>
<key>APIKey</key>
Expand Down
4 changes: 2 additions & 2 deletions OpenFoodFacts/Protocols/CellImageTapable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ protocol CellImageTapable: class {
/// Image tap action handler
///
/// - Parameters:
/// - image: Image that was tapped
/// - imageView: Image view that was tapped
/// - sender: Object that displays the image
func didTap(image: UIImage?, sender: UITableViewCell)
func didTap(imageView: UIImageView?, sender: UITableViewCell)
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import UIKit
import XLPagerTabStrip
import Agrume
import ImageViewer

/// Generic Product Detail page view controller. H is the header or main row, R is one of the rows with information.
class ProductDetailPageViewController<H: ConfigurableUITableViewCell<Product>, R: ConfigurableUITableViewCell<InfoRow>>: UIViewController, UITableViewDelegate, UITableViewDataSource, IndicatorInfoProvider {
Expand Down Expand Up @@ -110,10 +110,9 @@ class ProductDetailPageViewController<H: ConfigurableUITableViewCell<Product>, R
}

extension ProductDetailPageViewController: CellImageTapable {
func didTap(image: UIImage?, sender: UITableViewCell) {
if let image = image {
let agrume = Agrume(image: image, backgroundColor: .black)
agrume.showFrom(self)
func didTap(imageView: UIImageView?, sender: UITableViewCell) {
if let imageView = imageView {
ImageViewer.show(imageView, presentingVC: self)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ class IngredientHeaderTableViewCell: ConfigurableUITableViewCell<Product> {
}

func didTapProductImage(_ sender: UITapGestureRecognizer) {
delegate?.didTap(image: ingredients.image, sender: self)
delegate?.didTap(imageView: ingredients, sender: self)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ class NutritionTableHeaderTableViewCell: ConfigurableUITableViewCell<Product> {
}

func didTapProductImage(_ sender: UITapGestureRecognizer) {
delegate?.didTap(image: nutritionTableImage.image, sender: self)
delegate?.didTap(imageView: nutritionTableImage, sender: self)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ class SummaryHeaderTableViewCell: ConfigurableUITableViewCell<Product> {
}

func didTapProductImage(_ sender: UITapGestureRecognizer) {
delegate?.didTap(image: productImage.image, sender: self)
delegate?.didTap(imageView: productImage, sender: self)
}
}

0 comments on commit 7928fb3

Please sign in to comment.