🔰Access Control

5 個層級,最高到最低依次為:

  • open / public / internal / file-private / private

fileprivate

The only reason you would use fileprivate is when you want to access your code within the same file from different classes or structs. 👉 SwfitLee

// fileprivate setter
fileprivate(set) var a = 1

private

extensions have to be defined within the same file, private declarations are not visible outside the file.

Last updated

Was this helpful?