9 ms·
Swift Has Reached 1.0
- krschultz 12y agoThis might be a stupid question, but does Objective-C have versions? Objective-C was always talked about in terms of the iOS version, even when the language itself was changing (eg blocks).
- deleted 12y ago[deleted]
- plorkyeran 12y agoThe language itself hasn't had any official version numbers since 2.0 (in 2006), but the runtime has (not very public) version numbers if you look at the source: http://www.opensource.apple.com/source/objc4/ http://www.opensource.apple.com/source/objc4/
- btn 12y agoNew Objective-C features are introduced with new versions of the compiler (and Xcode tools/SDK), but each feature may be deployed on different versions of iOS/OS X (depending on how much support they need from the underlying runtime/operating system). This table breaks it down: https://developer.apple.com/Library/mac/releasenotes/ObjectiveC/ObjCAvailabilityIndex/index.html https://developer.apple.com/Library/mac/releasenotes/Objecti...
- codemac 12y agoMy brother has been using swift to learn some programming. I don't have a mac, let alone iTunes. Is there a legal way for me to download/purchase a manual to help him with his progress?
- beggi 12y agoThe language manual is free at apple.com
- lukifer 12y agoAnd it's quite a good manual at that. Starts with a high-level overview of language features in plain English, then provides a firehose of nitty-gritty.
- jamhan 12y agoHere's a link to the iBook on iTunes: https://itunes.apple.com/us/book/the-swift-programming-language/id881256329?mt=11&ls=1 https://itunes.apple.com/us/book/the-swift-programming-langu...
- niutech 12y agoAnd the official e-book is available in multiple formats (PDF, MOBI, ePUB) on http://swiftlang.eu http://swiftlang.eu
- Zaheer 12y agoIf you mean learning Swift, check out www.LearnSwift.tips Disclosure: My Site
- codemac 12y agoNeat, thanks for the link. Also - tld of .tips? I need to register some funny names now
- Zaheer 12y agoLol ya it's one of the new ones. If you think that has potential check out all the new TLD's: http://newgtlds.icann.org/en/program-status/delegated-strings http://newgtlds.icann.org/en/program-status/delegated-string...
- jcurbo 12y agohttps://developer.apple.com/swift/resources/ https://developer.apple.com/swift/resources/ has lots of helpful info, including ebooks and videos.
- codemac 12y agoTHANK YOU That's what I was looking for. Really appreciate it. iOS/Xcode as a first programming environment is really odd and foreign to me, but my brother seemed excited about it, and I want to encourage him. He's really talented, he could be amazing as a software engineer if he ever wanted to be one.
- wmil 12y agoXcode is extra strange because it's so non Mac like. Drag with right mouse button to connect things, unintuitive icons with unhelpful hover text...
- jparishy 12y agoI posted this to HN the other day and people seemed to like it: http://www.runswiftlang.com/learn http://www.runswiftlang.com/learn It'll let you run Swift code from your browser. The Learn page gives you a short run down of some features as well (I'm in the middle of writing up content for it, what's there now is a placeholder really, just the basics) and links to more documentation from Apple.
- smtddr 12y agowww.sososwift.com has been my go-to. Beware, some of the vids are probably out-dated. It was my experience that every version of XCode6beta that came out broke my app with syntax or object-access type changes. I just downloaded XCode6GM and a bunch of stuff I was doing with "as NSArray" forced me to do "as? NSArray". And self.navigationController.navigationBar needed a "?" appended to controller, otherwise you'd get the very confusing build error saying something like "navigationController has no member called navigationBar".
- codemac 12y agoCool, that looks like a great resource. And thanks for the code conversion tips :)
- davexunit 12y agoYour brother should instead use a programming language with a cross-platform, free software implementation.
- jskonhovd 12y agoI don't know if Swift would be the best language to learn programming. Python is probably a better option. I would avoid platform specific languages until you are hired to work in that space. Open platforms like Python are much easier than close platforms to get started in Computer Science. A good place to start with python would be the Introduction to Computer Science course on Udacity. https://www.udacity.com/course/cs101 https://www.udacity.com/course/cs101 If you are interested in ML, I can recommend taking the Programming Languages course on Coursera after the python course. https://www.coursera.org/course/proglang https://www.coursera.org/course/proglang
- platz 12y agoThe Programming Languages course on Coursera: highly recommended
- smaili 12y agoStupid question but is Swift just compiled into Objective-C? I'm asking because I'd like to know if I can write an app in Swift that can run on iOS6.
- andrewchambers 12y agoswift compiles to llvm not objective c.
- jlmendezbonini 12y ago> I'd like to know if I can write an app in Swift that can run on iOS6. No. From Xcode6 release notes: "iOS 7 and OS X 10.9 minimum deployment target The Swift compiler and Xcode now enforce a minimum deployment target of iOS 7 or OS X Mavericks. Setting an earlier deployment target results in a build failure."
- mwcampbell 12y agoTo clarify, is Xcode 6 enforcing a minimum deployment target of iOS 7 even if the app is written in Objective-C and not Swift? If so, I think I'll need to stay on Xcode 5 a bit longer.
- altyus 12y agoiOS6 user base will be miniscule in a few weeks unless you are targeting corporate or education markets which update slowly.
- fleitz 12y agoNo, more correctly ObjC is compiled into assembler that uses a C/C++ runtime. Swift uses some C/C++ under the hood, and integrates it's object model into the ObjC object model (which is C). However, swift structs are not objects, from what I can tell they are virtually identical to structs in C (from a memory layout perspective). Some swift objects are incompatible with the ObjC object model and cannot really be used from ObjC or really any other language (it does name mangling like C++ which makes interfacing rather difficult) https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ObjCRuntimeRef/Reference/reference.html https://developer.apple.com/library/mac/documentation/Cocoa/...
- cdnsteve 12y agoThat's fantastic! Now, too bad I can't watch your video tutorials on my Macbook Pro using Chrome. Or Windows 7 using Chrome. The messaging on the site declares it requires Safari. So much of the open web... Quietly moves along to Android.
- programminggeek 12y agoThe web is totally open, but just because something is open doesn't mean you have to support it the same way everywhere. Not everything has to run on everything. As a creator of something, Apple should totally have the right to decide what is best for their own products, website, etc.
- alayne 12y agoYou can download the non streaming versions if you need to.
- threeseed 12y agoApple's stream is just HTTP Live Streaming with H.264 IIRC. Which means the issue is quite clearly with Google and their insistence on using VP8/WebM instead of what almost every other company is using.
- jallmann 12y agoSafari is the only browser that implements HLS except recent Android. Chrome does support H.264 in HTML5.
- bellerocky 12y agoI think HLS is pretty awesome and this hasn't anything to do with HTML5 as what Chrome supports doesn't allow for live streaming, which is why sites like Twitch still use flash for Chrome. Chrome should support HLS, but they aren't going to for anything but Android, so flash it is for the foreseeable future. If anyone knows why or where I am mistaken I would like to know.
- akkartik 12y agoGM?
- tvon 12y agoGold Master, the version that will be released to the public barring any surprise blockers. http://en.wikipedia.org/wiki/Software_release_life_cycle#RTM http://en.wikipedia.org/wiki/Software_release_life_cycle#RTM
- GuiA 12y agoGolden Master. Typically refered to the version of the software that would get burned on floppies/CDs, although the word has taken a more fluid meaning with ubiquitous digital distribution.
- DAddYE 12y agoHey guys, do you know if swift will be ever open-sourced? After the WWDC they said that was early to think about it while in beta. So, what's the status now?
- xasos 12y agoOpen-sourcing it would be really cool to see. Chris Lattner last said he wasn't sure if they were going to open source it (http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-June/073698.html http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-June/073698....)
- DAddYE 12y agoYep, we damn need a bit of more competition within bigs, right now seems just between Google and Mozilla (for the type of language).
- riffraff 12y agoI think at this point we also have facebook embracing D ?
- pjmlp 12y agoWhat competition?!? Until either of them support their languages on their respective OSs there isn't any competition.
- 72deluxe 12y agoI think without the supporting runtime libraries also being open-source, there isn't any point in open-sourcing the language is there? I mean, look at GNUStep. Not widespread adoption.
- threeseed 12y agoActually there is. One of the big selling points of Go is its ability to produce self contained binaries. Swift would share this but also be a language that is more full featured. GNUStep failure is more to do with Objective-C being such an odd language for most people.
- Jweb_Guru 12y agoI am not the biggest Apple fan in the world, and will probably not use Swift professionally, but I'm still super enthused about it as a language and I am glad it's entering the marketplace. We're going to have sum types and type inference in a mainstream language! For the first time, professors can teach a language like SML and have a good response to the question "so how is this going to help me in the real world?" I really, genuinely hope this will lead to better choices of languages in introductory programming classes.
- pjmlp 12y agoThey didn't need Swift for real world examples. F#, Scala, OCaml, Haskell, Clojure already have uses at big financial corporations and bio-informatics. However, Swift is another great way for spreading the ML gospel to mainstream developers, specially if it slowly takes Objective-C's place in Apple's heart.
- threeseed 12y agoScala/Clojure have been used pretty much everywhere. Especially with the move towards microservices and reactive architectures.
- tomp 12y agoDoes Clojure support pattern matching? AFAIK, the only thing that is "functional" about Clojure is its immutable data structures (and closures, but even JS has those).
- _pmf_ 12y agoIt has a support for destructuring, but no true pattern matching. Given the lack of algebraic data types, there's the question on what pattern matching would be supposed to match on.
- pjmlp 12y agoFunny to call a Lisp dialect functional between quotes. When Lisp and lambda calculus are the very genesis of FP. Yes, Lisp can do pattern matching, usually implemented via macros, In Clojure you use the core.match library.
- tzakrajs 12y agoWhat is this? Javascript for Mac?
- nobbyclark 12y agoYes. And put together in even less time than JavaScript 1.0
- andrewchambers 12y agoThat isn't true. Swift has been dev for quite a long time in secret.
- kybernetyk 12y agoRegarding which basic features they had to add after the first wave of beta feedbacks I don't believe them that they have been developing + using the language for years.
- andrewchambers 12y agoIt wasn't in heavy use, Chris Lattner was experimenting with it solo i thought.
- gress 12y agoIf true, you should be seriously scared of what Apple is capable of.
- deleted 12y ago[deleted]
- thurn 12y agoAny word on whether they added static library support? Not having it is kind of a dealbreaker for my workflow, unfortunately.
- marcomonteiro 12y agoCan you elaborate on how static library support is a hard requirement for your workflow and why frameworks (LLVM modules) don't meet your needs. I'm genuinely curious as I haven't had a chance to do any real work in Swift yet. Fellow Googler btw.
- thurn 12y agoA lot of tools don't support them yet. Robovm in my case (I filed a bug against them, though), but also Cocoapods, for example.
- bezalmighty 12y ago"You can now submit your apps that use Swift to the App Store. "-that's great news! For Hackers in SF: We are running a Swift Hackday at GitHub HQ on the 27th September. There will be food, drink, swag and lots of other Swift hackers! Check it out & RSVP at http://SwiftHack.splashthat.com http://SwiftHack.splashthat.com
- wycats 12y agoI don't believe this is the traditional definition of "reached 1.0".
- nardi 12y agoWhat do you mean?
- wycats 12y ago"You’ll notice we’re using the word “GM”, not “final”. That’s because Swift will continue to advance with new features, improved performance, and refined syntax" Typically, when people say that a language "reached 1.0", they mean the very end of that process.
- nardi 12y agoAh. Well, other languages also get new features, improved performance, and refined syntax after 1.0. Are you objecting to the implication that the pace of development here will be more rapid, or an assumption that they plan on making backwards-incompatible changes?
- _pmf_ 12y ago> Typically, when people say that a language "reached 1.0", they mean the very end of that process. That's wrong for practically all cases I know of (Java, C#, Python, Perl).
- 12y ago
- melling 12y agoI have a list of Swift resources that I've been collecting: http://www.h4labs.com/dev/ios/swift.html http://www.h4labs.com/dev/ios/swift.html
- deleted 12y ago[deleted]
- niutech 12y agoThe more established Swift resource center & community forum is here: http://swiftlang.eu http://swiftlang.eu
- stefantalpalaru 12y agoWhy is a programming language without any open source implementation getting so much attention?
- pjmlp 12y agoBecause: - it brings interactive programming concepts (Playgrounds) into many mainstream developers. - it belongs to the ML language family - it recognizes the advances in mainstream computing in the last 30 years - not everyone like to type @somekeyord and [some method call] everywhere. - many of us do buy development tools and open source is just a nice to have feature
- aroman 12y ago> - many of us do buy development tools and open source is just a nice to have feature I realize this seems nit-pick-y (and for that I apologize), but that's a false dichotomy. Open source != free. It's possible to pay/buy open source software.
- pjmlp 12y agoYes, but I am yet to meet pure open source advocates that pay for more than just hardware.
- romanovcode 12y agoBecause it's Apple. When Swift was released every hipster and his cat jumped the wagon on how great it is. I even saw someone trying to make webstack out of it.
- danford 12y agoDon't know why you're getting down voted, sure Swift has some neat features, but if any other company released something like this that was closed source, no one would really care.
- 12y ago
- Yuioup 12y agoCan somebody tell me why in 6-7 years I will be rewriting Swift apps ?
- jehb 12y agoSorry, I'm pretty sure you meant Swift has reached 2.0. And that was a couple of months ago. Also why are you people talking about Swift like it's a programming language and not an object storage system? :) http://opensource.com/business/14/7openstack-swift-brings-storage-policies http://opensource.com/business/14/7openstack-swift-brings-st...
- PopsiclePete 12y agoI can't believe Apple would release a brand-new language with zero baked-in support for concurrency. In this day and age? Looks like developers will have to resort to 2nd grade efforts like GCD. I just don't get it. There's no excuse for it. Port Go's channels and go-routines to it, or something else, but come on - it's 2014, not 1998?
- easytiger 12y agoWell they are the people who sold a phone with no support for background tasks. They can do as they please.
- alayne 12y agoSwift has GCD and NSOperationQueue which work well. Why marry yourself to that functionality if you can externalize it with the potential to change it in the future? Why doesn't Go have generics and sum types?
- Someone 12y agoSo, what kind of 1.0 release is this? - It's Keynote time/September 9, so we call what we have, crashing bugs included, 1.0. - We culled the features that do not work reliably yet, polished the good parts, and called it 1.0. - This is a/the set of features that we consider to form a good product, and all features work reasonably well.
- mikeash 12y agoI'd say it's a bit of all three. This is clearly a marketing-driven 1.0. It's really not ready, and wouldn't reasonably be called a 1.0 otherwise. However, they've been pretty good about sticking to a solid set of features and not over-extending themselves for this initial release. It seems fairly clear that they intend to go in and fill out a lot of stuff later, and preferred a smaller set of solid features to start with rather than trying to do everything at once.
- jobu 12y agoThey've also been pretty clear that the language is going to be in a state of flux for long while. From the Swift Blog: "Binary Compatibility and Frameworks While your app’s runtime compatibility is ensured, the Swift language itself will continue to evolve, and the binary interface will also change. To be safe, all components of your app should be built with the same version of Xcode and the Swift compiler to ensure that they work together. This means that frameworks need to be managed carefully. For instance, if your project uses frameworks to share code with an embedded extension, you will want to build the frameworks, app, and extensions together. It would be dangerous to rely upon binary frameworks that use Swift — especially from third parties. As Swift changes, those frameworks will be incompatible with the rest of your app. When the binary interface stabilizes in a year or two, the Swift runtime will become part of the host OS and this limitation will no longer exist."
- stephenaevans 12y agoMight be time to learn Swift.
- no_future 12y agoCan anyone tell me about the interop situation? I'm working on my first iOS app and doing it all the old way with Obj-C, and some things have been a little difficult to grok even though they've been around a while(AVFoundation). I'm very interested in the new Metal graphics API that Apple showed at their presentation. Not sure if I should just switch to Swift for everything now or continue learning/working in Obj-C and slowly transition.
- mayoff 12y agoI wouldn't recommend Swift to anyone that's new to the iOS SDK. I answered this question recently on stack overflow (http://stackoverflow.com/a/25751738/77567 http://stackoverflow.com/a/25751738/77567). Here's what I said: - Objective-C will be around and supported for a long time. (Apple has a massive amount of Objective-C source code that it's not going to port to Swift any time soon.) - Almost all iOS tutorials, examples, and books use Objective-C. - Almost all iOS-specific third-party source code you might want to use is implemented in Objective-C. - It's easier to use C and C++ libraries from Objective-C than from Swift. - There are many Objective-C experts you can get help from. There are very few Swift experts. - The Swift language and its standard library are currently not very well documented. Stick with Objective-C for now. When you're comfortable with the iOS SDK and Swift is better documented, you can consider learning Swift.
- SiVal 12y agoApple could dramatically accelerate this process by switching their own new development from ObjC to Swift. The huge amount of legacy code means this couldn't happen overnight, but if Apple is obviously making the switch for their own new development, Swift will have a huge credibility boost. Apple wouldn't be able to abandon it (or let development stall) without hurting themselves. Until Apple puts themselves at a similar degree of risk as other Swift adopters, developers are going to wonder about the wisdom of committing to an Apple-only platform that Apple hasn't committed to.