Skip to content

Commit

Permalink
Added external link icon
Browse files Browse the repository at this point in the history
Added an icon to show that certain buttons in the "About" section of the app link to external apps.
  • Loading branch information
Jag-Marcel committed Feb 8, 2024
1 parent 3f8805d commit 04c483e
Show file tree
Hide file tree
Showing 8 changed files with 86 additions and 8 deletions.
10 changes: 5 additions & 5 deletions Scribe/AboutTab/AboutTableData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ struct AboutTableData {
ParentTableCellModel(
headingTitle: "Community",
section: [
Section(sectionTitle: "See the code on GitHub", imageString: "github", sectionState: .github),
Section(sectionTitle: "Chat with the team on Matrix", imageString: "matrix", sectionState: .matrix),
Section(sectionTitle: "See the code on GitHub", imageString: "github", sectionState: .github, externalLink: true),
Section(sectionTitle: "Chat with the team on Matrix", imageString: "matrix", sectionState: .matrix, externalLink: true),
Section(sectionTitle: "Wikimedia and Scribe", imageString: "wikimedia", sectionState: .wikimedia),
Section(sectionTitle: "Share Scribe", imageString: "square.and.arrow.up", sectionState: .shareScribe),
],
Expand All @@ -19,9 +19,9 @@ struct AboutTableData {
ParentTableCellModel(
headingTitle: "Feedback and support",
section: [
Section(sectionTitle: "Rate Scribe", imageString: "star", sectionState: .rateScribe),
Section(sectionTitle: "Report a bug", imageString: "ant", sectionState: .bugReport),
Section(sectionTitle: "Send us an email", imageString: "envelope", sectionState: .email),
Section(sectionTitle: "Rate Scribe", imageString: "star", sectionState: .rateScribe, externalLink: true),
Section(sectionTitle: "Report a bug", imageString: "ant", sectionState: .bugReport, externalLink: true),
Section(sectionTitle: "Send us an email", imageString: "envelope", sectionState: .email, externalLink: true),
// Section(sectionTitle: "Reset app hints", imageString: "lightbulb", sectionState: .appHints)
],
hasDynamicData: nil
Expand Down
1 change: 1 addition & 0 deletions Scribe/AboutTab/AboutViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ extension AboutViewController {
case .appLang: break
case .none: break
case .specificLang(_): break
case .externalLink: break
}


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"images" : [
{
"filename" : "External_link_font_awesome.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "External_link_font_awesome_dark_mode.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions Scribe/Components/UITableViewCells/AboutTableViewCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ final class AboutTableViewCell: UITableViewCell {

@IBOutlet var titleLabel: UILabel!
@IBOutlet var iconImageView: UIImageView!
@IBOutlet var linkImageView: UIImageView!

private var section: Section?
private var parentSection: Section?
Expand All @@ -43,6 +44,15 @@ final class AboutTableViewCell: UITableViewCell {
} else {
iconImageView.image = nil
}
if let link = section.externalLink {
if link {
linkImageView.image = UIImage.availableIconImage(with: "externalLink")
} else {
linkImageView.image = nil
}
} else {
linkImageView.image = nil
}

accessoryType = section.hasNestedNavigation ? .disclosureIndicator : .none
}
Expand Down
16 changes: 14 additions & 2 deletions Scribe/Components/UITableViewCells/AboutTableViewCell.xib
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="22155" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="22505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22131"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22504"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
Expand Down Expand Up @@ -36,11 +36,22 @@
<constraint firstAttribute="height" constant="26" id="Vwp-c3-IiP"/>
</constraints>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Av5-Tu-z7q" userLabel="Link Image View">
<rect key="frame" x="450" y="56" width="20" height="20"/>
<color key="tintColor" name="keyChar"/>
<constraints>
<constraint firstAttribute="width" constant="20" id="2Nf-N8-aed"/>
<constraint firstAttribute="height" constant="20" id="7Tb-NH-OcY"/>
</constraints>
</imageView>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="MSu-WY-MCY" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="6Yr-Bm-4Cx"/>
<constraint firstItem="Av5-Tu-z7q" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="Nx3-Wr-JYN"/>
<constraint firstAttribute="trailing" secondItem="Av5-Tu-z7q" secondAttribute="trailing" constant="16" id="awi-VI-67k"/>
<constraint firstItem="MSu-WY-MCY" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="k6M-7f-ePY"/>
<constraint firstItem="Av5-Tu-z7q" firstAttribute="centerY" secondItem="AJP-R8-VkX" secondAttribute="centerY" id="qSS-hY-B7w"/>
<constraint firstItem="AJP-R8-VkX" firstAttribute="centerY" secondItem="MSu-WY-MCY" secondAttribute="centerY" id="twY-UQ-o7I"/>
<constraint firstItem="AJP-R8-VkX" firstAttribute="leading" secondItem="MSu-WY-MCY" secondAttribute="trailing" constant="8" id="udY-dz-eEL"/>
<constraint firstAttribute="trailing" secondItem="AJP-R8-VkX" secondAttribute="trailing" constant="8" id="wI4-UY-kS6"/>
Expand All @@ -49,6 +60,7 @@
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
<connections>
<outlet property="iconImageView" destination="MSu-WY-MCY" id="EMy-K1-jZa"/>
<outlet property="linkImageView" destination="Av5-Tu-z7q" id="Dq0-4R-6NK"/>
<outlet property="titleLabel" destination="AJP-R8-VkX" id="urL-z2-Msc"/>
</connections>
<point key="canvasLocation" x="265.64885496183206" y="50.70422535211268"/>
Expand Down
5 changes: 4 additions & 1 deletion Scribe/ParentTableCellModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,16 @@ struct Section {
let hasNestedNavigation: Bool
let sectionState: SectionState
let shortDescription: String?
let externalLink: Bool?

init(sectionTitle: String, imageString: String? = nil, hasToggle: Bool = false, hasNestedNavigation: Bool = false, sectionState: SectionState, shortDescription: String? = nil) {
init(sectionTitle: String, imageString: String? = nil, hasToggle: Bool = false, hasNestedNavigation: Bool = false, sectionState: SectionState, shortDescription: String? = nil, externalLink: Bool? = false) {
self.sectionTitle = sectionTitle
self.imageString = imageString
self.hasToggle = hasToggle
self.hasNestedNavigation = hasNestedNavigation
self.sectionState = sectionState
self.shortDescription = shortDescription
self.externalLink = externalLink
}
}

Expand All @@ -44,6 +46,7 @@ enum SectionState: Equatable {
case appLang
case specificLang(String)
case none(UserInteractiveState)
case externalLink
}

enum UserInteractiveState {
Expand Down

0 comments on commit 04c483e

Please sign in to comment.