当前位置:网站首页>Swift--function

Swift--function

2022-06-13 06:02:00 Quiet electric rod

Swift As a high-level language , Function definition introduces Arrow Syntax . Function parameters are optimized , Introduce optional parameters , Variable parameters ; Addressing parameters , restructure , Inlining is optimized .

Hello World

func jjMinus(param1: Int, param2: Int) -> Int {
    
	print("Hello world")
	return param1 - param2
}
  1. The parameter modifier of the function assumes by default that let
  2. If the code of the a function is only one line ,return The modifier can be omitted
原网站

版权声明
本文为[Quiet electric rod]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202270558386129.html