diff --git a/LightweightCharts/Classes/Implementations/API/Chart.swift b/LightweightCharts/Classes/Implementations/API/Chart.swift index c4d30dd..036fc41 100644 --- a/LightweightCharts/Classes/Implementations/API/Chart.swift +++ b/LightweightCharts/Classes/Implementations/API/Chart.swift @@ -1,7 +1,7 @@ import Foundation import WebKit -public protocol ChartDelegate: class { +public protocol ChartDelegate: AnyObject { func didClick(onChart chart: ChartApi, parameters: MouseEventParams) func didCrosshairMove(onChart chart: ChartApi, parameters: MouseEventParams) diff --git a/LightweightCharts/Classes/Implementations/API/LightweightCharts.swift b/LightweightCharts/Classes/Implementations/API/LightweightCharts.swift index 6fa132d..c213c1a 100644 --- a/LightweightCharts/Classes/Implementations/API/LightweightCharts.swift +++ b/LightweightCharts/Classes/Implementations/API/LightweightCharts.swift @@ -1,7 +1,7 @@ import Foundation import WebKit -public protocol LightweightChartsDelegate: class { +public protocol LightweightChartsDelegate: AnyObject { func lightweightChartsDidLoad(_ lightweightCharts: LightweightCharts) func lightweightCharts(_ lightweightCharts: LightweightCharts, didFailLoadWithError error: Error) diff --git a/LightweightCharts/Classes/Implementations/JavaScriptEvaluator.swift b/LightweightCharts/Classes/Implementations/JavaScriptEvaluator.swift index 62b3f41..0d0f7e0 100644 --- a/LightweightCharts/Classes/Implementations/JavaScriptEvaluator.swift +++ b/LightweightCharts/Classes/Implementations/JavaScriptEvaluator.swift @@ -1,7 +1,7 @@ import Foundation import WebKit -protocol JavaScriptEvaluator: class { +protocol JavaScriptEvaluator: AnyObject { func evaluateScript(_ script: String, completion: ((Any?, Error?) -> Void)?) func decodedResult(forScript script: String, completion: @escaping (T?) -> Void) diff --git a/LightweightCharts/Classes/Implementations/JavaScriptObject.swift b/LightweightCharts/Classes/Implementations/JavaScriptObject.swift index 796466d..65fa1bf 100644 --- a/LightweightCharts/Classes/Implementations/JavaScriptObject.swift +++ b/LightweightCharts/Classes/Implementations/JavaScriptObject.swift @@ -1,4 +1,4 @@ -protocol JavaScriptObject: class { +protocol JavaScriptObject: AnyObject { var jsName: String { get } diff --git a/LightweightCharts/Classes/Implementations/Subscription/MessageHandler.swift b/LightweightCharts/Classes/Implementations/Subscription/MessageHandler.swift index acc8685..fe0ecee 100644 --- a/LightweightCharts/Classes/Implementations/Subscription/MessageHandler.swift +++ b/LightweightCharts/Classes/Implementations/Subscription/MessageHandler.swift @@ -1,7 +1,7 @@ import Foundation import WebKit -protocol MessageHandlerDelegate: class { +protocol MessageHandlerDelegate: AnyObject { func messageHandler(_ messageHandler: MessageHandler, didReceiveClickWithParameters parameters: MouseEventParams) diff --git a/LightweightCharts/Classes/Implementations/SyncScriptEvaluating/PromptHandler.swift b/LightweightCharts/Classes/Implementations/SyncScriptEvaluating/PromptHandler.swift index 1725e0e..370079f 100644 --- a/LightweightCharts/Classes/Implementations/SyncScriptEvaluating/PromptHandler.swift +++ b/LightweightCharts/Classes/Implementations/SyncScriptEvaluating/PromptHandler.swift @@ -1,7 +1,7 @@ import Foundation import WebKit -protocol ClosuresStore: class { +protocol ClosuresStore: AnyObject { func addMethod(_ method: JavaScriptMethod, forName name: String) diff --git a/LightweightCharts/Classes/Implementations/WebView.swift b/LightweightCharts/Classes/Implementations/WebView.swift index 4aad7c0..fb4098a 100644 --- a/LightweightCharts/Classes/Implementations/WebView.swift +++ b/LightweightCharts/Classes/Implementations/WebView.swift @@ -1,6 +1,6 @@ import WebKit -public protocol JavaScriptErrorDelegate: class { +public protocol JavaScriptErrorDelegate: AnyObject { func didFailEvaluateScript(_ script: String, withError error: Error) diff --git a/LightweightCharts/Classes/Protocols/ChartApi.swift b/LightweightCharts/Classes/Protocols/ChartApi.swift index 6806ebe..98ccd6f 100644 --- a/LightweightCharts/Classes/Protocols/ChartApi.swift +++ b/LightweightCharts/Classes/Protocols/ChartApi.swift @@ -3,7 +3,7 @@ import UIKit /** The main interface of a single chart */ -public protocol ChartApi: class { +public protocol ChartApi: AnyObject { /** * Subsription delegate for chart events. Weak reference. diff --git a/LightweightCharts/Classes/Protocols/PriceFormatterApi.swift b/LightweightCharts/Classes/Protocols/PriceFormatterApi.swift index 4c103fe..73100ff 100644 --- a/LightweightCharts/Classes/Protocols/PriceFormatterApi.swift +++ b/LightweightCharts/Classes/Protocols/PriceFormatterApi.swift @@ -1,7 +1,7 @@ import Foundation /** Interface to be implemented by the object in order to be used as a price formatter */ -public protocol PriceFormatterApi: class { +public protocol PriceFormatterApi: AnyObject { /** * Formatting function diff --git a/LightweightCharts/Classes/Protocols/PriceLineApi.swift b/LightweightCharts/Classes/Protocols/PriceLineApi.swift index 5de453c..5067c19 100644 --- a/LightweightCharts/Classes/Protocols/PriceLineApi.swift +++ b/LightweightCharts/Classes/Protocols/PriceLineApi.swift @@ -1,6 +1,6 @@ import Foundation -public protocol PriceLineApi: class { +public protocol PriceLineApi: AnyObject { func applyOptions(options: PriceLineOptions) func options(completion: @escaping (PriceLineOptions?) -> Void) diff --git a/LightweightCharts/Classes/Protocols/PriceScaleApi.swift b/LightweightCharts/Classes/Protocols/PriceScaleApi.swift index 5f6ad5e..a792e3a 100644 --- a/LightweightCharts/Classes/Protocols/PriceScaleApi.swift +++ b/LightweightCharts/Classes/Protocols/PriceScaleApi.swift @@ -1,7 +1,7 @@ import Foundation /** Interface to control chart's price scale */ -public protocol PriceScaleApi: class { +public protocol PriceScaleApi: AnyObject { /** * Applies new options to the price scale diff --git a/LightweightCharts/Classes/Protocols/SeriesApi.swift b/LightweightCharts/Classes/Protocols/SeriesApi.swift index 385ec78..1c9d421 100644 --- a/LightweightCharts/Classes/Protocols/SeriesApi.swift +++ b/LightweightCharts/Classes/Protocols/SeriesApi.swift @@ -1,6 +1,6 @@ import Foundation -public protocol SeriesApi: class { +public protocol SeriesApi: AnyObject { associatedtype Options: SeriesOptionsCommon associatedtype TickValue: SeriesData diff --git a/LightweightCharts/Classes/Protocols/TimeScaleApi.swift b/LightweightCharts/Classes/Protocols/TimeScaleApi.swift index 2e4dd97..d738d3f 100644 --- a/LightweightCharts/Classes/Protocols/TimeScaleApi.swift +++ b/LightweightCharts/Classes/Protocols/TimeScaleApi.swift @@ -1,7 +1,7 @@ import CoreGraphics /** Interface to chart time scale */ -public protocol TimeScaleApi: class { +public protocol TimeScaleApi: AnyObject { var delegate: TimeScaleDelegate? { get set }