Xcode 6 Beta 4: Swift has access controls

July 21, 2014

Only 2 weeks after the previous beta release, we get the next iteration of Xcode and iOS. Here are some key features:

  1. ACCESS CONTROLS! I believe developers would have been outraged if Swift did not include this soon. While still in Beta, Swift does implement the important programming paradigm of access controls although it is done in a slightly different way, as to be expected. The basic description from Apples release notes is as follows:
    1. private entities can only be accessed from within the source file where they are defined.

    internal entities can be accessed anywhere within the target where they are defined.

    public entities can be accessed from anywhere within the target and from any other context that imports the current target’s module.

  2. Another nice one is the keywords @final, @lazy, @optional, and @required are drifting away from any Objective-C roots they had by making the @ sign not required. So you would just say final or lazy, for example.

  3. Another nice, almost superficial improvement is Xcode now recognizes comment annotations for the following: //MARK:, //TODO:, and //FIXME:. It will also include them in the jump bar so you can “jump” right to that point in code. This is nice to have since #pragma marks seem to have disappeared in Swift. Some at Apple believe using extensions would make more sense rather than throwing pragma marks everywhere, but I guess that is up to you 😃

  4. From what I can tell, the left pane in Xcode has been improved, there is not overlapping icons, which is great. Also, Xcode projects seems to have gotten a more Yosemite UI update. A+ for small UI changes.
  5. Lastly, I never used .by() functions, but their replacement of stride() functions looks straightforward and readable, kind of like those verbose Objective-C method signatures. Take a look at the examples in the Apple Release notes:
stride(from: x, to: y, by: z)      // was: (x..<y).by(z)
stride(from: x, through: y, by: z) // was: (x...y).by(z)

What I want to see

It is so cool to be developing in a new programming language as it is being created! All the big and important programming languages we know about have been out of Beta forever, but Swift is just getting started.

Tweet submit to reddit

Recent Posts

  • Moving From iOS To Server-Side Swift
  • The Default Memberwise Initializers Headache
  • Types of Swift Error Handling
  • My NSHipster Reader Submission
  • Top 9 Storyboard Mistakes in Xcode