Skip to content

Instantly share code, notes, and snippets.

@ahcode0919
Created April 28, 2017 11:33
Show Gist options
  • Save ahcode0919/d7b3ecc12de487cc4fd2eef176072e00 to your computer and use it in GitHub Desktop.
Save ahcode0919/d7b3ecc12de487cc4fd2eef176072e00 to your computer and use it in GitHub Desktop.
Comment formatting in Swift
import Foundation
/// General doc comment
struct SomeClass {
private static var count: Int = 0
let aString: String
// MARK: - Initializers
init(aString: String) {
self.aString = aString
SomeClass.count += 1
}
// TODO: Add nullable initializer
//init?(aString: String?) {
//
//}
// MARK: - Class functions
/// Get total number of
///
/// - Returns: return value description
static func getCount() -> Int {
// FIXME: Change to String
return count
}
// MARK: - Instance functions
/// Function description
///
/// - Parameter afterAppending: parameter description
/// - Returns: return value description
func getAString(afterAppending: String?) -> String {
return afterAppending != nil ? "\(aString)\(afterAppending)": aString
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment