Remove AvatarAlignment and AvatarHorizontalAlignment

This commit is contained in:
Steven Deutsch
2017-11-07 03:52:13 -06:00
parent 477eeb568c
commit f17b87a155
3 changed files with 25 additions and 95 deletions
-45
View File
@@ -1,45 +0,0 @@
/*
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
/// An enum representing the verical alignment for an `AvatarView`.
public enum AvatarAlignment {
/// Aligns the `AvatarView`'s top edge to the cell's top edge.
case cellTop
/// Aligns the `AvatarView`'s bottom edge to the cell's bottom edge.
case cellBottom
/// Aligns the `AvatarView`'s top edge to the `MessageContainerView`'s top edge.
case messageTop
/// Aligns the `AvatarView`'s bottom edge to the `MessageContainerView`s bottom edge.
case messageBottom
/// Aligns the `AvatarView` center to the `MessageContainerView` center.
case messageCenter
}
@@ -1,38 +0,0 @@
/*
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: - AvatarVerticalAlignment
/// An enum representing the horizontal alignment of an `AvatarView`.
internal enum AvatarHorizontalAlignment {
/// Positions the `AvatarView` on the side closest to the cell's leading edge.
case cellLeading
/// Positions the `AvatarView` on the side closest to the cell's trailing edge.
case cellTrailing
}
@@ -1,18 +1,18 @@
/*
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
@@ -24,21 +24,34 @@
import Foundation
// 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 {
@available(*, deprecated: 0.10.0, message: "Removed in MessageKit 0.11.0. Please use avatarPosition(for:at:in:) instead.")
func avatarAlignment(for message: MessageType, at indexPath: IndexPath, in messagesCollectionView: MessagesCollectionView) -> AvatarAlignment {
/// 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.")
}
}
// MARK: - MessagesViewController
public extension MessagesViewController {
@available(*, deprecated: 0.10.0, message: "Removed in MessageKit 0.10.0. Please use the messagesCollectionView.contentInsets.top property.")
public var additionalTopContentInset: CGFloat {
get {
@@ -48,7 +61,7 @@ public extension MessagesViewController {
messagesCollectionView.contentInset.top = newValue
}
}
}
extension MessagesCollectionViewFlowLayout {
@@ -60,7 +73,7 @@ extension MessagesCollectionViewFlowLayout {
///
/// 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.")
open var avatarAlwaysLeading: Bool {
public var avatarAlwaysLeading: Bool {
fatalError("Fatal Error: avatarAlwaysLeading is no longer supported")
}
@@ -70,8 +83,8 @@ extension MessagesCollectionViewFlowLayout {
/// 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.")
open var avatarAlwaysTrailing: Bool {
@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")
}