Skip to content

Commit

Permalink
#35 Add SettingsViewController and link to changelog (#37)
Browse files Browse the repository at this point in the history
* add settingsViewController, add changelog link and a few dummy rows

* remove docstring and unnecessary .init

* remove stub code
  • Loading branch information
felixfoertsch authored and kgellci committed Jan 19, 2019
1 parent 45c257f commit 55d0381
Show file tree
Hide file tree
Showing 2 changed files with 108 additions and 12 deletions.
102 changes: 90 additions & 12 deletions Area51/Resources/UI/Settings.storyboard
Original file line number Diff line number Diff line change
@@ -1,28 +1,106 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="qsz-un-vmO">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="nPz-v9-2Hf">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="d1g-j2-WoU">
<!--Settings-->
<scene sceneID="VQ2-cn-Fx7">
<objects>
<viewController id="qsz-un-vmO" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="nNR-vE-ia0">
<tableViewController id="Eo5-uY-RMZ" customClass="SettingsViewController" customModule="Area51" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="static" style="grouped" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="18" sectionFooterHeight="18" id="kc4-rX-juZ">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<viewLayoutGuide key="safeArea" id="ExP-B8-pt7"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="vRc-bI-88X" userLabel="First Responder" sceneMemberID="firstResponder"/>
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
<sections>
<tableViewSection headerTitle="About Area51" id="f3j-yG-cjY">
<cells>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" textLabel="u0c-pf-pqJ" style="IBUITableViewCellStyleDefault" id="jsq-70-ivb">
<rect key="frame" x="0.0" y="55.5" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="jsq-70-ivb" id="KTj-hy-lH5">
<rect key="frame" x="0.0" y="0.0" width="341" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="Changelog" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="u0c-pf-pqJ">
<rect key="frame" x="16" y="0.0" width="324" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" textLabel="Czj-3c-a2T" style="IBUITableViewCellStyleDefault" id="O4I-0v-VEC">
<rect key="frame" x="0.0" y="99.5" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="O4I-0v-VEC" id="58Z-lO-ZNu">
<rect key="frame" x="0.0" y="0.0" width="341" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="Contributors" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Czj-3c-a2T">
<rect key="frame" x="16" y="0.0" width="324" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" textLabel="Yt5-E8-s0B" style="IBUITableViewCellStyleDefault" id="5zc-hU-CW6">
<rect key="frame" x="0.0" y="143.5" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="5zc-hU-CW6" id="r3c-d1-8It">
<rect key="frame" x="0.0" y="0.0" width="341" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="GitHub" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Yt5-E8-s0B">
<rect key="frame" x="16" y="0.0" width="324" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
</tableViewCell>
</cells>
</tableViewSection>
</sections>
<connections>
<outlet property="dataSource" destination="Eo5-uY-RMZ" id="r9C-We-znz"/>
<outlet property="delegate" destination="Eo5-uY-RMZ" id="U3R-h3-hWc"/>
</connections>
</tableView>
<navigationItem key="navigationItem" title="Settings" id="b6G-ei-qQc"/>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="qDM-i8-VPR" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="65" y="138"/>
<point key="canvasLocation" x="2564" y="-49.025487256371818"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="eHK-FY-DDD">
<objects>
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="nPz-v9-2Hf" sceneMemberID="viewController">
<toolbarItems/>
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="giY-Ub-n5h">
<rect key="frame" x="0.0" y="20" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<nil name="viewControllers"/>
<connections>
<segue destination="Eo5-uY-RMZ" kind="relationship" relationship="rootViewController" id="YpN-f7-seS"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="ew8-vZ-FkP" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1624.8" y="-49.025487256371818"/>
</scene>
</scenes>
</document>
18 changes: 18 additions & 0 deletions Area51/Sources/SettingsViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import UIKit
import SafariServices

class SettingsViewController: UITableViewController {

override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
switch indexPath.row {
case 0:
let changelogURL = "/~https://github.com/kgellci/Area51/blob/master/CHANGELOG.md"
guard let url = URL(string: changelogURL) else {
fatalError()
}
present(SFSafariViewController(url: url), animated: true)
default:
print("default")
}
}
}

0 comments on commit 55d0381

Please sign in to comment.