본문 바로가기
AutoLayout 오토레이아웃 필요성 - ui 구성시 다양한 사이즈와 화면 비율로 출시 되면서, 사이즈에 구애받지 않고 시각적으로 동일한 화면을 구현해야 함 - 오토레이아웃은 애플리케이션을 사용할 때 발생하는 외부 변경과 내부 변경에 동적으로 반응하는 사용자 인터페이스를 가능하게 합니다. - 외부 변경(External Changes) : 외부 변경은 슈퍼뷰의 크기나 모양이 변경될 때 발생합니다. - 내부 변경(Internal Changes) : 용자 인터페이스의 뷰의 크기 또는 설정이 변경되었을 때 발생 오토레이아웃 속성 Width : 정렬 사각형의 너비 Height : 정렬 사각형의 높이 Top : 정렬 사각형의 상단 Bottom : 정렬 사각형의 하단 Baseline : 텍스트의 하단 Horizontal : 수평 Ve.. 2021. 2. 16.
Cocoa Touch Cocoa & CocoaTouch Cocoa and Cocoa Touch are the application development environments for OS X and iOS, respectively. Both Cocoa and Cocoa Touch include the Objective-C runtime and two core frameworks: - Cocoa, which includes the Foundation and AppKit frameworks, is used for developing applications that run on OS X. - Cocoa Touch, which includes Foundation and UIKit frameworks, is used for devel.. 2021. 2. 16.
Swift - 고차함수, Higher-order function 고차함수 고차함수(Higher-order function) : ‘다른 함수를 전달인자로 받거나 함수실행의 결과를 함수로 반환하는 함수’를 뜻한다. 스위프트의 함수(클로저)는 일급시민이기 때문에 함수의 전달인자로 전달할 수 있고 함수의 결과값으로 반환할 수 있으므로, 고차함수이다 스위프트 표준라이브러리에서 제공하는 유용한 고차함수 1. map map함수는 컨테이너 내부의 기존 데이터를 변형(transform)하여 새로운 컨테이너를 생성 let numbers: [Int] = [0, 1, 2, 3, 4] var doubledNumbers = numbers.map({ (number: Int) -> Int in return number * 2 }) print(doubledNumbers) // [0, 2, 4, 6.. 2021. 2. 10.
Swift19 - 익스텐션 Extensions Extensions add new functionality to an existing class, structure, enumeration, or protocol type. Extensions in Swift can: Add computed instance properties and computed type properties Define instance methods and type methods Provide new initializers Define subscripts Define and use new nested types Make an existing type conform to a protocol 익스텐션이란? - 익스텐션은 구조체, 클래스, 열거형, 프로토콜 타입에 새로운.. 2021. 2. 10.
Swift18 - 프로토콜 Protocols A protocol defines a blueprint of methods, properties, and other requirements that suit a particular task or piece of functionality. The protocol can then be adopted by a class, structure, or enumeration to provide an actual implementation of those requirements. Any type that satisfies the requirements of a protocol is said to conform to that protocol. In addition to specifying require.. 2021. 2. 10.
Swift17 - assert/guard assert(_:_:file:line:) func assert(_ condition: @autoclosure () -> Bool, _ message: @autoclosure () -> String = String(), file: StaticString = #file, line: UInt = #line) Use this function for internal sanity checks that are active during testing but do not impact performance of shipping code. assert 함수 assert(_:_:file:line:) 함수를 사용합니다. assert 함수는 디버깅 모드에서만 동작합니다. 배포하는 애플리케이션에서는 제외됩니다. 예상했던 조건의 검.. 2021. 2. 10.