#35: The #pragma mark Equivalent in Swift

Swift does not use #pragma mark, but Xcode recognizes special comments that serve the same purpose.

// MARK: - Public API
// TODO: Add caching
// FIXME: Remove force unwrap

// MARK: creates sections in the jump bar and source navigator, which makes large files easier to scan.

The - after MARK: is optional, but it usually improves readability by visually separating the section title.


I'm also on Twitter and GitHub.

Subscribe via RSS.