Skip to content

Commit

Permalink
Add credits button.
Browse files Browse the repository at this point in the history
  • Loading branch information
mhdhejazi committed Apr 28, 2020
1 parent 2619a7a commit b0f2839
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 11 deletions.
7 changes: 6 additions & 1 deletion Corona/Controller/Region/RegionCells/DataSourceCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class DataSourceCell: RegionDataCell {
override func awakeFromNib() {
super.awakeFromNib()

labelSource.text = L10n.Data.source("")
labelSource.text = "\(L10n.App.credits): "
}

private func presentSafariViewController(with url: URL) {
Expand Down Expand Up @@ -43,4 +43,9 @@ class DataSourceCell: RegionDataCell {
let url = URL(string: "https://experience.arcgis.com/experience/fb603473e1f74f0bbae48155ff238565/")!
presentSafariViewController(with: url)
}

@IBAction private func buttonContributorsTapped(_ sender: Any) {
let url = URL(string: "https://github.com/mhdhejazi/CoronaTracker#credits")!
presentSafariViewController(with: url)
}
}
2 changes: 2 additions & 0 deletions Corona/Generated/Strings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import Foundation
internal enum L10n {

internal enum App {
/// Credits
internal static let credits = L10n.tr("Localizable", "app.credits")
/// Please update from %@
internal static func newVersionMessage(_ p1: String) -> String {
return L10n.tr("Localizable", "app.newVersionMessage", p1)
Expand Down
1 change: 1 addition & 0 deletions Corona/Localization/Base.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"data.source" = "Source: %@";
"app.newVersionTitle" = "New Version Available";
"app.newVersionMessage" = "Please update from %@";
"app.credits" = "Credits";
"message.cancel" = "Cancel";
"message.open" = "Open";
"message.ok" = "OK";
Expand Down
35 changes: 25 additions & 10 deletions Corona/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -326,14 +326,14 @@
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="1T8-Ge-EY9">
<rect key="frame" x="20" y="4" width="374" height="32"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="750" verticalHuggingPriority="251" horizontalCompressionResistancePriority="250" text="Source:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="Mdl-LP-xBX">
<rect key="frame" x="0.0" y="0.0" width="46.5" height="32"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="750" verticalHuggingPriority="251" horizontalCompressionResistancePriority="250" text="Credits:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="Mdl-LP-xBX">
<rect key="frame" x="0.0" y="0.0" width="47.5" height="32"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleFootnote"/>
<color key="textColor" systemColor="tertiaryLabelColor" red="0.23529411759999999" green="0.23529411759999999" blue="0.26274509800000001" alpha="0.29999999999999999" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" alpha="0.75" contentMode="scaleToFill" horizontalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Lic-W0-pyP">
<rect key="frame" x="46.5" y="0.0" width="67" height="32"/>
<rect key="frame" x="47.5" y="0.0" width="67" height="32"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleFootnote"/>
<inset key="contentEdgeInsets" minX="2" minY="0.0" maxX="2" maxY="0.0"/>
<state key="normal" title="JHU CSSE"/>
Expand All @@ -342,13 +342,13 @@
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="750" verticalHuggingPriority="251" horizontalCompressionResistancePriority="250" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="hio-mj-mcl">
<rect key="frame" x="113.5" y="0.0" width="5.5" height="32"/>
<rect key="frame" x="114.5" y="0.0" width="5.5" height="32"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleFootnote"/>
<color key="textColor" systemColor="tertiaryLabelColor" red="0.23529411759999999" green="0.23529411759999999" blue="0.26274509800000001" alpha="0.29999999999999999" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" alpha="0.75" contentMode="scaleToFill" horizontalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="K3n-Zt-lDu">
<rect key="frame" x="119" y="0.0" width="31" height="32"/>
<rect key="frame" x="120" y="0.0" width="31" height="32"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleFootnote"/>
<inset key="contentEdgeInsets" minX="2" minY="0.0" maxX="2" maxY="0.0"/>
<state key="normal" title="Bing"/>
Expand All @@ -357,13 +357,13 @@
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="750" verticalHuggingPriority="251" horizontalCompressionResistancePriority="250" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="YAV-af-ene">
<rect key="frame" x="150" y="0.0" width="5.5" height="32"/>
<rect key="frame" x="151" y="0.0" width="5.5" height="32"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleFootnote"/>
<color key="textColor" systemColor="tertiaryLabelColor" red="0.23529411759999999" green="0.23529411759999999" blue="0.26274509800000001" alpha="0.29999999999999999" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" alpha="0.75" contentMode="scaleToFill" horizontalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="gVt-5v-PDk">
<rect key="frame" x="155.5" y="0.0" width="25" height="32"/>
<rect key="frame" x="156.5" y="0.0" width="25" height="32"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleFootnote"/>
<inset key="contentEdgeInsets" minX="2" minY="0.0" maxX="2" maxY="0.0"/>
<state key="normal" title="RKI"/>
Expand All @@ -372,23 +372,37 @@
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="750" verticalHuggingPriority="251" horizontalCompressionResistancePriority="250" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="QpB-7E-YXj">
<rect key="frame" x="180.5" y="0.0" width="5.5" height="32"/>
<rect key="frame" x="181.5" y="0.0" width="5.5" height="32"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleFootnote"/>
<color key="textColor" systemColor="tertiaryLabelColor" red="0.23529411759999999" green="0.23529411759999999" blue="0.26274509800000001" alpha="0.29999999999999999" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" alpha="0.75" contentMode="scaleToFill" horizontalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Bus-B2-ZPH">
<rect key="frame" x="186" y="0.0" width="59" height="32"/>
<rect key="frame" x="187" y="0.0" width="59" height="32"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleFootnote"/>
<inset key="contentEdgeInsets" minX="2" minY="0.0" maxX="2" maxY="0.0"/>
<state key="normal" title="BMSGPK"/>
<connections>
<action selector="buttonBMSGPKTapped:" destination="PyN-Ks-IkV" eventType="touchUpInside" id="a49-11-TQp"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" verticalHuggingPriority="251" horizontalCompressionResistancePriority="250" text=" " textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="9OF-JV-fOH">
<rect key="frame" x="245" y="0.0" width="129" height="32"/>
<rect key="frame" x="246" y="0.0" width="96" height="32"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleFootnote"/>
<color key="textColor" systemColor="tertiaryLabelColor" red="0.23529411759999999" green="0.23529411759999999" blue="0.26274509800000001" alpha="0.29999999999999999" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="1000" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="9tn-KB-Wff">
<rect key="frame" x="342" y="0.0" width="32" height="32"/>
<constraints>
<constraint firstAttribute="height" constant="32" id="jDd-ZO-dfw"/>
<constraint firstAttribute="width" constant="32" id="kx7-TX-Yds"/>
</constraints>
<state key="normal" image="Persons"/>
<connections>
<action selector="buttonContributorsTapped:" destination="PyN-Ks-IkV" eventType="touchUpInside" id="waq-VL-EHa"/>
</connections>
</button>
</subviews>
<constraints>
<constraint firstAttribute="height" constant="32" id="IAB-iM-cVa"/>
Expand Down Expand Up @@ -910,6 +924,7 @@ Deaths</string>
<image name="Info" width="22" height="22"/>
<image name="Layers" width="22" height="22"/>
<image name="More" width="22" height="22"/>
<image name="Persons" width="22" height="22"/>
<image name="Search" width="22" height="22"/>
<image name="Twitter" width="22" height="22"/>
</resources>
Expand Down
15 changes: 15 additions & 0 deletions Corona/Resources/Assets.xcassets/Persons.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "Persons.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Binary file not shown.

0 comments on commit b0f2839

Please sign in to comment.