Skip to content

Commit

Permalink
Replace protocol inheritance from class with AnyObject
Browse files Browse the repository at this point in the history
  • Loading branch information
KungFooBar committed Aug 6, 2021
1 parent 1cf93ff commit 370a5cb
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion LightweightCharts/Classes/Implementations/API/Chart.swift
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation
import WebKit

protocol JavaScriptEvaluator: class {
protocol JavaScriptEvaluator: AnyObject {

func evaluateScript(_ script: String, completion: ((Any?, Error?) -> Void)?)
func decodedResult<T: Decodable>(forScript script: String, completion: @escaping (T?) -> Void)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
protocol JavaScriptObject: class {
protocol JavaScriptObject: AnyObject {

var jsName: String { get }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation
import WebKit

protocol MessageHandlerDelegate: class {
protocol MessageHandlerDelegate: AnyObject {

func messageHandler(_ messageHandler: MessageHandler,
didReceiveClickWithParameters parameters: MouseEventParams)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation
import WebKit

protocol ClosuresStore: class {
protocol ClosuresStore: AnyObject {

func addMethod<Input, Output>(_ method: JavaScriptMethod<Input, Output>, forName name: String)

Expand Down
2 changes: 1 addition & 1 deletion LightweightCharts/Classes/Implementations/WebView.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import WebKit

public protocol JavaScriptErrorDelegate: class {
public protocol JavaScriptErrorDelegate: AnyObject {

func didFailEvaluateScript(_ script: String, withError error: Error)

Expand Down
2 changes: 1 addition & 1 deletion LightweightCharts/Classes/Protocols/ChartApi.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion LightweightCharts/Classes/Protocols/PriceLineApi.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

public protocol PriceLineApi: class {
public protocol PriceLineApi: AnyObject {

func applyOptions(options: PriceLineOptions)
func options(completion: @escaping (PriceLineOptions?) -> Void)
Expand Down
2 changes: 1 addition & 1 deletion LightweightCharts/Classes/Protocols/PriceScaleApi.swift
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion LightweightCharts/Classes/Protocols/SeriesApi.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

public protocol SeriesApi: class {
public protocol SeriesApi: AnyObject {

associatedtype Options: SeriesOptionsCommon
associatedtype TickValue: SeriesData
Expand Down
2 changes: 1 addition & 1 deletion LightweightCharts/Classes/Protocols/TimeScaleApi.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import CoreGraphics

/** Interface to chart time scale */
public protocol TimeScaleApi: class {
public protocol TimeScaleApi: AnyObject {

var delegate: TimeScaleDelegate? { get set }

Expand Down

0 comments on commit 370a5cb

Please sign in to comment.