elslooo / guitar-tuner

This repository hosts the result of a four-part series on Fourier transform.
https://elsl.ooo/2016/02/12/digital-tuner-ios-swift.html
MIT License
94 stars 22 forks source link

chore: swift 3 conversion wip #2

Open NathanWalker opened 7 years ago

NathanWalker commented 7 years ago

@elslooo This is an attempt to convert to latest Swift 3 and other XCode 8 compatibilities.

It is close but running into this at moment when you run it:

fatal error: storeBytes to misaligned raw pointer

Related to some of the conversion trials here: https://github.com/NathanWalker/guitar-tuner/blob/5ce8cd5385dbbd4352ef919985fae25dcdfc162b/Tuner/UI/PlotView.swift#L42-L87

You may know better how to convert that section? I've been using this migration guide: https://swift.org/migration-guide/se-0107-migrate.html Also this appears to show the closest example of what that section was intending to do: https://github.com/apple/swift-evolution/blob/master/proposals/0107-unsaferawpointer.md ^^ In there, search in browser for "UnsafeMutableRawPointer.storeBytes" and you'll see a sample using the new changes.

Also, I'm interested in doing a NativeScript conversion of this project for a tutorial if we can get this running in the new syntax and you would be alright with that?