Created
April 28, 2017 11:33
-
-
Save ahcode0919/d7b3ecc12de487cc4fd2eef176072e00 to your computer and use it in GitHub Desktop.
Comment formatting in Swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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