Files
MessageKit/Sources/Supporting/MessageKit+Availability.swift
T
2017-11-30 23:02:21 +01:00

90 lines
4.2 KiB
Swift

/*
MIT License
Copyright (c) 2017 MessageKit
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
import Foundation
// MARK: - Deprecated Protocols
@available(*, deprecated: 0.11.0, message: "LocationMessageDisplayDelegate has been deprecated in favor of MessagesDisplayDelegate")
typealias LocationMessageDisplayDelegate = MessagesDisplayDelegate
@available(*, deprecated: 0.11.0, message: "TextMessageDisplayDelegate has been deprecated in favor of MessagesDisplayDelegate")
typealias TextMessageDisplayDelegate = MessagesDisplayDelegate
@available(*, deprecated: 0.11.0, message: "LocationMessageLayoutDelegate has been deprecated in favor of MessagesDisplayDelegate")
typealias LocationMessageLayoutDelegate = MessagesLayoutDelegate
@available(*, deprecated: 0.11.0, message: "MediaMessageLayoutDelegate has been deprecated in favor of MessagesDisplayDelegate")
typealias MediaMessageLayoutDelegate = MessagesLayoutDelegate
// MARK: - AvatarAlignment
@available(*, deprecated: 0.11.0, message: "Removed in MessageKit 0.11.0. Please use AvatarPosition instead.")
public enum AvatarAlignment {}
// MARK: - MessagesLayoutDelegate
extension MessagesLayoutDelegate {
/// Specifies the vertical alignment for the `AvatarView` in a `MessageCollectionViewCell`.
///
/// - Parameters:
/// - message: The `MessageType` that will be displayed by this cell.
/// - indexPath: The `IndexPath` of the cell.
/// - messagesCollectionView: The `MessagesCollectionView` in which this cell will be displayed.
///
/// The default value returned by this method is `AvatarAlignment.cellBottom`.
@available(*, deprecated: 0.11.0, message: "Removed in MessageKit 0.11.0. Please use avatarPosition(for:at:in:) instead.")
public func avatarAlignment(for message: MessageType, at indexPath: IndexPath, in messagesCollectionView: MessagesCollectionView) -> AvatarAlignment {
fatalError("Please use avatarPosition(for message: MessageType, at indexPath: IndexPath, in messagesCollectionView: MessagesCollectionView) -> AvatarPosition instead.")
}
}
extension MessagesCollectionViewFlowLayout {
/// A Boolean value that determines if the `AvatarView` is always on the leading
/// side of a MessageCollectionViewCell.
///
/// Setting this property to `true` causes `avatarAlwaysTrailing` to be set to `false`.
///
/// The default value of this property is `false`.
@available(*, deprecated: 0.11.0, message: "Removed in MessageKit 0.11.0. Please use the avatarPosition(for:at:in) delegate method.")
public var avatarAlwaysLeading: Bool {
fatalError("Fatal Error: avatarAlwaysLeading is no longer supported")
}
/// A Boolean value that determines if the `AvatarView` is always on the trailing
/// side of a `MessageCollectionViewCell`.
///
/// Setting this property to `true` causes `avatarAlwaysLeading` to be set to `false`.
///
/// The default value of this property is `false`.
@available(*, deprecated: 0.11.0, message: "Removed in MessageKit 0.11.0. Please use the avatarPosition(for:at:in) delegate method instead.")
public var avatarAlwaysTrailing: Bool {
fatalError("Fatal Error: avatarAlwaysTrailing is no longer supported")
}
}