분류 전체보기 333

RxSwift Operator) CombineLatest

CombineLatest 오퍼레이터 어디에다가 쓸 수 있을까? ID, PASSWORD 를 사용자로부터 입력받아서 CombineLatest operator 도움을 받아 하나의 Observable sequence 로 합친다. CombineLatest 2 개의 Observable에서 방출된 시퀀스에서 최신 이벤트를 결합 let observable1 = userNameTextField.rx.text.orEmpty let observable2 = passwordTextField.rx.text.orEmpty let observableCombined = Observable.combineLatest(observable1, observable2) loginBtn.rx.tap .withLatestFrom(observabl..

iOS/RxSwift 2023.02.15

iOS Swift 이메일 & 비밀번호 유효성 검사

이메일 & 비밀번호 유효성 검사 func login(user: String, pass: String) { let emailRegEx = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,64}" let emailTest = NSPredicate(format:"SELF MATCHES %@", emailRegEx) let emailValid: Bool = emailTest.evaluate(with: user) let passValid: Bool = (pass != "" && pass.count >= 6) if (emailValid && passValid) { let foodListVC = self.storyboard?.instantiateViewController(ident..

RxSwift 제일 간단한 테이블뷰 만들기

RxSwift 제일 간단한 테이블뷰 만들기 without tableview 기본 메서드 (cellForRowAt, numberOfRowsInSection이 필요없음) import UIKit import RxSwift import RxCocoa class MainViewController: UIViewController, UITableViewDelegate { @IBOutlet weak var tableView: UITableView! //원래 tableViewItems = ["Item 1", "Item 2", "Item 3", "Item 4"]인데 이걸 Observable 시퀀스로 아래와 같이 변환 let tableViewItems = Observable.just(["Item 1", "Item 2", "..

iOS/RxSwift 2023.02.14

swift Apple로 로그인

swift Apple로 로그인 주의점: 애플 개발자 계정 결제한 경우에만 해당 Apple로 로그인 기능 추가할 수 있음. 1. Google Firebase 사이트에 접속 2. 콘솔에서 해당 프로젝트 생성 후 Authentication sign-in method에 아래와 같이 Apple 추가 3. Xcode 프로젝트에서 아래와 같이 Sign in with Apple 추가 등록하고 Signing Certificate가 잘 보이면 완료가 된 것임. 4. Apple Developer 사이트에서 로그인 5. Certificates, Identifiers & Profiles 에서 ServiceIds 이용 6. 아래는 예시.... 이런 식으로 추가 7. sign in with Apple enabled 체크표시 클릭 ..

TableView 안에 TextView 넣기

TableView 안에 TextView 넣기 스토리보드로 짜고 있는데, Tableview안에 textview를 넣고 contraints를 다 잡아도 제대로 나오지 않는 현상 발생 해결: UITextView 세부사항 조정하는 곳에서 Scrolling Enabled 속성 체크표시 해제해야 함!! Before After Scrolling Enabled 속성 체크표시 해제 참고: (아래 방법이 텍스트뷰가 늘어나는데 animation과 함께 늘어나서 자연스러워 보여서 좋았음) (다른 사이트에서의 방법(https://www.swiftdevcenter.com/the-dynamic-height-of-uitextview-inside-uitableviewcell-swift/)은 뚝뚝 끊어지는 느낌으로 textview 부분..

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..

DynamicTableView 다른 크기의 셀 높이 지정

DynamicTableView 다른 크기의 셀 높이 지정 아래와 같이 description Label 의 길이가 제각각이어서 서로 다른 크기의 셀 높이를 갖는 테이블 뷰! TIL Dynamic Tableview 만들 때 테이블뷰 아래까지 꽉 차게 0 0 0 0 constraints를 잡는데 다만, 주의할 점은 다음과 같다. 아래 constraints 세부사항을으로 들어가서 safe area bottom 이 아닌 superview.bottom 에 constraint를 건다. Stackview 관련 1) Stackview일단 만든다 -> 너비 높이가 지정이 안되어있을 건데, Label 또는 button 하나만 넣어도 일단 파란불 들어옴. 2) 그 다음에 요소를 여러개 넣고 싶으니까 당연히 Stackview..

iOS swift 구글로 로그인

https://developers.google.com/identity/sign-in/ios/start-integrating?hl=ko iOS 및 macOS용 Google 로그인 시작하기 | Authentication | Google Developers 이 페이지는 Cloud Translation API를 통해 번역되었습니다. Switch to English 의견 보내기 iOS 및 macOS용 Google 로그인 시작하기 컬렉션을 사용해 정리하기 내 환경설정을 기준으로 콘텐츠를 저장하고 분류 developers.google.com 1. Cocoapods 설치 pod init 참고) Xcode에서 코코아팟 설치시 최근 에러가 남 해결방법: 아래 Xcode 14.0-compatible -> Xcode 13.0..

여러 repositories 하나로 합치기

연습하면서 여러 개의 repositories 생성했던거 하나의 repository 로 합치기 0. Github 원격 저장소에 새로운 repository 빈걸로 생성 1. git clone { 위에서 새로 생성한 repository 주소 } //원격 저장소를 local로 클론하는 작업 2. cd { 방금 생성한 repository가 local에 저장된 위치 경로 } 3. git subtree add --prefix={폴더 이름} {repository 주소} {branch 이름} -> 이 과정에서 오류가 날 경우 (ambiguous argument 'HEAD': unknown revision or path not in the working tree.' ) -> 해결 방법: git commit --allow-..

Git 2023.02.03