浏览代码

Deleted deprecated methods

Jacob Christie 4 年之前
父节点
当前提交
8017da48a8

+ 2 - 78
Source/Charts/Data/Implementations/Standard/ChartDataSet.swift

@@ -141,23 +141,7 @@ open class ChartDataSet: ChartBaseDataSet
     
     /// The maximum x-value this DataSet holds
     @objc open override var xMax: Double { return _xMax }
-    
-    /// The number of y-values this DataSet represents
-    @available(*, deprecated, message: "Use `count` instead")
-    open override var entryCount: Int { return count }
-    
-    /// - Throws: out of bounds
-    /// if `i` is out of bounds, it may throw an out-of-bounds exception
-    /// - Returns: The entry object found at the given index (not x-value!)
-    @available(*, deprecated, message: "Use `subscript(index:)` instead.")
-    open override func entryForIndex(_ i: Int) -> ChartDataEntry?
-    {
-        guard indices.contains(i) else {
-            return nil
-        }
-        return self[i]
-    }
-    
+
     /// - Parameters:
     ///   - xValue: the x-value
     ///   - closestToY: If there are multiple y-values for the specified x-value,
@@ -356,32 +340,7 @@ open class ChartDataSet: ChartBaseDataSet
         
         return closest
     }
-    
-    /// - Parameters:
-    ///   - e: the entry to search for
-    /// - Returns: The array-index of the specified entry
-    // TODO: Should be returning `nil` to follow Swift convention
-    @available(*, deprecated, message: "Use `firstIndex(of:)` or `lastIndex(of:)`")
-    open override func entryIndex(entry e: ChartDataEntry) -> Int
-    {
-        return firstIndex(of: e) ?? -1
-    }
-    
-    /// Adds an Entry to the DataSet dynamically.
-    /// Entries are added to the end of the list.
-    /// This will also recalculate the current minimum and maximum values of the DataSet and the value-sum.
-    ///
-    /// - Parameters:
-    ///   - e: the entry to add
-    /// - Returns: True
-    // TODO: This should return `Void` to follow Swift convention
-    @available(*, deprecated, message: "Use `append(_:)` instead", renamed: "append(_:)")
-    open override func addEntry(_ e: ChartDataEntry) -> Bool
-    {
-        append(e)
-        return true
-    }
-    
+
     /// Adds an Entry to the DataSet dynamically.
     /// Entries are added to their appropriate index respective to it's x-index.
     /// This will also recalculate the current minimum and maximum values of the DataSet and the value-sum.
@@ -407,12 +366,6 @@ open class ChartDataSet: ChartBaseDataSet
         
         return true
     }
-    
-    @available(*, renamed: "remove(_:)")
-    open override func removeEntry(_ entry: ChartDataEntry) -> Bool
-    {
-        remove(entry)
-    }
 
     /// Removes an Entry from the DataSet dynamically.
     /// This will also recalculate the current minimum and maximum values of the DataSet and the value-sum.
@@ -427,35 +380,6 @@ open class ChartDataSet: ChartBaseDataSet
         return true
     }
 
-    /// Removes the first Entry (at index 0) of this DataSet from the entries array.
-    ///
-    /// - Returns: `true` if successful, `false` if not.
-    // TODO: This should return the removed entry to follow Swift convention.
-    @available(*, deprecated, message: "Use `func removeFirst() -> ChartDataEntry` instead.")
-    open override func removeFirst() -> Bool
-    {
-        let entry: ChartDataEntry? = isEmpty ? nil : removeFirst()
-        return entry != nil
-    }
-    
-    /// Removes the last Entry (at index size-1) of this DataSet from the entries array.
-    ///
-    /// - Returns: `true` if successful, `false` if not.
-    // TODO: This should return the removed entry to follow Swift convention.
-    @available(*, deprecated, message: "Use `func removeLast() -> ChartDataEntry` instead.")
-    open override func removeLast() -> Bool
-    {
-        let entry: ChartDataEntry? = isEmpty ? nil : removeLast()
-        return entry != nil
-    }
-
-    /// Removes all values from this DataSet and recalculates min and max value.
-    @available(*, deprecated, message: "Use `removeAll(keepingCapacity:)` instead.")
-    open override func clear()
-    {
-        removeAll(keepingCapacity: true)
-    }
-    
     // MARK: - Data functions and accessors
     
     // MARK: - NSCopying

+ 0 - 8
Source/Charts/Formatters/DefaultValueFormatter.swift

@@ -89,14 +89,6 @@ open class DefaultValueFormatter: NSObject, ValueFormatter
         super.init()
     }
 
-    /// This function is deprecated - Use `init(block:)` instead.
-    // DEC 11, 2017
-    @available(*, deprecated, message: "Use `init(block:)` instead.")
-    @objc public static func with(block: @escaping Block) -> DefaultValueFormatter
-    {
-        return DefaultValueFormatter(block: block)
-    }
-    
     open func stringForValue(_ value: Double,
                              entry: ChartDataEntry,
                              dataSetIndex: Int,