diff --git a/SignalMessaging/Views/ImageEditor/ImageEditorContents.swift b/SignalMessaging/Views/ImageEditor/ImageEditorContents.swift index 8725ba433..e5ce28f6d 100644 --- a/SignalMessaging/Views/ImageEditor/ImageEditorContents.swift +++ b/SignalMessaging/Views/ImageEditor/ImageEditorContents.swift @@ -11,7 +11,7 @@ import UIKit // as immutable, once configured. public class ImageEditorContents: NSObject { - public typealias ItemMapType = OrderedDictionary + public typealias ItemMapType = OrderedDictionary // This represents the current state of each item, // a mapping of [itemId : item]. @@ -72,7 +72,7 @@ public class ImageEditorContents: NSObject { @objc public func items() -> [ImageEditorItem] { - return itemMap.orderedValues() + return itemMap.orderedValues } @objc diff --git a/SignalMessaging/Views/ImageEditor/OrderedDictionary.swift b/SignalMessaging/Views/ImageEditor/OrderedDictionary.swift index adec0c9fd..7aa6d7d28 100644 --- a/SignalMessaging/Views/ImageEditor/OrderedDictionary.swift +++ b/SignalMessaging/Views/ImageEditor/OrderedDictionary.swift @@ -4,16 +4,13 @@ import Foundation -public class OrderedDictionary: NSObject { +public class OrderedDictionary { - public typealias KeyType = String + private var keyValueMap = [KeyType: ValueType]() - var keyValueMap = [KeyType: ValueType]() + public var orderedKeys = [KeyType]() - var orderedKeys = [KeyType]() - - public override init() { - } + public init() { } // Used to clone copies of instances of this class. public init(keyValueMap: [KeyType: ValueType], @@ -25,7 +22,7 @@ public class OrderedDictionary: NSObject { // Since the contents are immutable, we only modify copies // made with this method. - public func clone() -> OrderedDictionary { + public func clone() -> OrderedDictionary { return OrderedDictionary(keyValueMap: keyValueMap, orderedKeys: orderedKeys) } @@ -90,7 +87,7 @@ public class OrderedDictionary: NSObject { return orderedKeys.count } - public func orderedValues() -> [ValueType] { + public var orderedValues: [ValueType] { var values = [ValueType]() for key in orderedKeys { guard let value = self.keyValueMap[key] else {