Skip to content
This repository was archived by the owner on Dec 2, 2020. It is now read-only.
This repository was archived by the owner on Dec 2, 2020. It is now read-only.

Problems with deprecated methods in Swift #214

@mbeaty

Description

@mbeaty

There are multiple versions of the lineGraph:labelOnXAxisForIndex: method. One is not Swift-compatible and deprecated and in the delegate protocol. The other is Swift-compatible and in the data source protocol. If your class conforms to both the delegate and the data source protocol, there is no way to properly use the Swift-compliant version of this method, because of the conflict between the two methods that get bridged. I can only use this method in Swift if I implement it as

func lineGraph(graph: BEMSimpleLineGraphView, labelOnXAxisForIndex index: Int) -> String! {...}

This is not correct and results in an Xcode warning. It should be

func lineGraph(graph: BEMSimpleLineGraphView, labelOnXAxisForIndex index: Int) -> String? {...}

but due to the conflict introduced by conforming to both protocols, it's impossible to implement it that way.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions