Browse Source

Fix constraint issues

master
Dwayne Harris 6 years ago
parent
commit
de164e78f5
  1. 44
      elpha-ios/Base.lproj/Main.storyboard
  2. 2
      elpha-ios/MainStatusTableViewCell.swift
  3. 6
      elpha-ios/MastodonAPI.swift
  4. 2
      elpha-ios/StatusTableViewController.swift
  5. 8
      elpha-ios/StatusView.xib

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

@ -879,7 +879,7 @@
<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="245" id="8ys-Fm-1Yg" customClass="MainStatusTableViewCell" customModule="elpha_ios" customModuleProvider="target">
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" 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">
@ -887,34 +887,35 @@
<autoresizingMask key="autoresizingMask"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="7I8-6E-s1Q">
<rect key="frame" x="20" y="21" width="374" height="60"/>
<rect key="frame" x="0.0" y="21" width="414" 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"/>
<rect key="frame" x="8" y="0.0" width="55" height="55"/>
<constraints>
<constraint firstAttribute="width" constant="55" id="Qmn-E0-76F"/>
<constraint firstAttribute="height" constant="55" id="yC2-zX-OiV"/>
</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="23"/>
<rect key="frame" x="71" y="0.0" width="335" 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="25" width="303" height="19.5"/>
<rect key="frame" x="71" y="25" width="335" height="19.5"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" name="Primary"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<gestureRecognizers/>
<constraints>
<constraint firstItem="LHS-vw-fZE" firstAttribute="top" secondItem="7I8-6E-s1Q" secondAttribute="top" id="BGV-3e-Lcz"/>
<constraint firstAttribute="trailing" secondItem="vDe-e6-p1i" secondAttribute="trailing" constant="8" id="JRh-Vb-LYE"/>
<constraint firstItem="8fE-Hr-jgf" firstAttribute="leading" secondItem="LHS-vw-fZE" secondAttribute="trailing" constant="8" id="QNe-8B-pO9"/>
<constraint firstItem="LHS-vw-fZE" firstAttribute="leading" secondItem="7I8-6E-s1Q" secondAttribute="leading" id="dRT-UK-NcO"/>
<constraint firstItem="LHS-vw-fZE" firstAttribute="leading" secondItem="7I8-6E-s1Q" secondAttribute="leading" constant="8" id="dRT-UK-NcO"/>
<constraint firstItem="vDe-e6-p1i" firstAttribute="leading" secondItem="LHS-vw-fZE" secondAttribute="trailing" constant="8" id="f7a-Iy-dQ1"/>
<constraint firstItem="8fE-Hr-jgf" firstAttribute="top" secondItem="vDe-e6-p1i" secondAttribute="bottom" constant="2" id="i0D-5P-20W"/>
<constraint firstItem="vDe-e6-p1i" firstAttribute="top" secondItem="7I8-6E-s1Q" secondAttribute="top" id="pgA-eb-pGk"/>
@ -923,13 +924,13 @@
</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="96" width="374" height="100"/>
<rect key="frame" x="8" y="96" width="398" 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"/>
<rect key="frame" x="8" 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"/>
@ -941,7 +942,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="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"/>
<color key="textColor" name="Primary"/>
<nil key="highlightedColor"/>
</label>
</subviews>
@ -957,12 +958,12 @@
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Iqe-xC-DYy">
<rect key="frame" x="266" y="204" width="60" height="30"/>
<rect key="frame" x="278" 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"/>
<color key="textColor" name="Text"/>
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Boost Regular" translatesAutoresizingMaskIntoConstraints="NO" id="X4x-5e-3Ms">
@ -984,12 +985,12 @@
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9oD-Y0-ilp">
<rect key="frame" x="334" y="204" width="60" height="30"/>
<rect key="frame" x="346" 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"/>
<color key="textColor" name="Text"/>
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Star Regular" translatesAutoresizingMaskIntoConstraints="NO" id="B1s-Wp-hBJ">
@ -1011,12 +1012,12 @@
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="FZi-le-bmF">
<rect key="frame" x="198" y="204" width="60" height="30"/>
<rect key="frame" x="210" 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"/>
<color key="textColor" name="Text"/>
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Message" translatesAutoresizingMaskIntoConstraints="NO" id="Jcf-Cv-8ki">
@ -1039,25 +1040,26 @@
</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="trailing" secondItem="7I8-6E-s1Q" secondAttribute="trailing" id="5hL-Ma-O1w"/>
<constraint firstAttribute="trailing" secondItem="AT3-0d-kQ3" secondAttribute="trailing" constant="8" id="6Wd-QF-Ar9"/>
<constraint firstItem="7I8-6E-s1Q" firstAttribute="leading" secondItem="Hj7-kC-H7L" secondAttribute="leading" id="7SB-qd-J9a"/>
<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="9oD-Y0-ilp" firstAttribute="trailing" secondItem="Hj7-kC-H7L" secondAttribute="trailing" constant="-8" 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="C8A-x8-8TG" firstAttribute="leading" secondItem="Hj7-kC-H7L" secondAttribute="leading" constant="8" 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="leading" secondItem="Hj7-kC-H7L" secondAttribute="leading" constant="8" 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="accountView" destination="7I8-6E-s1Q" id="tw8-M7-TNT"/>
<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"/>

