Re: OT: Swift Code Autoformatter?
Re: OT: Swift Code Autoformatter?
- Subject: Re: OT: Swift Code Autoformatter?
- From: Jens Alfke <email@hidden>
- Date: Fri, 15 Jan 2016 11:47:54 -0800
> On Jan 15, 2016, at 10:47 AM, Quincey Morris <email@hidden> wrote:
>
> — You have a utility that assists conversion from (say) Obj-C to Swift by reformatting at least the easy things according to the destination language syntax. This is the use case that the other Charles added to the discussion last night.
FYI, I wrote such a thing last year — Swiftier: https://github.com/snej/swiftier
It’s a Ruby script that reads Objective-C source files and does a bunch of regex matching and other hacky stuff to output something that’s a lot more like Swift source code. It’s definitely not going to compile without work, unless you’re very lucky, but it’ll save you a lot of grunt work.
(Oh, I wrote this before Swift 2, so it doesn’t convert NSError** parameters into “throws” clauses or anything like that. You can use Xcode’s updater tool to do that afterwards…)
—Jens
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden