Pre declaration of function

2873 단어

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/"

좋은 웹페이지 즐겨찾기