Pre declaration of function

MarkDown in Swift

In Swift func, We are use MarkDown grammar write explanatorily,The MarkDown grammar is important in programer. It is all Programer must Stududy. Please nether code.

class Something {
    init()n {}
}
/** 
- out of order list
* out of order list
+ out of order list

1. orde list
2. order list

Add codes  use three “ ` ”  in code cross refer, It's same to markDown, cool
Add single line code one "`" in code cross refer .     eg: `aaa`
[url](http://...)
![](httP://...)
*/
func showMultilineComments() -> String {
    let text = "You can user the /** .... */ for multiline Comments"
    return text
}

///There can write single line text.
///more '///' can more line, code can auto conbination .
func method () -> Sting {
    let text = "You can user the \/\/\/ for multiline Comments"
}

Domain in Func(Parameters, Return, Throws)

/**
There are a few keyowrd Xcode can recognize automatically.
- Parameter iterm1: This is item1
- Parameter iterm2: This is item2 

- Parameters:
    - iterm1: This is item1
    - iterm2: This is item2
- Retuens: the result String.
- Throws: `MyError.BothNilError` if both item1 and item2 are nil.
*/
func showKeywordsCommentsWithItem(item1: AnyObject?, iterm2: AnyObject?) throws -> String {
    let text = "There are a few keyowrd Xcode can recognize automatically."
    retuen text
}

Domain in Algorithm

/**
- Preconditi on: 前置条件 The Object must contain all the information in the word
- Postcondtion: 后置条件 After the algorithm, the object will contain all the information in the universe
- Requires: 内容 all the informartion in the object should be sorted
- Invariant: 循环不变量 the object will maintain sorted
- Complexity: 空间复杂度O(n^n) 
- Important: 重要信息 Please only call this algorithm once in your program
- Warning: 警告信息 very computation consuming
- Attention: 也是警告信息 same as warning
- Note: 相应的记录 I terribly doubt this algorihtm
- Remark: 评论 same as note
*/
func mySteriousAlgorithm(object: AnyObject) {

}

Meta information

- Author: liuyubobobo 作者
- Authors: All the geeks in the word:) 作者们
- Copyright: liuyubobobo@2016 版权信息
- Date: 26 Jan, 2016 时间
- Since: iOS 5
- Version: 3.1415 版本号

Remark

In All compiler have pertreatment order. e.g.: FIXME、PARM、TODO,But In Xcode no have Fixme 、TODO sentence,you can in Project -> Target -> project -> Build Phaser -> add new Script Phaser in little code:/bin/sh

TAGS="TODO:|FIXME:"echo "searching ${SRCROOT} for ${TAGS}"find "${SRCROOT}" ( -name ".swift" ) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($TAGS).\$" | perl -p -e "s/($TAGS)/ warning: \$1/"

你可能感兴趣的:(Pre declaration of function)