

Swifter – A Twitter Framework written in Swift - mattdonnelly
https://github.com/mattdonnelly/Swifter

======
specialk
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.

~~~
mattdonnelly
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

~~~
sAuronas
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.

------
bsaul
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).

~~~
mattdonnelly
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

------
cpr
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.

------
Jemaclus
FYI, there's another Swifter framework out there with the same name:
[https://github.com/glock45/swifter](https://github.com/glock45/swifter)

------
sz4kerto
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.. :)

~~~
mattdonnelly
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

~~~
mikevm
Why is the code so verbose?

    
    
         let result = CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, self.bridgeToObjectiveC(), charactersToLeaveUnescaped, charactersToBeEscaped, CFStringConvertNSStringEncodingToEncoding(encoding)) as String

~~~
mattdonnelly
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

~~~
menzoic
Swift should be less verbose

~~~
mattdonnelly
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

------
mloccy
cool bb

