public class SelectedValue {
static let sharedInstance = SelectedValue()
public var reportPostId : Int? = nil
public var report_GroupId : Int? = nil
public var postType : String? = nil
}
'init' is inaccessible due to 'internal' protection level Please help me to solve this. Thanks
As it says, the
init
method (that you probably called without it's name) isprivate
. make it morepublic
to access it.Click on the gray lines that say 'init' declared here to jump to the source of the issue.
Note that
MyClass()
is equal toMyClass.init()
. that means you are calling theinit
method each time you build an object.And also note that if you don't specify the access level, it will be
internal
by default.So this:
is equal to:
So you should change it to: