-
Notifications
You must be signed in to change notification settings - Fork 471
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move delgate to own file and add datasource protocol
- Loading branch information
Showing
4 changed files
with
36 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
import UIKit | ||
|
||
public protocol ScrollableGraphViewDataSource { | ||
func value(forPlot plot: Plot, atIndex pointIndex: Int) -> Double | ||
func label(forPlot plot: Plot, atIndex pointIndex: Int) -> String | ||
func numberOfPoints(forPlot plot: Plot) -> Int | ||
} |
11 changes: 11 additions & 0 deletions
11
Classes/Protocols/ScrollableGraphViewDrawingDelegate.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
import UIKit | ||
|
||
// Delegate definition that provides the data required by the drawing layers. | ||
internal protocol ScrollableGraphViewDrawingDelegate { | ||
func intervalForActivePoints() -> CountableRange<Int> | ||
func rangeForActivePoints() -> (min: Double, max: Double) | ||
func graphPoint(forIndex index: Int) -> GraphPoint | ||
func calculatePosition(atIndex index: Int, value: Double) -> CGPoint | ||
func currentViewport() -> CGRect | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters