Access control (III)

Then access control (b) write, action:

------------------------------------------ ------ initializer --------------------------------------------------

1. If no parameter like a public class initialization in another module to invoke the compiler generated default, must provide a public display, no arguments initializer

Because the default initializer public class is internal level

2. The structure has private \ fileprivate storage instance property, then his "member initializer" is also a private \ fileprivate level

Otherwise the default is internal

3.required saying their class initialization must have the same level of access? ? ? ? ? (To be supplemented)

 

---------------------------------------- access enumeration, protocol settings - -------------------------------------------

1. Enumeration

// not set the access level for each individual case, each case automatically receive the access level enum

The first // Here is wrong

2. Protocol

The protocol defined in claim individual access level can not be set to automatically receive access level outside, the same enumeration

 

Guess you like

Origin www.cnblogs.com/baisemoli/p/11265629.html