You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.3 KiB
54 lines
1.3 KiB
//
|
|
// 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()
|
|
}
|
|
}
|