
1. 스토리 보드에 스크롤뷰 추가 (cmd + shift + L) - 자동으로 content Layout Guide와 Frame Layout Guide가 생성됨 2. 스크롤뷰의 크기 조정 (view의 크기와 동일하게 설정) 3. contentView를 추가 (cmd + shift + L을 통해 UIView를 추가) (1) 추가한 view를 선택하고, control을 누른 상태로 content Layout Guide로 드래그 한 뒤 아래 4항목에 체크 - Leading Space to Content Layout Guide - Top Space to Content Layout Guide - Trailing Space to Content Layout Guide - Bottom Space to Content L..

유용한 사이트 정리 0. 프로그래머스 코딩 테스트 준비하기 위한 사이트 https://programmers.co.kr/ 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 1. Leet Code 코테 준비 사이트 https://leetcode.com/ LeetCode - The World's Leading Online Programming Learning Platform Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get..

Publisher Protocol public protocol Publisher { associatedtype Output associatedtype Failure : Error } ✔️ 말 그대로 Publish(발행)하는 프로토콜. Subscriber의 instance에게 elements를 전달. ✔️ Publisher의 associated types인 Output, Failure는 -> Subscriber의 associated types인 Input, Failure과 매치됨 ✔️ Publisher는 subscriber를 받아들이기 위해 receive(subscriber:)를 함(Publisher와 Subscriber가 연결되는 행위). ✔️ 그래야 Publisher가 발행 하는 값을 Subscribe..

MapKit 1 ※ 프로젝트 이름을 framework와 동일하게 지으면 안됨 ※ 예를들어 MapKit이라고 이름 지으면 안됨 기본 코드 설정 더보기 import MapKit class ViewController: UIViewController { private let mapView = MKMapView() private let mapButton = UIButton(type: .system) override func viewDidLoad() { super.viewDidLoad() setUI() } @objc func buttonTapped(_ sender: UIButton) { print(#function) } } extension ViewController { private func setUI() { m..

async/await async / await 사용이유 - 콜백 지옥 - 에러 처리에서 실수 가능성 있음 기본코드 ⬇️ 더보기 model import Foundation // Codable = Encodable + Decodable struct Quote: Decodable { let content: String } error import Foundation enum NetworkError: Error { case badResponse case communicationError case decodeFailed case noData } controller import UIKit class ViewController: UIViewController { let networkService = NetworkSer..

Collapsed TableView 기본 코드 ⬇️ 더보기 import UIKit class ViewController: UIViewController { let tableViewData = [ ["1", "2", "3", "4", "5"], ["1", "2", "3", "4", "5"], ["1", "2", "3", "4", "5"], ["1", "2", "3", "4", "5"], ["1", "2", "3", "4", "5"], ] // MARK: -Properties let tableView: UITableView = { let tableView = UITableView() return tableView }() // MARK: -Life Cycles override func viewDidLoad()..

Result 어떤 결과값이 성공 or 실패로 나뉜다면 Result로 쓰면 좋음. 기본코드⬇️ 더보기 class ViewController: UIViewController { let centerLabel = UILabel() override func viewDidLoad() { super.viewDidLoad() setUI() } } // MARK: -URLSession extension ViewController { func setUI() { setConstraints() setAttributes() } func setConstraints() { view.addSubview(centerLabel) centerLabel.translatesAutoresizingMaskIntoConstraints = fals..
URLSession - ViewController import UIKit class ViewController: UIViewController { let temperatureLabel = UILabel() override func viewDidLoad() { super.viewDidLoad() configureUI() NetworkService.shared.fetch(urlString: URL.weather) { weatherInfo in self.temperatureLabel.text = String(weatherInfo.main.temp) } } } //MARK: -UI extension ViewController { final private func configureUI() { setAttribut..
- Total
- Today
- Yesterday