Browse Source

Development

master
Dwayne Harris 6 years ago
parent
commit
321e76f29c
  1. 5
      elpha-ios/AttachmentsManager.swift
  2. 168
      elpha-ios/Base.lproj/Main.storyboard
  3. 3
      elpha-ios/Elpha.xcdatamodeld/Elpha.xcdatamodel/contents
  4. 8
      elpha-ios/MainStatusTableViewCell.swift
  5. 5
      elpha-ios/MastodonAPI.swift
  6. 1
      elpha-ios/MastodonDataManager.swift
  7. 73
      elpha-ios/StatusTableViewController.swift
  8. 3
      elpha-ios/StatusView.swift
  9. 80
      elpha-ios/StatusView.xib
  10. 5
      elpha-ios/TimelineTableViewController.swift
  11. 12
      elpha-ios/TimelinesTableViewController.swift

5
elpha-ios/AttachmentsManager.swift

@ -15,7 +15,6 @@ class AttachmentsManager {
return
}
let placeholderImage = UIImage(named: "Help")
let halfWidth = (view.frame.width / 2) - 1
for subview in view.subviews as [UIView] {
@ -34,7 +33,6 @@ class AttachmentsManager {
imageView.contentMode = UIImageView.ContentMode.scaleAspectFill
imageView.af_setImage(
withURL: attachment.url!,
placeholderImage: placeholderImage,
filter: filter
)
@ -59,7 +57,6 @@ class AttachmentsManager {
imageView.contentMode = UIImageView.ContentMode.scaleAspectFill
imageView.af_setImage(
withURL: (attachments[index] as! AttachmentMO).url!,
placeholderImage: placeholderImage,
filter: filter
)
@ -91,7 +88,6 @@ class AttachmentsManager {
imageView.contentMode = UIImageView.ContentMode.scaleAspectFill
imageView.af_setImage(
withURL: (attachments[index] as! AttachmentMO).url!,
placeholderImage: placeholderImage,
filter: index == 0 ? primaryFilter : secondaryFilter
)
@ -132,7 +128,6 @@ class AttachmentsManager {
imageView.contentMode = UIImageView.ContentMode.scaleAspectFill
imageView.af_setImage(
withURL: (attachments[index] as! AttachmentMO).url!,
placeholderImage: placeholderImage,
filter: filter
)

168
elpha-ios/Base.lproj/Main.storyboard

@ -741,10 +741,10 @@
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" largeTitles="YES" id="MdH-tW-gfk">
<rect key="frame" x="0.0" y="44" width="414" height="96"/>
<autoresizingMask key="autoresizingMask"/>
<color key="tintColor" name="Text"/>
<color key="tintColor" red="0.090196078430000007" green="0.047058823530000002" blue="0.28627450980000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="barTintColor" name="Secondary"/>
<textAttributes key="titleTextAttributes">
<color key="textColor" name="Text"/>
<color key="textColor" red="0.090196078430000007" green="0.047058823530000002" blue="0.28627450980000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</textAttributes>
<textAttributes key="largeTitleTextAttributes">
<color key="textColor" red="0.090196078430000007" green="0.047058823530000002" blue="0.28627450980000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@ -879,15 +879,15 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="MainStatusTableViewCell" rowHeight="200" id="8ys-Fm-1Yg" customClass="MainStatusTableViewCell" customModule="elpha_ios" customModuleProvider="target">
<rect key="frame" x="0.0" y="55.5" width="414" height="200"/>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="MainStatusTableViewCell" rowHeight="245" id="8ys-Fm-1Yg" customClass="MainStatusTableViewCell" customModule="elpha_ios" customModuleProvider="target">
<rect key="frame" x="0.0" y="55.5" width="414" height="245"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="8ys-Fm-1Yg" id="Hj7-kC-H7L">
<rect key="frame" x="0.0" y="0.0" width="414" height="200"/>
<rect key="frame" x="0.0" y="0.0" width="414" height="245"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="7I8-6E-s1Q">
<rect key="frame" x="20" y="11" width="374" height="60"/>
<rect key="frame" x="20" y="21" width="374" height="60"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="LHS-vw-fZE">
<rect key="frame" x="0.0" y="0.0" width="55" height="55"/>
@ -897,14 +897,14 @@
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Display Name" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="vDe-e6-p1i">
<rect key="frame" x="63" y="0.0" width="303" height="24"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="20"/>
<rect key="frame" x="63" y="0.0" width="303" height="23"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="19"/>
<color key="textColor" name="Text"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Username" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="8fE-Hr-jgf">
<rect key="frame" x="63" y="26" width="303" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<rect key="frame" x="63" y="25" width="303" height="19.5"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" name="Primary"/>
<nil key="highlightedColor"/>
</label>
@ -923,31 +923,156 @@
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Content" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="AT3-0d-kQ3">
<rect key="frame" x="20" y="86" width="374" height="95"/>
<rect key="frame" x="20" y="96" width="374" height="100"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" name="Text"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="C8A-x8-8TG">
<rect key="frame" x="20" y="204" width="160" height="30"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Clock" translatesAutoresizingMaskIntoConstraints="NO" id="me9-4K-dS0">
<rect key="frame" x="0.0" y="7.5" width="15" height="15"/>
<constraints>
<constraint firstAttribute="height" constant="15" id="5dr-8g-kIx"/>
<constraint firstAttribute="width" constant="15" id="k1I-ba-8Nj"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Timestamp" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="peo-RN-z7p">
<rect key="frame" x="23" y="7.5" width="137" height="15"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" name="Text"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="me9-4K-dS0" firstAttribute="centerY" secondItem="C8A-x8-8TG" secondAttribute="centerY" id="Ptv-cd-e1w"/>
<constraint firstItem="peo-RN-z7p" firstAttribute="centerY" secondItem="C8A-x8-8TG" secondAttribute="centerY" id="ePa-f9-Qd5"/>
<constraint firstAttribute="trailing" secondItem="peo-RN-z7p" secondAttribute="trailing" id="fZX-tG-y6E"/>
<constraint firstAttribute="height" constant="30" id="hls-KD-1cF"/>
<constraint firstAttribute="width" constant="160" id="mLk-eo-x6G"/>
<constraint firstItem="peo-RN-z7p" firstAttribute="leading" secondItem="me9-4K-dS0" secondAttribute="trailing" constant="8" id="qjg-WR-UCo"/>
<constraint firstItem="me9-4K-dS0" firstAttribute="leading" secondItem="C8A-x8-8TG" secondAttribute="leading" id="yO3-ig-Jeh"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Iqe-xC-DYy">
<rect key="frame" x="266" y="204" width="60" height="30"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="100" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="3Ew-31-ZWY">
<rect key="frame" x="34" y="6.5" width="26" height="17"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="14"/>
<color key="textColor" name="Primary"/>
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Boost Regular" translatesAutoresizingMaskIntoConstraints="NO" id="X4x-5e-3Ms">
<rect key="frame" x="12" y="6" width="14" height="18"/>
<constraints>
<constraint firstAttribute="height" constant="18" id="7mC-UE-wq5"/>
<constraint firstAttribute="width" constant="14" id="pwT-kW-wpk"/>
</constraints>
</imageView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="3Ew-31-ZWY" secondAttribute="trailing" id="3Jq-Ho-6AR"/>
<constraint firstAttribute="height" constant="30" id="FpV-XH-nDq"/>
<constraint firstItem="X4x-5e-3Ms" firstAttribute="centerY" secondItem="Iqe-xC-DYy" secondAttribute="centerY" id="GU3-Ll-dxY"/>
<constraint firstItem="3Ew-31-ZWY" firstAttribute="leading" secondItem="X4x-5e-3Ms" secondAttribute="trailing" constant="8" id="Gvp-jb-2L8"/>
<constraint firstItem="3Ew-31-ZWY" firstAttribute="centerY" secondItem="Iqe-xC-DYy" secondAttribute="centerY" id="MhK-X2-0ah"/>
<constraint firstAttribute="width" constant="60" id="zXz-Dr-CWl"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9oD-Y0-ilp">
<rect key="frame" x="334" y="204" width="60" height="30"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="100" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Tch-E4-Saw">
<rect key="frame" x="26" y="6.5" width="26" height="17"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="14"/>
<color key="textColor" name="Primary"/>
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Star Regular" translatesAutoresizingMaskIntoConstraints="NO" id="B1s-Wp-hBJ">
<rect key="frame" x="3" y="7.5" width="15" height="15"/>
<constraints>
<constraint firstAttribute="height" constant="15" id="cf2-O1-ELz"/>
<constraint firstAttribute="width" constant="15" id="kiV-NO-p9O"/>
</constraints>
</imageView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="width" constant="60" id="Re8-4t-uoD"/>
<constraint firstAttribute="trailing" secondItem="Tch-E4-Saw" secondAttribute="trailing" constant="8" id="Xty-RA-yBl"/>
<constraint firstItem="Tch-E4-Saw" firstAttribute="centerY" secondItem="9oD-Y0-ilp" secondAttribute="centerY" id="bhF-Xx-ZDe"/>
<constraint firstItem="Tch-E4-Saw" firstAttribute="leading" secondItem="B1s-Wp-hBJ" secondAttribute="trailing" constant="8" id="lvb-ix-ZAw"/>
<constraint firstItem="B1s-Wp-hBJ" firstAttribute="centerY" secondItem="9oD-Y0-ilp" secondAttribute="centerY" id="oWq-Qe-VMg"/>
<constraint firstAttribute="height" constant="30" id="xLI-sT-SnC"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="FZi-le-bmF">
<rect key="frame" x="198" y="204" width="60" height="30"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="100" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="06U-FB-yto">
<rect key="frame" x="34" y="6.5" width="26" height="17"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="14"/>
<color key="textColor" name="Primary"/>
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Message" translatesAutoresizingMaskIntoConstraints="NO" id="Jcf-Cv-8ki">
<rect key="frame" x="11" y="7.5" width="15" height="15"/>
<constraints>
<constraint firstAttribute="width" constant="15" id="Vdk-0O-uij"/>
<constraint firstAttribute="height" constant="15" id="iPv-15-UbD"/>
</constraints>
</imageView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="06U-FB-yto" firstAttribute="leading" secondItem="Jcf-Cv-8ki" secondAttribute="trailing" constant="8" id="7La-R0-13y"/>
<constraint firstItem="06U-FB-yto" firstAttribute="centerY" secondItem="FZi-le-bmF" secondAttribute="centerY" id="HSO-JX-hg7"/>
<constraint firstAttribute="width" constant="60" id="Rnk-TV-JDR"/>
<constraint firstAttribute="height" constant="30" id="X8V-nT-8Ue"/>
<constraint firstItem="Jcf-Cv-8ki" firstAttribute="centerY" secondItem="FZi-le-bmF" secondAttribute="centerY" id="Zzj-qQ-SrD"/>
<constraint firstAttribute="trailing" secondItem="06U-FB-yto" secondAttribute="trailing" id="uJ8-JC-1Ql"/>
</constraints>
</view>
</subviews>
<constraints>
<constraint firstAttribute="trailingMargin" secondItem="7I8-6E-s1Q" secondAttribute="trailing" id="5hL-Ma-O1w"/>
<constraint firstAttribute="trailingMargin" secondItem="AT3-0d-kQ3" secondAttribute="trailing" id="6Wd-QF-Ar9"/>
<constraint firstItem="7I8-6E-s1Q" firstAttribute="leading" secondItem="Hj7-kC-H7L" secondAttribute="leadingMargin" id="7SB-qd-J9a"/>
<constraint firstAttribute="bottomMargin" secondItem="AT3-0d-kQ3" secondAttribute="bottom" constant="8" id="BXc-hI-FGC"/>
<constraint firstItem="7I8-6E-s1Q" firstAttribute="top" secondItem="Hj7-kC-H7L" secondAttribute="topMargin" id="LFk-zl-zWh"/>
<constraint firstAttribute="bottomMargin" secondItem="Iqe-xC-DYy" secondAttribute="bottom" id="8ha-tf-hUF"/>
<constraint firstItem="9oD-Y0-ilp" firstAttribute="trailing" secondItem="Hj7-kC-H7L" secondAttribute="trailingMargin" id="G9j-ww-Gdd"/>
<constraint firstItem="Iqe-xC-DYy" firstAttribute="leading" secondItem="FZi-le-bmF" secondAttribute="trailing" constant="8" id="LAx-si-6tE"/>
<constraint firstItem="7I8-6E-s1Q" firstAttribute="top" secondItem="Hj7-kC-H7L" secondAttribute="topMargin" constant="10" id="LFk-zl-zWh"/>
<constraint firstAttribute="bottomMargin" secondItem="C8A-x8-8TG" secondAttribute="bottom" id="P1P-t1-WWV"/>
<constraint firstItem="C8A-x8-8TG" firstAttribute="leading" secondItem="Hj7-kC-H7L" secondAttribute="leadingMargin" id="RQp-9M-JGO"/>
<constraint firstItem="9oD-Y0-ilp" firstAttribute="leading" secondItem="Iqe-xC-DYy" secondAttribute="trailing" constant="8" id="aEe-hr-rkn"/>
<constraint firstAttribute="bottomMargin" secondItem="FZi-le-bmF" secondAttribute="bottom" id="b5a-AF-czf"/>
<constraint firstItem="9oD-Y0-ilp" firstAttribute="leading" secondItem="Iqe-xC-DYy" secondAttribute="trailing" constant="8" id="eK7-1F-CoL"/>
<constraint firstItem="C8A-x8-8TG" firstAttribute="top" secondItem="AT3-0d-kQ3" secondAttribute="bottom" constant="8" id="iS5-Sb-byC"/>
<constraint firstAttribute="bottomMargin" secondItem="9oD-Y0-ilp" secondAttribute="bottom" id="jti-av-CLh"/>
<constraint firstItem="AT3-0d-kQ3" firstAttribute="leading" secondItem="Hj7-kC-H7L" secondAttribute="leadingMargin" id="uff-zi-rPT"/>
<constraint firstItem="AT3-0d-kQ3" firstAttribute="top" secondItem="7I8-6E-s1Q" secondAttribute="bottom" constant="15" id="xNg-ZQ-vkn"/>
</constraints>
</tableViewCellContentView>
<connections>
<outlet property="avatarImageView" destination="LHS-vw-fZE" id="PpS-hb-Hes"/>
<outlet property="boostsImageView" destination="X4x-5e-3Ms" id="dxE-vb-Ctp"/>
<outlet property="boostsLabel" destination="3Ew-31-ZWY" id="Nc5-8A-0tr"/>
<outlet property="contentLabel" destination="AT3-0d-kQ3" id="c7N-3x-fJ9"/>
<outlet property="displayNameLabel" destination="vDe-e6-p1i" id="jxi-k7-Zll"/>
<outlet property="favoritesImageView" destination="B1s-Wp-hBJ" id="hPe-xy-EsI"/>
<outlet property="favoritesLabel" destination="Tch-E4-Saw" id="lly-D4-fkY"/>
<outlet property="repliesImageView" destination="Jcf-Cv-8ki" id="4Ie-E4-Re9"/>
<outlet property="repliesLabel" destination="06U-FB-yto" id="h7Y-aI-h91"/>
<outlet property="timestampLabel" destination="peo-RN-z7p" id="zM1-lG-G9p"/>
<outlet property="usernameLabel" destination="8fE-Hr-jgf" id="hiJ-he-cm4"/>
</connections>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="StatusTableViewCell" rowHeight="120" id="cLF-Rc-b4K" customClass="StatusTableViewCell" customModule="elpha_ios" customModuleProvider="target">
<rect key="frame" x="0.0" y="255.5" width="414" height="120"/>
<rect key="frame" x="0.0" y="300.5" width="414" height="120"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="cLF-Rc-b4K" id="jhE-cB-Cj1">
<rect key="frame" x="0.0" y="0.0" width="414" height="120"/>
@ -1000,10 +1125,10 @@
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" largeTitles="YES" id="QFN-sS-62X">
<rect key="frame" x="0.0" y="44" width="414" height="96"/>
<autoresizingMask key="autoresizingMask"/>
<color key="tintColor" name="Text"/>
<color key="tintColor" red="0.090196078430000007" green="0.047058823530000002" blue="0.28627450980000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="barTintColor" name="Secondary"/>
<textAttributes key="titleTextAttributes">
<color key="textColor" name="Text"/>
<color key="textColor" red="0.090196078430000007" green="0.047058823530000002" blue="0.28627450980000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</textAttributes>
<textAttributes key="largeTitleTextAttributes">
<color key="textColor" red="0.090196078430000007" green="0.047058823530000002" blue="0.28627450980000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@ -1027,10 +1152,10 @@
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" largeTitles="YES" id="5mb-Wh-DRp">
<rect key="frame" x="0.0" y="44" width="414" height="96"/>
<autoresizingMask key="autoresizingMask"/>
<color key="tintColor" name="Text"/>
<color key="tintColor" red="0.090196078430000007" green="0.047058823530000002" blue="0.28627450980000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="barTintColor" name="Secondary"/>
<textAttributes key="titleTextAttributes">
<color key="textColor" name="Text"/>
<color key="textColor" red="0.090196078430000007" green="0.047058823530000002" blue="0.28627450980000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</textAttributes>
<textAttributes key="largeTitleTextAttributes">
<color key="textColor" red="0.090196078430000007" green="0.047058823530000002" blue="0.28627450980000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@ -1048,9 +1173,13 @@
</scenes>
<resources>
<image name="Account" width="25" height="25"/>
<image name="Boost Regular" width="20" height="24"/>
<image name="Clock" width="22" height="22"/>
<image name="Globe" width="22" height="22"/>
<image name="Instance Placeholder" width="135" height="135"/>
<image name="Logo" width="400" height="400"/>
<image name="Message" width="20" height="20"/>
<image name="Star Regular" width="22" height="22"/>
<image name="Timelines" width="25" height="25"/>
<namedColor name="Primary">
<color red="0.54117647058823526" green="0.4823529411764706" blue="0.68235294117647061" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@ -1061,8 +1190,5 @@
<namedColor name="Text">
<color red="0.090196078431372548" green="0.047058823529411764" blue="0.28627450980392155" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="Text">
<color red="0.090196078431372548" green="0.047058823529411764" blue="0.28627450980392155" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
</resources>
</document>

3
elpha-ios/Elpha.xcdatamodeld/Elpha.xcdatamodel/contents

@ -119,6 +119,7 @@
<attribute name="pinned" optional="YES" attributeType="Boolean" usesScalarValueType="YES" syncable="YES"/>
<attribute name="reblogged" optional="YES" attributeType="Boolean" usesScalarValueType="YES" syncable="YES"/>
<attribute name="reblogsCount" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
<attribute name="repliesCount" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
<attribute name="sensitive" optional="YES" attributeType="Boolean" usesScalarValueType="YES" syncable="YES"/>
<attribute name="spoilerText" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="uri" attributeType="URI" syncable="YES"/>
@ -157,7 +158,7 @@
<element name="ISInstance" positionX="-18" positionY="153" width="128" height="450"/>
<element name="ISLanguage" positionX="-286.21875" positionY="512.6171875" width="128" height="75"/>
<element name="Session" positionX="-445.046875" positionY="277.31640625" width="128" height="150"/>
<element name="Status" positionX="-459" positionY="216" width="128" height="480"/>
<element name="Status" positionX="-459" positionY="216" width="128" height="495"/>
<element name="Tag" positionX="-432" positionY="243" width="128" height="90"/>
<element name="Timeline" positionX="-468" positionY="207" width="128" height="150"/>
</elements>

8
elpha-ios/MainStatusTableViewCell.swift

@ -13,5 +13,11 @@ class MainStatusTableViewCell: UITableViewCell {
@IBOutlet var displayNameLabel: UILabel!
@IBOutlet var usernameLabel: UILabel!
@IBOutlet var contentLabel: UILabel!
@IBOutlet var timestampLabel: UILabel!
@IBOutlet var repliesImageView: UIImageView!
@IBOutlet var repliesLabel: UILabel!
@IBOutlet var boostsImageView: UIImageView!
@IBOutlet var boostsLabel: UILabel!
@IBOutlet var favoritesImageView: UIImageView!
@IBOutlet var favoritesLabel: UILabel!
}

5
elpha-ios/MastodonAPI.swift

@ -221,7 +221,7 @@ class MastodonAPI {
"limit": limit ?? 20,
]
self.request(path: "api/v1/timelines/home", method: .get, parameters: parameters, pagination: pagination) { data, pagination, error in
self.request(path: "api/v1/timelines/public", method: .get, parameters: parameters, pagination: pagination) { data, pagination, error in
guard error == nil else {
completion(nil, nil, error)
return
@ -232,6 +232,7 @@ class MastodonAPI {
}
static func tagTimeline(
tag: String,
local: Bool,
limit: Int?,
pagination: PaginationItem?,
@ -242,7 +243,7 @@ class MastodonAPI {
"limit": limit ?? 20,
]
self.request(path: "api/v1/timelines/home", method: .get, parameters: parameters, pagination: pagination) { data, pagination, error in
self.request(path: "api/v1/timelines/tag/\(tag)", method: .get, parameters: parameters, pagination: pagination) { data, pagination, error in
guard error == nil else {
completion(nil, nil, error)
return

1
elpha-ios/MastodonDataManager.swift

@ -292,6 +292,7 @@ public class MastodonDataManager {
status.inReplyToAccountID = data["in_reply_to_account_id"] as? String
status.content = data["content"] as? String
status.createdAt = dateFormatter.date(from: data["created_at"] as! String)
status.repliesCount = data["replies_count"] as! Int32
status.reblogsCount = data["reblogs_count"] as! Int32
status.favoritesCount = data["favourites_count"] as! Int32
status.reblogged = data["reblogged"] as? Bool ?? false

73
elpha-ios/StatusTableViewController.swift

@ -11,14 +11,13 @@ import CoreData
import UIKit
enum StatusType {
case ancestor
case status
case descendant
case ancestor, status, descendant
}
class StatusTableViewController: UITableViewController {
public var status: StatusMO? = nil
private var statuses: Dictionary<StatusType, [StatusMO]> = [:]
var ancestors: [StatusMO] = []
var descendants: [StatusMO] = []
var loading: Bool = false {
didSet {
@ -106,16 +105,19 @@ class StatusTableViewController: UITableViewController {
NSSortDescriptor(key: "createdAt", ascending: false),
]
ancestors = []
descendants = []
do {
let statuses = try CoreDataManager.shared.context.fetch(request)
self.statuses = Dictionary(grouping: statuses) { s -> StatusType in
statuses.forEach { s in
switch s.createdAt!.compare(status.createdAt!) {
case .orderedAscending:
return .ancestor
ancestors.append(s)
case .orderedSame:
return .status
return
case .orderedDescending:
return .descendant
descendants.append(s)
}
}
} catch {
@ -126,31 +128,35 @@ class StatusTableViewController: UITableViewController {
extension StatusTableViewController {
override func numberOfSections(in tableView: UITableView) -> Int {
return statuses.count
return 3
}
override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
if statuses.count == 1 {
return nil
}
switch Array(statuses.keys)[section] {
case .status:
return "Toot"
case .ancestor:
return "In Reply To"
case .descendant:
return "Replies"
switch section {
case 0: return ancestors.count > 0 ? "In Reply To" : nil
case 1: return "Toot"
case 2: return descendants.count > 0 ? "Replies" : nil
default: return nil
}
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return Array(statuses.values)[section].count
switch section {
case 0: return ancestors.count
case 1: return 1
case 2: return descendants.count
default: return 0
}
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let statuses = Array(self.statuses.values)[indexPath.section]
let status = statuses[indexPath.row]
var status: StatusMO
switch indexPath.section {
case 0: status = self.ancestors[indexPath.row]
case 1: status = self.status!
case 2: status = self.descendants[indexPath.row]
default: fatalError("")
}
if status == self.status {
guard let cell = tableView.dequeueReusableCell(withIdentifier: "MainStatusTableViewCell", for: indexPath) as? MainStatusTableViewCell else {
@ -192,6 +198,27 @@ extension StatusTableViewController {
}
}
let dateFormatter = DateFormatter()
dateFormatter.dateStyle = .medium
dateFormatter.timeStyle = .medium
cell.timestampLabel.text = dateFormatter.string(from: status.createdAt!)
cell.repliesLabel.text = NumberFormatter.localizedString(from: NSNumber(value: status.repliesCount), number: .decimal)
cell.boostsLabel.text = NumberFormatter.localizedString(from: NSNumber(value: status.reblogsCount), number: .decimal)
cell.favoritesLabel.text = NumberFormatter.localizedString(from: NSNumber(value: status.favoritesCount), number: .decimal)
if status.reblogged {
cell.boostsImageView.image = UIImage(named: "Boost Bold")
} else {
cell.boostsImageView.image = UIImage(named: "Boost Regular")
}
if status.favorited {
cell.favoritesImageView.image = UIImage(named: "Star Filled")
} else {
cell.favoritesImageView.image = UIImage(named: "Star Regular")
}
return cell
} else {
guard let cell = tableView.dequeueReusableCell(withIdentifier: "StatusTableViewCell", for: indexPath) as? StatusTableViewCell else {

3
elpha-ios/StatusView.swift

@ -38,7 +38,6 @@ class StatusView: UIView {
@IBOutlet var topDividerView: UIView!
@IBOutlet var bottomDividerView: UIView!
@IBOutlet var attachmentsView: UIView!
@IBOutlet var attachmentsHeightConstraint: NSLayoutConstraint!
var status: StatusMO? = nil
var delegate: StatusViewDelegate? = nil
@ -164,7 +163,7 @@ class StatusView: UIView {
}
timestampLabel.text = status.createdAt!.timeAgo()
repliesLabel.text = "0"
repliesLabel.text = NumberFormatter.localizedString(from: NSNumber(value: status.repliesCount), number: .decimal)
boostsLabel.text = NumberFormatter.localizedString(from: NSNumber(value: status.reblogsCount), number: .decimal)
favoritesLabel.text = NumberFormatter.localizedString(from: NSNumber(value: status.favoritesCount), number: .decimal)

80
elpha-ios/StatusView.xib

@ -56,27 +56,27 @@
<rect key="frame" x="0.0" y="5" width="375" height="100"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="ecc-6t-6K0">
<rect key="frame" x="8" y="18" width="40" height="40"/>
<rect key="frame" x="8" y="20" width="40" height="40"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="IbJ-fQ-bcS"/>
<constraint firstAttribute="width" constant="40" id="nrC-ZI-HsS"/>
</constraints>
</imageView>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Boost Regular" translatesAutoresizingMaskIntoConstraints="NO" id="sQQ-h7-F55">
<rect key="frame" x="56" y="60" width="12" height="16"/>
<rect key="frame" x="56" y="62" width="12" height="16"/>
<constraints>
<constraint firstAttribute="width" constant="12" id="Ood-WU-dwu"/>
<constraint firstAttribute="height" constant="16" id="g47-ik-dJ8"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Display Name" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="kjf-lJ-8Md">
<rect key="frame" x="56" y="18" width="311" height="18"/>
<rect key="frame" x="56" y="20" width="311" height="18"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
<color key="textColor" name="Text"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Username" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="PKb-3W-PjE">
<rect key="frame" x="56" y="40" width="311" height="16"/>
<rect key="frame" x="56" y="42" width="311" height="16"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" name="Primary"/>
<nil key="highlightedColor"/>
@ -89,7 +89,7 @@
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Boosted" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="GZD-6a-olN">
<rect key="frame" x="76" y="60" width="291" height="14.5"/>
<rect key="frame" x="76" y="62" width="291" height="14.5"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" name="Text"/>
<nil key="highlightedColor"/>
@ -102,7 +102,7 @@
<constraint firstItem="PKb-3W-PjE" firstAttribute="top" secondItem="kjf-lJ-8Md" secondAttribute="bottom" constant="4" id="1Vq-cG-Iwz"/>
<constraint firstAttribute="trailing" secondItem="GZD-6a-olN" secondAttribute="trailing" constant="8" id="3dS-nf-Udy"/>
<constraint firstItem="sQQ-h7-F55" firstAttribute="top" secondItem="PKb-3W-PjE" secondAttribute="bottom" constant="4" id="4kw-SG-XmK"/>
<constraint firstItem="kjf-lJ-8Md" firstAttribute="top" secondItem="Gnt-jG-tVj" secondAttribute="top" constant="18" id="CBL-Vu-qpE"/>
<constraint firstItem="kjf-lJ-8Md" firstAttribute="top" secondItem="Gnt-jG-tVj" secondAttribute="top" constant="20" id="CBL-Vu-qpE"/>
<constraint firstAttribute="bottom" secondItem="8qF-OR-rh0" secondAttribute="bottom" constant="5" id="Fkc-5w-VFp"/>
<constraint firstItem="GZD-6a-olN" firstAttribute="leading" secondItem="sQQ-h7-F55" secondAttribute="trailing" constant="8" id="IWI-G8-Tag"/>
<constraint firstAttribute="trailing" secondItem="8qF-OR-rh0" secondAttribute="trailing" constant="20" id="QGf-xK-ycr"/>
@ -110,11 +110,11 @@
<constraint firstItem="kjf-lJ-8Md" firstAttribute="leading" secondItem="ecc-6t-6K0" secondAttribute="trailing" constant="8" id="coM-BH-5hw"/>
<constraint firstAttribute="trailing" secondItem="kjf-lJ-8Md" secondAttribute="trailing" constant="8" id="h2a-qg-TLX"/>
<constraint firstItem="ecc-6t-6K0" firstAttribute="leading" secondItem="Gnt-jG-tVj" secondAttribute="leading" constant="8" id="jQc-6S-2dp"/>
<constraint firstAttribute="height" constant="100" id="lZR-wt-QGT"/>
<constraint firstAttribute="height" priority="999" constant="100" id="lZR-wt-QGT"/>
<constraint firstItem="8qF-OR-rh0" firstAttribute="leading" secondItem="Gnt-jG-tVj" secondAttribute="leading" constant="20" id="laO-Ap-fRA"/>
<constraint firstAttribute="trailing" secondItem="PKb-3W-PjE" secondAttribute="trailing" constant="8" id="sMN-aQ-WvE"/>
<constraint firstItem="PKb-3W-PjE" firstAttribute="leading" secondItem="ecc-6t-6K0" secondAttribute="trailing" constant="8" id="tY8-yq-mRV"/>
<constraint firstItem="ecc-6t-6K0" firstAttribute="top" secondItem="Gnt-jG-tVj" secondAttribute="top" constant="18" id="vVq-Ij-dgg"/>
<constraint firstItem="ecc-6t-6K0" firstAttribute="top" secondItem="Gnt-jG-tVj" secondAttribute="top" constant="20" id="vVq-Ij-dgg"/>
</constraints>
<connections>
<outletCollection property="gestureRecognizers" destination="2h0-to-AXg" appends="YES" id="ZUZ-hR-mUu"/>
@ -124,27 +124,27 @@
<rect key="frame" x="0.0" y="105" width="375" height="100"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="wte-HK-KxR">
<rect key="frame" x="8" y="18" width="40" height="40"/>
<rect key="frame" x="8" y="20" width="40" height="40"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="LeJ-eE-S7V"/>
<constraint firstAttribute="width" constant="40" id="P3M-g5-nKe"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="In reply to" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="nUk-PT-X4k">
<rect key="frame" x="76" y="18" width="291" height="14.5"/>
<rect key="frame" x="76" y="20" width="291" height="14.5"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" name="Text"/>
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Message" translatesAutoresizingMaskIntoConstraints="NO" id="a3a-oY-yKW">
<rect key="frame" x="56" y="20" width="12" height="12"/>
<rect key="frame" x="56" y="22" width="12" height="12"/>
<constraints>
<constraint firstAttribute="height" constant="12" id="0bj-Cu-Rc1"/>
<constraint firstAttribute="width" constant="12" id="euI-Zh-aax"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Display Name" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="nfb-4h-YH9">
<rect key="frame" x="56" y="36.5" width="311" height="18"/>
<rect key="frame" x="56" y="38.5" width="311" height="18"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
<color key="textColor" name="Text"/>
<nil key="highlightedColor"/>
@ -157,7 +157,7 @@
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Username" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="odK-vM-y2x">
<rect key="frame" x="56" y="58.5" width="311" height="16"/>
<rect key="frame" x="56" y="60.5" width="311" height="16"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" name="Primary"/>
<nil key="highlightedColor"/>
@ -170,19 +170,19 @@
<constraint firstAttribute="trailing" secondItem="odK-vM-y2x" secondAttribute="trailing" constant="8" id="5Tx-XP-O1i"/>
<constraint firstAttribute="trailing" secondItem="LZx-68-NPT" secondAttribute="trailing" constant="20" id="5YG-WP-25F"/>
<constraint firstItem="LZx-68-NPT" firstAttribute="leading" secondItem="v8x-tf-zFb" secondAttribute="leading" constant="20" id="AHJ-Pj-BiL"/>
<constraint firstAttribute="height" constant="100" id="AWu-MG-wTp"/>
<constraint firstAttribute="height" priority="999" constant="100" id="AWu-MG-wTp"/>
<constraint firstAttribute="bottom" secondItem="LZx-68-NPT" secondAttribute="bottom" constant="5" id="HEJ-cP-5zi"/>
<constraint firstItem="odK-vM-y2x" firstAttribute="top" secondItem="nfb-4h-YH9" secondAttribute="bottom" constant="4" id="L4F-DE-JR4"/>
<constraint firstItem="a3a-oY-yKW" firstAttribute="top" secondItem="v8x-tf-zFb" secondAttribute="top" constant="20" id="O2o-q9-oXD"/>
<constraint firstItem="a3a-oY-yKW" firstAttribute="top" secondItem="v8x-tf-zFb" secondAttribute="top" constant="22" id="O2o-q9-oXD"/>
<constraint firstItem="nfb-4h-YH9" firstAttribute="leading" secondItem="wte-HK-KxR" secondAttribute="trailing" constant="8" id="e7z-3X-jtV"/>
<constraint firstItem="odK-vM-y2x" firstAttribute="leading" secondItem="nfb-4h-YH9" secondAttribute="leading" id="hlj-cJ-Vzl"/>
<constraint firstItem="a3a-oY-yKW" firstAttribute="leading" secondItem="wte-HK-KxR" secondAttribute="trailing" constant="8" id="lHy-4g-lo7"/>
<constraint firstItem="wte-HK-KxR" firstAttribute="top" secondItem="v8x-tf-zFb" secondAttribute="top" constant="18" id="lk4-I6-hHF"/>
<constraint firstItem="wte-HK-KxR" firstAttribute="top" secondItem="v8x-tf-zFb" secondAttribute="top" constant="20" id="lk4-I6-hHF"/>
<constraint firstItem="nUk-PT-X4k" firstAttribute="leading" secondItem="a3a-oY-yKW" secondAttribute="trailing" constant="8" id="tBU-v4-n6i"/>
<constraint firstItem="nfb-4h-YH9" firstAttribute="top" secondItem="nUk-PT-X4k" secondAttribute="bottom" constant="4" id="ujU-iI-iTs"/>
<constraint firstAttribute="trailing" secondItem="nUk-PT-X4k" secondAttribute="trailing" constant="8" id="xjW-PF-58w"/>
<constraint firstItem="wte-HK-KxR" firstAttribute="leading" secondItem="v8x-tf-zFb" secondAttribute="leading" constant="8" id="ySO-Mc-5ZM"/>
<constraint firstItem="nUk-PT-X4k" firstAttribute="top" secondItem="v8x-tf-zFb" secondAttribute="top" constant="18" id="z5T-Ab-FJ7"/>
<constraint firstItem="nUk-PT-X4k" firstAttribute="top" secondItem="v8x-tf-zFb" secondAttribute="top" constant="20" id="z5T-Ab-FJ7"/>
</constraints>
<connections>
<outletCollection property="gestureRecognizers" destination="boj-gN-Kcz" appends="YES" id="0NB-Ml-hxN"/>
@ -201,20 +201,20 @@
<rect key="frame" x="0.0" y="8" width="367" height="70"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="i10-Gq-NR9">
<rect key="frame" x="8" y="8" width="45" height="45"/>
<rect key="frame" x="8" y="10" width="45" height="45"/>
<constraints>
<constraint firstAttribute="height" constant="45" id="PGv-cY-D3o"/>
<constraint firstAttribute="width" constant="45" id="mbX-uR-bvo"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Display Name" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="a9Z-2P-cZT">
<rect key="frame" x="61" y="8" width="298" height="20.5"/>
<rect key="frame" x="61" y="10" width="298" height="20.5"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
<color key="textColor" name="Text"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Username" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1xI-cX-lcs">
<rect key="frame" x="61" y="30.5" width="298" height="18"/>
<rect key="frame" x="61" y="32.5" width="298" height="18"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<color key="textColor" name="Primary"/>
<nil key="highlightedColor"/>
@ -223,11 +223,11 @@
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<gestureRecognizers/>
<constraints>
<constraint firstItem="i10-Gq-NR9" firstAttribute="top" secondItem="50m-cW-QIF" secondAttribute="top" constant="8" id="4lV-Pa-Fk4"/>
<constraint firstItem="i10-Gq-NR9" firstAttribute="top" secondItem="50m-cW-QIF" secondAttribute="top" constant="10" id="4lV-Pa-Fk4"/>
<constraint firstAttribute="height" constant="70" id="DXt-M7-rwn"/>
<constraint firstItem="1xI-cX-lcs" firstAttribute="top" secondItem="a9Z-2P-cZT" secondAttribute="bottom" constant="2" id="Dc1-c0-QWp"/>
<constraint firstAttribute="trailing" secondItem="1xI-cX-lcs" secondAttribute="trailing" constant="8" id="IuX-dk-fGm"/>
<constraint firstItem="a9Z-2P-cZT" firstAttribute="top" secondItem="50m-cW-QIF" secondAttribute="top" constant="8" id="LsA-vW-3Ai"/>
<constraint firstItem="a9Z-2P-cZT" firstAttribute="top" secondItem="50m-cW-QIF" secondAttribute="top" constant="10" id="LsA-vW-3Ai"/>
<constraint firstItem="a9Z-2P-cZT" firstAttribute="leading" secondItem="i10-Gq-NR9" secondAttribute="trailing" constant="8" id="Mhb-Fj-TPN"/>
<constraint firstItem="i10-Gq-NR9" firstAttribute="leading" secondItem="50m-cW-QIF" secondAttribute="leading" constant="8" id="NYr-p5-5LY"/>
<constraint firstAttribute="trailing" secondItem="a9Z-2P-cZT" secondAttribute="trailing" constant="8" id="SDO-Wy-qn1"/>
@ -257,7 +257,7 @@
<rect key="frame" x="0.0" y="378" width="375" height="375"/>
<color key="backgroundColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="width" secondItem="XuS-iF-YYL" secondAttribute="height" multiplier="1:1" id="fuy-4s-Ojn"/>
<constraint firstAttribute="width" secondItem="XuS-iF-YYL" secondAttribute="height" multiplier="1:1" priority="999" id="8CQ-GM-Un6"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="y5N-A7-27p">
@ -269,7 +269,7 @@
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Timestamp" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="8et-mR-yd2">
<rect key="frame" x="20" y="7" width="127" height="16"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" red="0.090196078430000007" green="0.047058823530000002" blue="0.28627450980000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="textColor" name="Text"/>
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Clock" translatesAutoresizingMaskIntoConstraints="NO" id="RIE-8X-Pwy">
@ -294,13 +294,13 @@
<rect key="frame" x="307" y="15" width="60" height="30"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="100" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="MHw-QN-ZwH">
<rect key="frame" x="28" y="6.5" width="24" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.090196078430000007" green="0.047058823530000002" blue="0.28627450980000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<rect key="frame" x="26" y="6.5" width="26" height="17"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="14"/>
<color key="textColor" name="Primary"/>
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Star Regular" translatesAutoresizingMaskIntoConstraints="NO" id="EID-tt-v32">
<rect key="frame" x="5" y="7.5" width="15" height="15"/>
<rect key="frame" x="3" y="7.5" width="15" height="15"/>
<constraints>
<constraint firstAttribute="height" constant="15" id="XFp-GZ-jzP"/>
<constraint firstAttribute="width" constant="15" id="ayZ-OA-fSG"/>
@ -321,13 +321,13 @@
<rect key="frame" x="239" y="15" width="60" height="30"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="100" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="rq6-p2-tL4">
<rect key="frame" x="36" y="6.5" width="24" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.090196078430000007" green="0.047058823530000002" blue="0.28627450980000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<rect key="frame" x="34" y="6.5" width="26" height="17"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="14"/>
<color key="textColor" name="Primary"/>
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Boost Regular" translatesAutoresizingMaskIntoConstraints="NO" id="wns-8Z-i60">
<rect key="frame" x="14" y="6" width="14" height="18"/>
<rect key="frame" x="12" y="6" width="14" height="18"/>
<constraints>
<constraint firstAttribute="width" constant="14" id="JZc-nk-48d"/>
<constraint firstAttribute="height" constant="18" id="jJ4-EX-gFy"/>
@ -348,13 +348,13 @@
<rect key="frame" x="171" y="15" width="60" height="30"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="100" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Uog-Tq-elS">
<rect key="frame" x="36" y="6.5" width="24" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.090196078430000007" green="0.047058823530000002" blue="0.28627450980000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<rect key="frame" x="34" y="6.5" width="26" height="17"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="14"/>
<color key="textColor" name="Primary"/>
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Message" translatesAutoresizingMaskIntoConstraints="NO" id="mRG-vF-1Ur">
<rect key="frame" x="13" y="7.5" width="15" height="15"/>
<rect key="frame" x="11" y="7.5" width="15" height="15"/>
<constraints>
<constraint firstAttribute="width" constant="15" id="8ig-dH-PaT"/>
<constraint firstAttribute="height" constant="15" id="p8W-V4-AWg"/>
@ -376,7 +376,7 @@
<constraints>
<constraint firstItem="ZKM-hs-NVu" firstAttribute="centerY" secondItem="y5N-A7-27p" secondAttribute="centerY" id="2wb-g9-MnU"/>
<constraint firstAttribute="trailing" secondItem="P6f-0v-SWB" secondAttribute="trailing" constant="8" id="7l6-9R-zXM"/>
<constraint firstAttribute="height" constant="60" id="CSD-OT-KeH"/>
<constraint firstAttribute="height" priority="999" constant="60" id="CSD-OT-KeH"/>
<constraint firstItem="P6f-0v-SWB" firstAttribute="centerY" secondItem="y5N-A7-27p" secondAttribute="centerY" id="S34-vg-5Qz"/>
<constraint firstItem="pJk-g2-yyR" firstAttribute="centerY" secondItem="y5N-A7-27p" secondAttribute="centerY" id="STf-J7-ymf"/>
<constraint firstItem="cfJ-cH-ci5" firstAttribute="centerY" secondItem="y5N-A7-27p" secondAttribute="centerY" id="ZT4-Fj-yNI"/>
@ -390,10 +390,14 @@
<rect key="frame" x="0.0" y="813" width="375" height="5"/>
<color key="backgroundColor" red="0.93725490199999995" green="0.93725490199999995" blue="0.93725490199999995" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="5" id="QFa-Y9-r5a"/>
<constraint firstAttribute="height" priority="999" constant="5" id="QFa-Y9-r5a"/>
</constraints>
</view>
</subviews>
<constraints>
<constraint firstAttribute="trailing" secondItem="XuS-iF-YYL" secondAttribute="trailing" id="ere-3u-v8D"/>
<constraint firstItem="XuS-iF-YYL" firstAttribute="leading" secondItem="7Og-IU-seR" secondAttribute="leading" id="fO6-xB-WJR"/>
</constraints>
</stackView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>

5
elpha-ios/TimelineTableViewController.swift

@ -110,13 +110,13 @@ class TimelineTableViewController: UITableViewController, TimelinesTableViewCont
localTimeline.order = 2
let federatedTimeline = TimelineMO(context: CoreDataManager.shared.context)
federatedTimeline.name = "Home"
federatedTimeline.name = "Federated"
federatedTimeline.category = TimelineCategory.federated.rawValue
federatedTimeline.account = account
federatedTimeline.order = 3
let favoritesTimeline = TimelineMO(context: CoreDataManager.shared.context)
favoritesTimeline.name = "Home"
favoritesTimeline.name = "Favorites"
favoritesTimeline.category = TimelineCategory.favorites.rawValue
favoritesTimeline.account = account
favoritesTimeline.order = 4
@ -227,6 +227,7 @@ class TimelineTableViewController: UITableViewController, TimelinesTableViewCont
)
case .tag:
MastodonAPI.tagTimeline(
tag: timeline.subcategory!,
local: false,
limit: fetchLimit,
pagination: pagination,

12
elpha-ios/TimelinesTableViewController.swift

@ -73,16 +73,16 @@ class TimelinesTableViewController: UITableViewController {
cell.accessoryType = UITableViewCell.AccessoryType.checkmark
}
switch timeline.name {
case "Home":
switch TimelineCategory(rawValue: timeline.category!)! {
case .home:
cell.timelineImageView.image = UIImage(named: "Home")
case "Local":
case .local:
cell.timelineImageView.image = UIImage(named: "Users")
case "Federated":
case .federated:
cell.timelineImageView.image = UIImage(named: "Globe")
case "Favorites":
case .favorites:
cell.timelineImageView.image = UIImage(named: "Star Regular")
default:
case .tag:
cell.timelineImageView.image = UIImage(named: "Tag")
}

Loading…
Cancel
Save