Browse Source

Development

master
Dwayne Harris 6 years ago
parent
commit
e7577d4c8b
  1. 2
      elpha-ios/AlertManager.swift
  2. 11
      elpha-ios/AlertView.xib
  3. 8
      elpha-ios/TimelineTableViewController.swift

2
elpha-ios/AlertManager.swift

@ -61,7 +61,7 @@ class AlertManager {
NSLayoutConstraint.activate([
blurEffectView.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -20),
blurEffectView.widthAnchor.constraint(equalToConstant: 200),
blurEffectView.widthAnchor.constraint(equalToConstant: 220),
blurEffectView.heightAnchor.constraint(equalToConstant: 50),
bottomLayoutConstraint!,
])

11
elpha-ios/AlertView.xib

@ -21,14 +21,14 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="180"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Message" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uLF-4h-Bxo">
<rect key="frame" x="55" y="81.5" width="312" height="17"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Message" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uLF-4h-Bxo">
<rect key="frame" x="45" y="8" width="322" height="164"/>
<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"/>
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="clq-3k-X29">
<rect key="frame" x="20" y="80" width="25" height="20"/>
<rect key="frame" x="10" y="80" width="25" height="20"/>
<constraints>
<constraint firstAttribute="width" constant="25" id="GaN-Tw-djA"/>
<constraint firstAttribute="height" constant="20" id="zWc-Bw-7lB"/>
@ -36,11 +36,12 @@
</imageView>
</subviews>
<constraints>
<constraint firstItem="clq-3k-X29" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" constant="20" id="5fg-xq-NZI"/>
<constraint firstItem="clq-3k-X29" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" constant="10" id="5fg-xq-NZI"/>
<constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="uLF-4h-Bxo" secondAttribute="trailing" constant="8" id="UuS-UO-ukK"/>
<constraint firstItem="uLF-4h-Bxo" firstAttribute="leading" secondItem="clq-3k-X29" secondAttribute="trailing" constant="10" id="hOP-eE-NMl"/>
<constraint firstItem="uLF-4h-Bxo" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="centerY" id="hld-30-Yt0"/>
<constraint firstItem="vUN-kp-3ea" firstAttribute="bottom" secondItem="uLF-4h-Bxo" secondAttribute="bottom" constant="8" id="jsf-8G-7WU"/>
<constraint firstItem="clq-3k-X29" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="centerY" id="r75-vt-dSG"/>
<constraint firstItem="uLF-4h-Bxo" firstAttribute="top" secondItem="vUN-kp-3ea" secondAttribute="top" constant="8" id="woC-wL-9Qs"/>
</constraints>
<nil key="simulatedTopBarMetrics"/>
<nil key="simulatedBottomBarMetrics"/>

8
elpha-ios/TimelineTableViewController.swift

@ -79,10 +79,7 @@ class TimelineTableViewController: UITableViewController, TimelinesViewControlle
}
@objc func compose() {
// let alertController = UIAlertController(title: "Compose", message: "Toot", preferredStyle: .alert)
// alertController.addAction(UIAlertAction(title: "OK", style: .default, handler: nil))
// present(alertController, animated: true)
AlertManager.shared.show(message: "Test message")
AlertManager.shared.show(message: "Much much much longer test message. This is a test.")
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
@ -211,7 +208,8 @@ class TimelineTableViewController: UITableViewController, TimelinesViewControlle
}
if newStatusCount > 0 {
AlertManager.shared.show(message: "\(newStatusCount) new toots", category: .newStatuses)
let pluralization = newStatusCount == 1 ? "" : "s"
AlertManager.shared.show(message: "\(newStatusCount) new toot\(pluralization)", category: .newStatuses)
}
CoreDataManager.shared.saveContext()

Loading…
Cancel
Save