Skip to content

'Point' initializer is inaccessible due to 'internal' protection level #5

@vinaysingh8866

Description

@vinaysingh8866

Hey, I'm trying to use scatter plot and while creating a point object it's showing me error the initializer is inaccessible. init needs to be public.
public init( x: CGFloat, y: CGFloat, weight : CGFloat = 0.5 ){
self.location = CGPoint(x: x, y: y)
self.weight = weight
}

public init(point: CGPoint) {
self.init(x: point.x, y: point.y)
}

@State var points:[Point] = []
points.append(Point(x: 2.0, y: 3.0))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions