iOS swift 4

iOS Swift) didSet 사용 예시 (with tableview/ collectionview)

iOS Swift) didSet 사용 예시 (with tableview/ collectionview) func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let cellId = String(describing: MyCollectionViewCell.self) let cell = collectionView.dequeueReusableCell(withReuseIdentifier: cellId, for: indexPath) as! MyCollectionViewCell cell.profileImg.image = UIImage(systemName: syst..

iOS swift 토스트메시지 띄우기

iOS swift 토스트메시지 띄우기 https://royhelen.tistory.com/46 [iOS/Swift] Toast Message 만들기 이번 포스팅은 Toast Message를 만드는 방법을 포스팅하겠습니다~ 일단 Toast 메시지가 뭔지부터 보여드리겠습니다~ 바로 이것입니다. 기본적으로 Toast Message를 띄우는건 안드로이드에서는 자체 라이 royhelen.tistory.com import Toast 한다음에 위에 그대로 적용하면 됨 :)

iOS swift 오토레이아웃 연습(4개의 뷰 1:1로 만들기)

디데이 계산기 앱 만들 때 앱 화면의 아래 부분에 4개의 뷰를 위 모양처럼 만들고 싶을 때 4개의 View를 1:1의 비율로 만드는 오토레이아웃 잡기 *Equal Heights로 안하고 Equal Widths로 한 이유? 위 경우에 앱 화면상 위쪽 공간이 많이 남게 만들거라서 Width로 맞춰주는게 더 편리 *Aspect Ratio를 체크표시하는 이유: 1:1 로 맞춰주려고

iOS swift - 단축키 및 Xcode 꿀팁

ctrl + cmd + space 이모티콘 단축키 shift + tab 코드 들여쓰기 cmd + shift + f 프로젝트 전체에서 무언가를 찾을 때 cmd + f 해당 파일에서 무언가를 찾을 때 shift + ctrl 여러 곳에 동시에 커서를 찍고 싶을 때 (여러 함수에 동시에 print 찍고 싶은 경우) cmd + ctrl + e 변수 앞에서 해보면 동시에 이 변수를 수정 가능. (refactor느낌) 클래스에서 이니셜라이저 생성 Editor -> Refactor -> Generate Memberwise Intializer class User { internal init(title: String, releaseDate: String, runtime: Int, overview: String, rate:..