What's happened with CMutablePointer and CConstPointer in Xcode Beta3?

beta, swift, xcode

Solution

Use UnsafePointer and ConstUnsafePointer respectively.

From the Release Notes:

APIs imported from C that use C pointers are now imported with a much simpler API type structure which is more predictable, preserves const mutability in more cases, and preserves __autoreleased pointer information. Now you will see UnsafePointer, ConstUnsafePointer, AutoreleasingUnsafePointer, etc. Function pointers are also imported now, and can be referenced and passed around. However, you cannot call a C function pointer or convert a closure to C function pointer type.!

Problem

What's happened with CMutablePointer and CConstPointer in Xcode Beta3? Code that successfully compiles in Beta2 fails with the errors: ``` Use of undeclared type 'CMutablePointer' ```

Original source