Skip to content

Commit

Permalink
added image url
Browse files Browse the repository at this point in the history
  • Loading branch information
RishabhTayal committed Sep 8, 2017
1 parent 482c7bc commit d7312f4
Show file tree
Hide file tree
Showing 9 changed files with 132 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
ReviewMonitor.xcodeproj/xcuserdata/

*/xcuserdata/

Pods/
5 changes: 5 additions & 0 deletions Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
use_frameworks!

target 'ReviewMonitor' do
pod 'SDWebImage'
end
14 changes: 14 additions & 0 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
PODS:
- SDWebImage (4.1.0):
- SDWebImage/Core (= 4.1.0)
- SDWebImage/Core (4.1.0)

DEPENDENCIES:
- SDWebImage

SPEC CHECKSUMS:
SDWebImage: 0e435c14e402a6730315a0fb79f95e68654d55a4

PODFILE CHECKSUM: 14eb64021feb88f7851ff48a5ef0745bc63fce15

COCOAPODS: 1.3.1
83 changes: 83 additions & 0 deletions ReviewMonitor.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
693F5FAC1F61F23F00FD8859 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 693F5FAA1F61F23F00FD8859 /* Main.storyboard */; };
693F5FAE1F61F23F00FD8859 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 693F5FAD1F61F23F00FD8859 /* Assets.xcassets */; };
693F5FB11F61F23F00FD8859 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 693F5FAF1F61F23F00FD8859 /* LaunchScreen.storyboard */; };
8DCB75247AD737334707187A /* Pods_ReviewMonitor.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E8E287C5517B3179FAD951AD /* Pods_ReviewMonitor.framework */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -30,24 +31,47 @@
693F5FAD1F61F23F00FD8859 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
693F5FB01F61F23F00FD8859 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
693F5FB21F61F23F00FD8859 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
9FAFE25272698412BDB5AAA2 /* Pods-ReviewMonitor.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ReviewMonitor.release.xcconfig"; path = "Pods/Target Support Files/Pods-ReviewMonitor/Pods-ReviewMonitor.release.xcconfig"; sourceTree = "<group>"; };
E8E287C5517B3179FAD951AD /* Pods_ReviewMonitor.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ReviewMonitor.framework; sourceTree = BUILT_PRODUCTS_DIR; };
EB8F24CEC9ABC525BDB39609 /* Pods-ReviewMonitor.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ReviewMonitor.debug.xcconfig"; path = "Pods/Target Support Files/Pods-ReviewMonitor/Pods-ReviewMonitor.debug.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
693F5FA01F61F23F00FD8859 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
8DCB75247AD737334707187A /* Pods_ReviewMonitor.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
331ADA8302990C0425450B8A /* Frameworks */ = {
isa = PBXGroup;
children = (
E8E287C5517B3179FAD951AD /* Pods_ReviewMonitor.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
4C2894C7EC145174656C983C /* Pods */ = {
isa = PBXGroup;
children = (
EB8F24CEC9ABC525BDB39609 /* Pods-ReviewMonitor.debug.xcconfig */,
9FAFE25272698412BDB5AAA2 /* Pods-ReviewMonitor.release.xcconfig */,
);
name = Pods;
sourceTree = "<group>";
};
693F5F9A1F61F23F00FD8859 = {
isa = PBXGroup;
children = (
693F5FA51F61F23F00FD8859 /* ReviewMonitor */,
693F5FA41F61F23F00FD8859 /* Products */,
4C2894C7EC145174656C983C /* Pods */,
331ADA8302990C0425450B8A /* Frameworks */,
);
sourceTree = "<group>";
};
Expand Down Expand Up @@ -83,9 +107,12 @@
isa = PBXNativeTarget;
buildConfigurationList = 693F5FB51F61F23F00FD8859 /* Build configuration list for PBXNativeTarget "ReviewMonitor" */;
buildPhases = (
8274AE0422947A0D3F4E4A79 /* [CP] Check Pods Manifest.lock */,
693F5F9F1F61F23F00FD8859 /* Sources */,
693F5FA01F61F23F00FD8859 /* Frameworks */,
693F5FA11F61F23F00FD8859 /* Resources */,
E78D79FFCF7520445B4BCCE7 /* [CP] Embed Pods Frameworks */,
417724DFEF1130E14BC1158D /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand Down Expand Up @@ -144,6 +171,60 @@
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
417724DFEF1130E14BC1158D /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-ReviewMonitor/Pods-ReviewMonitor-resources.sh\"\n";
showEnvVarsInLog = 0;
};
8274AE0422947A0D3F4E4A79 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-ReviewMonitor-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
E78D79FFCF7520445B4BCCE7 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-ReviewMonitor/Pods-ReviewMonitor-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-ReviewMonitor/Pods-ReviewMonitor-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
693F5F9F1F61F23F00FD8859 /* Sources */ = {
isa = PBXSourcesBuildPhase;
Expand Down Expand Up @@ -275,6 +356,7 @@
};
693F5FB61F61F23F00FD8859 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = EB8F24CEC9ABC525BDB39609 /* Pods-ReviewMonitor.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = CEBY93VF85;
Expand All @@ -288,6 +370,7 @@
};
693F5FB71F61F23F00FD8859 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 9FAFE25272698412BDB5AAA2 /* Pods-ReviewMonitor.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = CEBY93VF85;
Expand Down
Binary file not shown.
10 changes: 10 additions & 0 deletions ReviewMonitor.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions ReviewMonitor/App.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ import UIKit

class App: NSObject {
var name: String = ""
var previewUrl: String? = ""

init(dict: [String: Any]) {
self.name = dict["name"] as! String
self.previewUrl = dict["app_icon_preview_url"] as? String
}
}
11 changes: 10 additions & 1 deletion ReviewMonitor/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,21 @@
<rect key="frame" x="16" y="64" width="343" height="603"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="cell" id="Y6s-ki-jaP">
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="cell" textLabel="5Uw-AR-man" style="IBUITableViewCellStyleDefault" id="Y6s-ki-jaP">
<rect key="frame" x="0.0" y="28" width="343" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="Y6s-ki-jaP" id="fr2-uE-tFX">
<rect key="frame" x="0.0" y="0.0" width="343" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="5Uw-AR-man">
<rect key="frame" x="15" y="0.0" width="313" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
</tableViewCell>
</prototypes>
Expand Down
6 changes: 6 additions & 0 deletions ReviewMonitor/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import UIKit
import SDWebImage

class ViewController: UIViewController {

Expand Down Expand Up @@ -43,6 +44,11 @@ extension ViewController: UITableViewDataSource, UITableViewDelegate {
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "cell")
cell?.textLabel?.text = list[indexPath.row].name
if let url = list[indexPath.row].previewUrl {
cell?.imageView?.sd_setImage(with: URL.init(string: url)!, completed: nil)
} else {
cell?.imageView?.image = nil
}
return cell!
}

Expand Down

0 comments on commit d7312f4

Please sign in to comment.