I've actually used the _underscore convention in Swift to denote "private" members that nobody outside the type should touch, but that I want to expose to an extension on that type defined in a different file. It's a convention that works decently well with a little discipline.
Some time back, I pitched a few ideas for defining an access level that would allow you to limit access to a type to the type itself and any extensions on that type in the same project, but they went nowhere. Probably for the better, given the amount of complexity they would have introduced. Austin > On Jun 1, 2016, at 9:02 AM, Adrian Zubarev via swift-users > <[email protected]> wrote: > > I’d like to talk about your personal coding styles in swift for its access > control. > > Remember these variable names like __magic or _spell or even garbage_? > > Sure swift solves the synthesize problem but there might be old habits that > let us write such code. > > Here are some examples: > > internal _name > internal i_name > private __name > private p_name > > // not sure where `garbage_` would fit > I’d love to see your responses and opinions what and why the style you choose > suits you. > > > > > -- > Adrian Zubarev > Sent with Airmail > > _______________________________________________ > swift-users mailing list > [email protected] <mailto:[email protected]> > https://lists.swift.org/mailman/listinfo/swift-users > <https://lists.swift.org/mailman/listinfo/swift-users>
_______________________________________________ swift-users mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-users
