iOS/UIKit
![](http://i1.daumcdn.net/thumb/C400x400/?fname=https://blog.kakaocdn.net/dn/bEZnoe/btsL1rrEEx9/eB9lHZ1AqwvdwauSEDEoz0/img.png)
![](https://tistory1.daumcdn.net/tistory/5365537/skin/images/no-image.jpg)
UIResponder이벤트에 응답하고 처리하기 위한 추상적인 인터페이스 Class UIResponder는 UIKit의 핵심 클래스로, 사용자 이벤트(터치, 모션, 리모트 컨트롤 등) 처리하는 객체들의 Base ClassUIView, UIViewController, UIApplication 등 대부분의 UI 컴포넌트가 UIResponder를 상속 받음Responder Chain을 통해 이벤트가 전파되는 구조를 관리 이벤트 처리UIResponder에서는 4가지 유형의 이벤트를 처리할 수 있습니다.Touchoverride func touchesBegan(_ touches: Set, with event: UIEvent?) { // 터치 시작 시 동작}Motionoverride func motionEnde..
![](http://i1.daumcdn.net/thumb/C400x400/?fname=https://blog.kakaocdn.net/dn/WyJGn/btsKMIM9far/aDwNapIkg4YKBYAG0g8FkK/img.png)
![](https://tistory1.daumcdn.net/tistory/5365537/skin/images/no-image.jpg)
modalPresentationStylemodal View Controller의 표현 스타일PresentationStyle은 System이 modal ViewController를 어떻게 표현하는지 정의시스템은 이 값을 일반적인 width 사이즈 클래스에서 사용(compact width 클래스에서는 일부 스타일은 다른 스타일의 동작을 수행)adaptivePresentationStyle(for:traitCollection:) 메서드를 구현하여 동작에 영향을 미칠 수 있음PresentationStyle은 modal ViewController의 콘텐츠 크기에도 영향을 미침 예를 들어 UIModalPresentationStyle.pageSheet은 시스템이 제공하는 명시적 크기를 사용하고, 이와 대조적으로 UIM..
![](http://i1.daumcdn.net/thumb/C400x400/?fname=https://blog.kakaocdn.net/dn/cytOtm/btsGZUqtg1q/mNujrXuqkk4wmSuKSYsEQ1/img.png)
![](https://tistory1.daumcdn.net/tistory/5365537/skin/images/no-image.jpg)
1. TextField 선언하기private lazy var textView: UITextView = { let textView = UITextView() textView.delegate = self textView.textColor = .secondaryLabel textView.font = .systemFont(ofSize: 16.0, weight: .medium) textView.text = "" // PlaceHolder Text 입력 return textView}() 2. UITextViewDelegate - textViewDidBeginEditing 사용extension ViewController: UITextViewDelegate{ func textVie..
![](http://i1.daumcdn.net/thumb/C400x400/?fname=https://blog.kakaocdn.net/dn/chBfTj/btsFE3bKyyx/jKnCpeb3xpKq9jidlm8E9K/img.png)
![](https://tistory1.daumcdn.net/tistory/5365537/skin/images/no-image.jpg)
UICollectionViewCompositionalLayout(Class) 적응력이 뛰어나고 유연한 시각적 배열로 item을 결합할 수 있는 Layout 개체 CompositionalLayout은 레이아웃을 별개의 시각적 Group으로 나누는 하나 이상의 Section으로 구성 각 Section을 표시하려는 데이터의 가장 작은 단위인 Item들의 Group으로 구성 Group은 Item을 가로 행, 세로 열 또는 사용자 정의 배열로 배치할 수 있음 Layout 구성 코드 func createBasicListLayout() -> UICollectionViewLayout { let itemSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1.0..
![](http://i1.daumcdn.net/thumb/C400x400/?fname=https://blog.kakaocdn.net/dn/2N0jX/btsFFMgvPex/VW92tlg6k6rpFPctk9Qnhk/img.png)
![](https://tistory1.daumcdn.net/tistory/5365537/skin/images/no-image.jpg)
SnapKit으로 UIScrollView 구성 import UIKit import SnapKit class ViewController: UIViewController { private lazy var scrollView: UIScrollView = { let scrollView = UIScrollView() return scrollView }() private let stackView: UIStackView = { let stackView = UIStackView() stackView.axis = .vertical stackView.spacing = 9 return stackView }() override func viewDidLoad() { super.viewDidLoad() view.backgroun..
![](http://i1.daumcdn.net/thumb/C400x400/?fname=https://blog.kakaocdn.net/dn/ciXsWK/btsC6yrB4vT/YgGcqBcrONSXwtn6a3FVXK/img.png)
![](https://tistory1.daumcdn.net/tistory/5365537/skin/images/no-image.jpg)
class CustomView: UIView{ @IBInspectable var borderWidth: CGFloat { get{ return layer.borderWidth } set{ layer.borderWidth = newValue } } @IBInspectable var borderColor: UIColor?{ get{ return UIColor(cgColor: layer.borderColor!) } set{ layer.borderColor = newValue?.cgColor } } } Storyboard로 이동해서 UIView 생성 합니다. 출처 iOS ) 왕초보를 위한 IBInspectable / IBDesignable 사용해보기 안녕하세요 :) Zedd입니다.쓰려고 한 글들은 많지만...저..