Dwayne Harris
6 years ago
12 changed files with 227 additions and 87 deletions
-
16elpha-ios.xcodeproj/project.pbxproj
-
6elpha-ios/AccountTableViewController.swift
-
8elpha-ios/AttachmentManager.swift
-
2elpha-ios/AttachmentViewController.swift
-
54elpha-ios/Base.lproj/Main.storyboard
-
54elpha-ios/ComposeAccessoryView.swift
-
91elpha-ios/ComposeAccessoryView.xib
-
39elpha-ios/ComposeViewController.swift
-
18elpha-ios/FLAnimatedImageView+SetImage.swift
-
6elpha-ios/SettingsTableViewController.swift
-
10elpha-ios/StatusTableViewController.swift
-
8elpha-ios/StatusView.swift
@ -0,0 +1,54 @@ |
|||
// |
|||
// ComposeAccessoryView.swift |
|||
// elpha-ios |
|||
// |
|||
// Created by Dwayne Harris on 11/14/18. |
|||
// Copyright © 2018 Elpha. All rights reserved. |
|||
// |
|||
|
|||
import UIKit |
|||
|
|||
protocol ComposeAccessoryViewDelegate { |
|||
func attachmentTapped() |
|||
func visibilityTapped() |
|||
func tootTapped() |
|||
} |
|||
|
|||
class ComposeAccessoryView: UIView { |
|||
@IBOutlet var contentView: UIView! |
|||
@IBOutlet var attachmentButton: UIButton! |
|||
@IBOutlet var visibilityButton: UIButton! |
|||
@IBOutlet var tootButton: UIButton! |
|||
|
|||
var delegate: ComposeAccessoryViewDelegate? = nil |
|||
|
|||
override init(frame: CGRect) { |
|||
super.init(frame: frame) |
|||
setup() |
|||
} |
|||
|
|||
required init?(coder aDecoder: NSCoder) { |
|||
super.init(coder: aDecoder) |
|||
setup() |
|||
} |
|||
|
|||
private func setup() { |
|||
Bundle.main.loadNibNamed("ComposeAccessoryView", owner: self, options: nil) |
|||
addSubview(contentView) |
|||
contentView.frame = self.bounds |
|||
} |
|||
|
|||
@IBAction func attachmentTapped(_ sender: Any) { |
|||
print("Attachment tapped 1") |
|||
delegate?.attachmentTapped() |
|||
} |
|||
|
|||
@IBAction func visibilityTapped(_ sender: Any) { |
|||
print("Visibility tapped 1") |
|||
delegate?.visibilityTapped() |
|||
} |
|||
|
|||
@IBAction func tootTapped(_ sender: Any) { |
|||
delegate?.tootTapped() |
|||
} |
|||
} |
@ -0,0 +1,91 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> |
|||
<device id="retina4_7" orientation="portrait"> |
|||
<adaptation id="fullscreen"/> |
|||
</device> |
|||
<dependencies> |
|||
<deployment identifier="iOS"/> |
|||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/> |
|||
<capability name="Named colors" minToolsVersion="9.0"/> |
|||
<capability name="Safe area layout guides" minToolsVersion="9.0"/> |
|||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> |
|||
</dependencies> |
|||
<objects> |
|||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ComposeAccessoryView" customModule="elpha_ios" customModuleProvider="target"> |
|||
<connections> |
|||
<outlet property="attachmentButton" destination="p9E-dV-blq" id="PGC-qB-cmp"/> |
|||
<outlet property="contentView" destination="iN0-l3-epB" id="RRP-dz-Q9f"/> |
|||
<outlet property="tootButton" destination="f6o-l1-yXR" id="9rx-wt-RGB"/> |
|||
<outlet property="visibilityButton" destination="ZLh-n0-Jkb" id="rhj-Rh-j8C"/> |
|||
</connections> |
|||
</placeholder> |
|||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> |
|||
<view contentMode="scaleToFill" id="iN0-l3-epB"> |
|||
<rect key="frame" x="0.0" y="0.0" width="375" height="55"/> |
|||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> |
|||
<subviews> |
|||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="p9E-dV-blq"> |
|||
<rect key="frame" x="20" y="17" width="22" height="23"/> |
|||
<constraints> |
|||
<constraint firstAttribute="width" constant="22" id="FYE-si-fNa"/> |
|||
<constraint firstAttribute="height" constant="23" id="XFq-lD-Puo"/> |
|||
</constraints> |
|||
<state key="normal" image="Attachment"> |
|||
<color key="titleColor" name="Primary"/> |
|||
</state> |
|||
<connections> |
|||
<action selector="attachmentTapped:" destination="-1" eventType="touchUpInside" id="qNg-9t-ZlU"/> |
|||
</connections> |
|||
</button> |
|||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="f6o-l1-yXR"> |
|||
<rect key="frame" x="284" y="17" width="71" height="23"/> |
|||
<constraints> |
|||
<constraint firstAttribute="height" constant="23" id="TKB-N5-qlj"/> |
|||
</constraints> |
|||
<fontDescription key="fontDescription" type="boldSystem" pointSize="18"/> |
|||
<state key="normal" title=" Toot!" image="Compose"> |
|||
<color key="titleColor" name="Primary"/> |
|||
</state> |
|||
<connections> |
|||
<action selector="tootTapped:" destination="-1" eventType="touchUpInside" id="Pke-RH-QSD"/> |
|||
</connections> |
|||
</button> |
|||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ZLh-n0-Jkb"> |
|||
<rect key="frame" x="57" y="18" width="79" height="22"/> |
|||
<constraints> |
|||
<constraint firstAttribute="height" constant="22" id="gTK-Rc-C4r"/> |
|||
</constraints> |
|||
<fontDescription key="fontDescription" type="system" pointSize="13"/> |
|||
<state key="normal" title=" Visibility" image="Visibility"> |
|||
<color key="titleColor" name="Primary"/> |
|||
</state> |
|||
<connections> |
|||
<action selector="visibilityTapped:" destination="-1" eventType="touchUpInside" id="f3p-KD-4Z7"/> |
|||
</connections> |
|||
</button> |
|||
</subviews> |
|||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
|||
<constraints> |
|||
<constraint firstItem="ZLh-n0-Jkb" firstAttribute="leading" secondItem="p9E-dV-blq" secondAttribute="trailing" constant="15" id="5pc-4Y-ZhS"/> |
|||
<constraint firstItem="vUN-kp-3ea" firstAttribute="bottom" secondItem="p9E-dV-blq" secondAttribute="bottom" constant="15" id="HUF-cO-ElL"/> |
|||
<constraint firstAttribute="bottom" secondItem="ZLh-n0-Jkb" secondAttribute="bottom" constant="15" id="UkW-u6-WMg"/> |
|||
<constraint firstItem="p9E-dV-blq" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" constant="20" id="jVv-Cj-aR0"/> |
|||
<constraint firstItem="vUN-kp-3ea" firstAttribute="bottom" secondItem="f6o-l1-yXR" secondAttribute="bottom" constant="15" id="pJj-50-4rA"/> |
|||
<constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="f6o-l1-yXR" secondAttribute="trailing" constant="20" id="rjA-c3-AEe"/> |
|||
</constraints> |
|||
<nil key="simulatedTopBarMetrics"/> |
|||
<nil key="simulatedBottomBarMetrics"/> |
|||
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/> |
|||
<viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/> |
|||
<point key="canvasLocation" x="138.40000000000001" y="427.73613193403304"/> |
|||
</view> |
|||
</objects> |
|||
<resources> |
|||
<image name="Attachment" width="22" height="23"/> |
|||
<image name="Compose" width="22" height="23"/> |
|||
<image name="Visibility" width="24" height="18"/> |
|||
<namedColor name="Primary"> |
|||
<color red="0.32549019607843138" green="0.20392156862745098" blue="0.55686274509803924" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
|||
</namedColor> |
|||
</resources> |
|||
</document> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue