Live data from Hacker News

Swift 2 Apps in the App Store

developer.apple.com

1–10 of 33 posts

Re: Swift 2 Apps in the App Store

#2
I ran the “Convert > To Latest Swift Syntax” on an app with about six view controllers, four views, a network service, and three cocoapods. It worked surprisingly well, most of the changes were really just suggestions ("this var something could be a let something"), small change to how NSData unwraps.

I did have to guess around an obscure compile issue (solution: "Clean Build Folder"), but after that it was clear sailing.

My overall Swift experience has been terrific. I’m not the first to say this, but to anyone who’s wondering if it’s “ready”, yeah, it’s ready.

Re: Swift 2 Apps in the App Store

#3

I ran the “Convert > To Latest Swift Syntax” on an app with about six view controllers, four views, a network service, and three cocoapods. It worked surprisingly well, most of the changes were really just suggestions ("this var something could be a let something"), small change to how NSData unwraps. I did have to guess around an obscure compile issue (solution: "Clean Build Folder"), but after that it was clear sai…

+1 for mentioning the "Clean Build Folder" issue. I was stuck on that for about an hour yesterday, then I found this post:

http://stackoverflow.com/questions/32586144/upgraded-to-swif...

I didn't know about using the Alt key to reveal "Clean Build Folder", and I've been doing iOS dev for years. I'll add this to the list of unhelpful compile errors that are fixed by cleaning the build.

Re: Swift 2 Apps in the App Store

#4

I ran the “Convert > To Latest Swift Syntax” on an app with about six view controllers, four views, a network service, and three cocoapods. It worked surprisingly well, most of the changes were really just suggestions ("this var something could be a let something"), small change to how NSData unwraps. I did have to guess around an obscure compile issue (solution: "Clean Build Folder"), but after that it was clear sai…

+1 for mentioning the "Clean Build Folder" issue. I was stuck on that for about an hour yesterday, then I found this post: http://stackoverflow.com/questions/32586144/upgraded-to-swif... I didn't know about using the Alt key to reveal "Clean Build Folder", and I've been doing iOS dev for years. I'll add this to the list of unhelpful compile errors that are fixed by cleaning the build.

"Clean Build Folder" is basically the "turn it off, then turn it back on" of Xcode. Almost anytime you get a weird compiler error on a project that compiled fine moments ago, it's solved by "Clean Build Folder."

Definitely a good trick to know.

Re: Swift 2 Apps in the App Store

#5

I ran the “Convert > To Latest Swift Syntax” on an app with about six view controllers, four views, a network service, and three cocoapods. It worked surprisingly well, most of the changes were really just suggestions ("this var something could be a let something"), small change to how NSData unwraps. I did have to guess around an obscure compile issue (solution: "Clean Build Folder"), but after that it was clear sai…

+1 for mentioning the "Clean Build Folder" issue. I was stuck on that for about an hour yesterday, then I found this post: http://stackoverflow.com/questions/32586144/upgraded-to-swif... I didn't know about using the Alt key to reveal "Clean Build Folder", and I've been doing iOS dev for years. I'll add this to the list of unhelpful compile errors that are fixed by cleaning the build.

cmd+shift+k followed by cmd+alt+shift+k is a multiple-times-a-day incantation for me :)

Re: Swift 2 Apps in the App Store

#6
post #4

Earlier quoted context omitted.

+1 for mentioning the "Clean Build Folder" issue. I was stuck on that for about an hour yesterday, then I found this post: http://stackoverflow.com/questions/32586144/upgraded-to-swif... I didn't know about using the Alt key to reveal "Clean Build Folder", and I've been doing iOS dev for years. I'll add this to the list of unhelpful compile errors that are fixed by cleaning the build.

"Clean Build Folder" is basically the "turn it off, then turn it back on" of Xcode. Almost anytime you get a weird compiler error on a project that compiled fine moments ago, it's solved by "Clean Build Folder." Definitely a good trick to know.

Or for those who prefer automating, add this to ~/.bash_profile:

   alias nuke="rm -rf ~/Library/Developer/Xcode/DerivedData/"

Re: Swift 2 Apps in the App Store

#7

I ran the “Convert > To Latest Swift Syntax” on an app with about six view controllers, four views, a network service, and three cocoapods. It worked surprisingly well, most of the changes were really just suggestions ("this var something could be a let something"), small change to how NSData unwraps. I did have to guess around an obscure compile issue (solution: "Clean Build Folder"), but after that it was clear sai…

I love Obj-C (probably because I love Smalltalk). Before Swift 2, I didn't see what the excitement was about. Since using Swift 2, I want to use it everywhere. I will miss some of the dynamic features of Obj-C, but there are other ways to get to the same end. The terseness of Swift while maintaining Obj-C clarity, is wonderful.

Re: Swift 2 Apps in the App Store

#9

I ran the “Convert > To Latest Swift Syntax” on an app with about six view controllers, four views, a network service, and three cocoapods. It worked surprisingly well, most of the changes were really just suggestions ("this var something could be a let something"), small change to how NSData unwraps. I did have to guess around an obscure compile issue (solution: "Clean Build Folder"), but after that it was clear sai…

Swift 2 seems to have fixed one of my biggest bugbears about Swift 1: that if you command-clicked a function where one of the parameters was the wrong type, it wouldn't take you to the closest matching declaration in the headers (as it did in Obj-C) but would instead tell you that it couldn't find the function declaration. Now it seems to work! No more having to dig through the docs for small corrections.

Dunno about exceptions, though. I've seen lots of great arguments against them on HN and elsewhere, and the error reference (or alternatively double-return via tuple, especially since you can name tuple slots) seemed more clear.

Re: Swift 2 Apps in the App Store

#10

I ran the “Convert > To Latest Swift Syntax” on an app with about six view controllers, four views, a network service, and three cocoapods. It worked surprisingly well, most of the changes were really just suggestions ("this var something could be a let something"), small change to how NSData unwraps. I did have to guess around an obscure compile issue (solution: "Clean Build Folder"), but after that it was clear sai…

Definitely ready. I've had a Swift app out for 4 months and it's been quite successful[1], with no Swift-related issues.

I've just updated the app to Swift 2 and it's all working great.

The only issue has been related to the new Bitcode feature in iOS, which isn't Swift-specific. It's been very difficult getting third-party libraries with Bitcode support, but Bitcode is required for watchOS 2 apps.

[1] http://streaksapp.com

Post reply on HN