65

I have started creating some Q&A posts regarding the changes from Swift 2.x to 3. With the release of Xcode 8 Beta 1 today, I would imagine that users will start asking more and more questions about Swift 3, Xcode 8, and iOS 10.

Most of the class name changes are trivial: NSUserDefaults became UserDefaults, NSTimeInterval became TimeInterval, and NSDate now has a Swift struct equivalent Date.

How should we handle questions about the rename? Should a canonical community wiki be created that addresses this issue? Something titled "Use of undeclared identifier NS[Class]" or "NS[Class] is unavailable, use [Class]?"

17
  • 7
    Maybe change the question to ask about the general approach when you see possible dupes coming in from new technology.
    – Rizier123
    Commented Jun 14, 2016 at 3:36
  • 7
    They finally dropped the NS prefix in iOS 10? Or is this only when accessing the APIs from Swift?
    – Cody Gray Mod
    Commented Jun 14, 2016 at 4:33
  • 8
    @CodyGray nope, all of the NS prefixed classes are still there, but there are new Swift structs without the prefix that have the NS-class as a ReferenceType. See the Foundation API changes for iOS 10.
    – JAL
    Commented Jun 14, 2016 at 4:36
  • UserDefaults | NSUserDefaults: developer.apple.com/reference/foundation/nsuserdefaults
    – Pang
    Commented Jun 14, 2016 at 6:13
  • 4
    IMHO new tag and be done with it...
    – AStopher
    Commented Jun 14, 2016 at 6:53
  • 4
    Swift and Objective-C questions get mixed together a lot. I'm personally in favor of anything that can be done to make a clean start, even if this means being a little lax on the duplicates at first.
    – Suragch
    Commented Jun 14, 2016 at 10:45
  • 12
    Another point is the renaming of OS X to macOS. What about tags?
    – Sulthan
    Commented Jun 14, 2016 at 13:27
  • 1
    @Sulthan macos has been a synonym of osx for a while now. We should probably wait until Sierra is publicly available to consider changing it, since it would impact all questions about previous versions of the OS as well.
    – TylerH
    Commented Jun 14, 2016 at 13:52
  • 12
    I'm not sure we want this... I mean, will we create several questions just because the toaster stabs you in the face when you don't RTFM?
    – Braiam
    Commented Jun 14, 2016 at 16:46
  • 2
    Is this really a question about how a developer migrates to Swift 3? If so, a canonical question & answer that points users to the Xcode migration tool first and then Apple's documentation can be used to close these questions. Commented Jun 14, 2016 at 20:56
  • @RoboticCat partially, although I would imagine it would need to cover existing developers starting new projects and seeing that the classes they know are no longer available.
    – JAL
    Commented Jun 14, 2016 at 20:57
  • If those questions were already asked, then we can just (and I'm presuming the renaming is just that, a renaming) edit the existing answers to append the errata that iOS 10 and later uses the new naming. Considering that Apple closed garden will force you to do the upgrade anyways, you can basically demote to background the previous naming.
    – Braiam
    Commented Jun 15, 2016 at 1:04
  • 5
    i think those tags are way too specific to exist for a single class. when the NS prefix is dropped, it sounds way too meta. Commented Jun 15, 2016 at 10:42
  • Shouldn't this be handled by the Documentation? The beta is coming soon.
    – Knu
    Commented Jun 16, 2016 at 0:26
  • 2
    @Knu if things continue as they are, winter will arrive first.
    – Braiam
    Commented Jun 19, 2016 at 11:01

1 Answer 1

8

This question actually brings up a more general issue with SO. The best way of doing things can change over time. Often you will have an answer with hundreds of votes -- but the answer and the votes are both several years old. People don't realize that a lower-ranked answer, with fewer, but more recent, votes, is actually a better way of doing things.

For this kind of reason, I'd suggest letting new questions grow around the new names. In some cases, the old answers will still be good, and they can be suitably modified and referenced. In other cases, the change to a new question, with fresh votes, will give a newer answer, updated for new circumstances, a chance to take hold.

2
  • Earlier today I posted a question with the NSSortDescriptor tag. It's specifically about Swift3 and SortDescriptor, but I could not create that tag, and I felt it was better to use an outdated tag for the general principle than to use only 'Swift 3.0'. So this 'new names' thing might run aground on practicality. Commented Jun 16, 2016 at 14:57
  • @green_knight I think tags for individual classes are way too narrow and should probably not exist.
    – Raphael
    Commented Apr 20, 2017 at 12:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .