개발/iOS
파라미터 Bool일때 Argument label 어떻게 해야 예쁜가
빙수킹
2020. 11. 29. 04:43
함수에서 파라미터 Bool일 때 ..
처음에 아래처럼 쓰고 맘에 안들어서 이것저것 찾아봤음.
// cell 안의 내용 차례로 fade in / out
func animateContents(isOpen: Bool = true) {
스택오버플로우를 참고해서 이렇게 바꿈
작업 내용을 함수에 써주고 argument label은 와일드카드 패턴으로 대체하는게 깔끔한 것 같다.
// cell 안의 내용 차례로 fade in / out
func animateOpening(_ isOpen: Bool = true) {
https://stackoverflow.com/questions/44906267/swift-argument-labels-naming-convention
Swift: Argument labels naming convention?
Suppose I want to hide/show an UI element using one function. What is the correct way to name it? func changeRefreshControlVisibilityTo(_ isVisible: Bool) {} or func changeRefreshControlVisibili...
stackoverflow.com