News for hackers. Stuff that matters.
Re:Swifter – A Twitter Framework written in Swift by specialk on Saturday June 14, 2014 @12:52PM (#7893115)
Can the OP tell us anything about building their Twitter framework in Swift. Any gotchas or problems they came across building it? Is Swift ready for the primetime. Should I start switching all my apps to Swift ASAP? Otherwise I'm just starting at code in a language I can hardly read.
Re:Swifter – A Twitter Framework written in Swift by jmduke on Saturday June 14, 2014 @01:46PM (#7893211)
I'm rewriting one of my apps in Swift and I'm enjoying it a lot, but it's definitely a bumpy road. You're dealing with both a beta IDE and a beta language, and you have to get used to a myriad of errors, some of which are indecipherable (arcane things like issues iterating over an array or Optional behavior that doesn't mesh with documentation/templates). Still, Swift is a joy to program in compared to Objective-C (at least IMHO) and its giving me the chance to re-architect a very poorly planned v1.0, so that alone is worth the trouble.

I think it's a good idea if you're very interested in learning Swift, but not really worth doing for its own sake.

Re:Swifter – A Twitter Framework written in Swift by mattdonnelly on Saturday June 14, 2014 @01:52PM (#7893219)
Most of problems I encountered while writing this came from Swift's interoperability with Objective-C. It can often be difficult to work with and takes a while to get used to. I actually think it would be worth developers considering porting their existing Objective-C libraries to Swift for this reason alone. That said, I don't think developers should start porting their App Store apps yet. It still feels very much like it's in beta and some functionality hasn't been implemented (such as static class variables). Despite this though, I think Swift has a huge amount of potential, and once things really kick off with it, we'll probably be seeing a lot more developers writing apps in Swift than in Objective-C. The language really has a lot to offer over Objective-C in my opinion

PS: hi kevin

Re:Swifter – A Twitter Framework written in Swift by sAuronas on Saturday June 14, 2014 @02:19PM (#7893281)
I thought I was imagining the static class problem...the documentation, while well-written, leaves much to be desired, especially for the above-mentioned. I've enjoyed writing in Swift so far but the playground crashes often. Xcode has not yet, so that has helped.
Re:Swifter – A Twitter Framework written in Swift by bsaul on Saturday June 14, 2014 @12:59PM (#7893135)
One question related to building framework on ios : does swift provide any benefit over objective c for creating frameworks ? I suppose it doesn't make any difference since those kind of issues are more related to the OS or the IDE but i was just wondering. Creating frameworks that you can easily distribute in both debug / release mode for both simulator/device has always been such a hassle ( and even more so when it contains resource bundles).
Re:Swifter – A Twitter Framework written in Swift by mattdonnelly on Saturday June 14, 2014 @01:32PM (#7893190)
The processes for creating frameworks in Swift is pretty much the same as with Objective-C. That said Xcode 6 has made it much easier to handle distributing frameworks for different devices
Re:Swifter – A Twitter Framework written in Swift by cpr on Saturday June 14, 2014 @02:57PM (#7893372)
One gotcha is that Obj-C classes can't subclass Swift classes. Or at least that's what I got from the docs.

So writing frameworks designed to be subclassed means you're probably stuck in Obj-C for quite some years.

Re:Swifter – A Twitter Framework written in Swift by Jemaclus on Monday June 16, 2014 @01:22PM (#7900236)
FYI, there's another Swifter framework out there with the same name: https://github.com/glock45/swifter
Re:Swifter – A Twitter Framework written in Swift by sz4kerto on Saturday June 14, 2014 @12:43PM (#7893094)
And it starts again - web framework, 2048, flappy bird, http server, PySwift, JSwift, How I switched from Go to Swift, Swide: The Open Source swift IDE.. :)
Re:Swifter – A Twitter Framework written in Swift by mattdonnelly on Saturday June 14, 2014 @01:26PM (#7893181)
This was actually part of something else I've been working on rather than attempt at deliberately reinventing the wheel. That said, I do think there's some benefit in rewriting existing Objective-C frameworks in Swift as Swift's interoperability with Objective-C can be difficult to deal with at times
Re:Swifter – A Twitter Framework written in Swift by mikevm on Saturday June 14, 2014 @01:47PM (#7893214)
Why is the code so verbose?

     let result = CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, self.bridgeToObjectiveC(), charactersToLeaveUnescaped, charactersToBeEscaped, CFStringConvertNSStringEncodingToEncoding(encoding)) as String
Re:Swifter – A Twitter Framework written in Swift by mattdonnelly on Saturday June 14, 2014 @01:55PM (#7893224)
Almost all of Apple's frameworks written in Objective-C and C are incredibly verbose. It's just an adopted style of the language and although it's often a little difficult to look at, it can be quite helpful sometimes
Re:Swifter – A Twitter Framework written in Swift by menzoic on Saturday June 14, 2014 @01:56PM (#7893227)
Swift should be less verbose
Re:Swifter – A Twitter Framework written in Swift by mattdonnelly on Saturday June 14, 2014 @02:00PM (#7893240)
It is actually, but functions like the one mentioned above are bindings for Objective-C / C functions and share the same name as the function they bind to
Re:Swifter – A Twitter Framework written in Swift by cschep on Saturday June 14, 2014 @01:56PM (#7893229)
While Swift is a new language, that method is calling into very old framework code written in Objective-C. Which is very verbose.
Re:Swifter – A Twitter Framework written in Swift by Glide on Saturday June 14, 2014 @02:33PM (#7893315)
That looks more like a C function call. If it was an Objective C message the named parameters would make it far more verbose (and readable).
Re:Swifter – A Twitter Framework written in Swift by higherpurpose on Saturday June 14, 2014 @01:08PM (#7893146)
Maybe they'll make even a Swift SPDY server.
Re:Swifter – A Twitter Framework written in Swift by mloccy on Saturday June 14, 2014 @11:56AM (#7893000)
cool bb