2
elpha-ios/MainStatusTableViewCell.swift

@ -20,4 +20,6 @@ class MainStatusTableViewCell: UITableViewCell {
@IBOutlet var boostsLabel: UILabel!
@IBOutlet var favoritesImageView: UIImageView!
@IBOutlet var favoritesLabel: UILabel!
@IBOutlet var accountView: UIView!
}

6
elpha-ios/MastodonAPI.swift

@ -66,11 +66,11 @@ class MastodonAPI {
return []
}
let regex = try! NSRegularExpression(pattern: "<.*\\?(?:max_id|since_id)=([0-9]+)>;rel=\"(next|prev)\"", options: .caseInsensitive)
let regex = try! NSRegularExpression(pattern: "<.*(?:max_id|since_id)=([0-9]+)>; rel=\"(next|prev)\"", options: .caseInsensitive)
let matches = regex.matches(in: link, options: [], range: NSRange(location: 0, length: link.count))
return matches.map { match in
let statusRange = match.range(at: 0)
let directionRange = match.range(at: 1)
let statusRange = match.range(at: 1)
let directionRange = match.range(at: 2)
let statusID = link[Range(statusRange, in: link)!]
let direction = link[Range(directionRange, in: link)!]

2
elpha-ios/StatusTableViewController.swift

@ -120,6 +120,8 @@ class StatusTableViewController: UITableViewController {
descendants.append(s)
}
}
descendants.reverse()
} catch {
print("\(error)")
}

8
elpha-ios/StatusView.xib

@ -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" name="Text"/>
<color key="textColor" name="Primary"/>
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Clock" translatesAutoresizingMaskIntoConstraints="NO" id="RIE-8X-Pwy">
@ -296,7 +296,7 @@
<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="26" y="6.5" width="26" height="17"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="14"/>
<color key="textColor" name="Primary"/>
<color key="textColor" name="Text"/>
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Star Regular" translatesAutoresizingMaskIntoConstraints="NO" id="EID-tt-v32">
@ -323,7 +323,7 @@
<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="34" y="6.5" width="26" height="17"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="14"/>
<color key="textColor" name="Primary"/>
<color key="textColor" name="Text"/>
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Boost Regular" translatesAutoresizingMaskIntoConstraints="NO" id="wns-8Z-i60">
@ -350,7 +350,7 @@
<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="34" y="6.5" width="26" height="17"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="14"/>
<color key="textColor" name="Primary"/>
<color key="textColor" name="Text"/>
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Message" translatesAutoresizingMaskIntoConstraints="NO" id="mRG-vF-1Ur">

Loading…
Cancel
Save