Skip to content

Instantly share code, notes, and snippets.

@mvnrc
mvnrc / breakpoint.png
Last active November 1, 2023 13:26
Print current UIViewController class name on viewDidAppear in debug console in Xcode (Swift/Objective-C)
breakpoint.png
@mvnrc
mvnrc / CArray.swift
Last active February 18, 2020 03:40
An extension of UnsafeMutablePointer for converting C array to Swift array
extension UnsafeMutablePointer {
/// Converts `C` decayed array to `Swift` array
///
/// - Parameter count: Number of elements in the `C` array
/// - Returns: Converted `Swift` array
public func toArray(count: Int) -> [Pointee] {
defer { self.deallocate() }
return Array(UnsafeBufferPointer(start: self, count: count))
}