Skip to content

Commit cc55dd8

Browse files
committed
subscript (safe index: Int) to PolygonChartView.swift
1 parent 6c6b58b commit cc55dd8

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

Example/SkyPolygonChart/Array+Extension.swift

Lines changed: 0 additions & 15 deletions
This file was deleted.

Example/SkyPolygonChart/SkyPolygonChart/PolygonChartView.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,3 +159,9 @@ class PolygonChartView: UIView {
159159
}
160160

161161
}
162+
163+
extension Array {
164+
subscript (safe index: Int) -> Element? {
165+
return startIndex <= index && index < endIndex ? self[index] : nil
166+
}
167+
}

0 commit comments

Comments
 (0)