Simply prefix the property declaration with private(set)
, like so:
public private(set) var hours: UInt = 0
public private(set) var minutes: UInt = 0
public private(set) var seconds: UInt = 0
private
keeps it local to a source file, while internal
keeps it local to the module/project.
private(set)
creates a read-only
property, while private
sets both, set
and get
to private.