분류 전체보기196 [iOS/Swift] 비동기(async) 테스트 참고 사이트 및 출처 원문 Kodeco의 iOS Unit Testing and UI Testing Tutorial을 번역한 yoonbumatae의 글을 정리한 포스팅입니다. 더 자세한 내용을 참고하시려면 아래 두 링크를 참고하세요! https://www.kodeco.com/21020457-ios-unit-testing-and-ui-testing-tutorial iOS Unit Testing and UI Testing Tutorial Learn how to add unit tests and UI tests to your iOS apps, and how you can check on your code coverage. www.kodeco.com http://yoonbumtae.com/?p=4020 Swift.. 2023. 4. 14. [iOS/Swift] 동기(sync) 테스트 참고 사이트 및 출처 원문 Kodeco의 iOS Unit Testing and UI Testing Tutorial을 번역한 yoonbumatae의 글을 정리한 포스팅입니다. 더 자세한 내용을 참고하시려면 아래 두 링크를 참고하세요! https://www.kodeco.com/21020457-ios-unit-testing-and-ui-testing-tutorial iOS Unit Testing and UI Testing Tutorial Learn how to add unit tests and UI tests to your iOS apps, and how you can check on your code coverage. www.kodeco.com http://yoonbumtae.com/?p=4020 Swift.. 2023. 4. 13. [iOS/Swift] @testable Swift의 기본 Access-Level은 internal internal은 외부에서 접근 불가 테스트 케이스를 작성하는 동안에는 테스트 케이스에서 해당 클래스와 메서드에 대해 엑세스 해주어야 함 -> Target에서 internal로 정의 된 레벨 접근 불가능하게 됨 대부분 개발 시 따로 Access Level을 정의해 주지 않음 만약 testabl로 정의하지 않으면 모든 단위에서 public으로 선언해 주어야 접근 가능 Solution 1. Enable Testability build setting을 Yes로 설정. Xcode 는 컴파일 중에 -enable-testing 플래그를 포함 complied 모듈에서 선언된 swift entities가 높은 레벨의 access 수준으로 설정됨 2. @test.. 2023. 4. 13. [iOS/Swift] XCTestCase 생성하기 참고 사이트 및 출처 원문 Kodeco의 iOS Unit Testing and UI Testing Tutorial을 번역한 yoonbumatae의 글을 정리한 포스팅입니다. 더 자세한 내용을 참고하시려면 아래 두 링크를 참고하세요! https://www.kodeco.com/21020457-ios-unit-testing-and-ui-testing-tutorial iOS Unit Testing and UI Testing Tutorial Learn how to add unit tests and UI tests to your iOS apps, and how you can check on your code coverage. www.kodeco.com http://yoonbumtae.com/?p=4020 Swift.. 2023. 4. 13. [iOS/Swift] Unit Test 란? 단위 테스트라고 하며 프로그램의 기본 단위인 모듈을 테스트 함 모듈이 정해진 기능을 수행하는지 테스트 함(모듈 단위로 코드가 작성되어야 함) FIRST 기준 Fast(빠름) 테스트는 빠르게 실행되어야 함 Independent/Isolated(고립됨) 테스트는 서로 상태를 공유해서는 안됨 Repeatable(반복적) 테스트를 실행할 때마다 동일한 결과를 얻어야 함. 외부 데이터를 공급자(external data Provider 네트워크 서비스 로직 같은 것), 동시성(concurrency) 문제로 인해 간헐적 오류 발생 할 수 있음 Self-validating(자가 검증) 테스트는 완전히 자동화되어야 함. 로그파일로 프로그래머가 해석하는 것이 아닌 테스트 케이스에 대해 “통과” 또는 “실패”여야함 Time.. 2023. 4. 10. [RxSwift] passing viewmodel data to viewController ViewModel var currentSelectedCategoryIdx = PublishSubject() 초기값이 필요없는 경우 PublishSubject로 ViewModel에 property 정의 struct Input { // 생략 } struct Output { let changedCategoryIdx: Observable } viewController에서 값을 받아 사용해야 하므로 Output에 반환할 Observable 타입을 정의해줌 func transform(input: Input) -> Output { let changedCategoryIdx = currentSelectedCategoryIdx.asObserver() return Output(changedCategoryIdx: change.. 2023. 3. 25. [iOS/Swift] UICollectionView Dynamic Height with AutoConstraint UICollectionViewDelegateFlowLayout에서 sizeForItemAt에 정의 extension QuoteViewController: UICollectionViewDelegateFlowLayout { func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { let margin = 16 + 16 let quote = viewModel?.updates[indexPath.row] return QuoteListCollectionViewCell.fittingSize(avai.. 2023. 3. 25. [iOS/Xcode] Pod file not found 이슈 pod deintegrate pod install 이슈 생긴 이유 추정 main branch, v1.0 branch 있을때 v1.0에서만 사용하려고 추가해 놓은 팟 라이브러리가 있었고 main으로 옮기면서 pod update -> ignore 추가 안하고 다시 v1.0 팟으로 이동 -> 라이브러리 못 찾음 해결 방법 main에서 deintegrate 시키고 다시 install, v1.0에서 deintergrate 시키고 다시 install 2023. 3. 23. [Swift] FSCalendar 커스텀 캘린더 정리 FSCalendar 커스텀 캘린더를 생성할 수 있도록 도와주는 라이브러리 GitHub - WenchaoD/FSCalendar: A fully customizable iOS calendar library, compatible with Objective-C and Swift A fully customizable iOS calendar library, compatible with Objective-C and Swift - GitHub - WenchaoD/FSCalendar: A fully customizable iOS calendar library, compatible with Objective-C and Swift github.com 알아보고 정리하는데 꽤 오래 걸렸는데 댓글 한번씩만 달아주시면 힘이 될거 .. 2023. 3. 16. [Swift] 고차 함수 CompactMap 기존의 어레이에서 값을 변형 시켜 새로운 어레이를 반환하는 것이 -> map 여기에 nil 값을 제거한 것이 compactMap 입니다 compactMap이 이제는 너무 몸에 익어버렸지만.. 정리차원에서 실재로 어떻게 쓰일 수 있을지 정리했습니다!! 1. nil 제거하기 let test = [1, 2, nil, 4, 5, nil] let removedNilTest = test.compactMap { $0 } [1, 2, 4, 5] CompactMap은 nil을 제외시키기 때문에 옵셔널을 사용해야 하는 환경에서 효과적으로 데이터를 핸들링 할 수 있어요! 만약 nil 값이 그대로 필요하다면 map을 쓰면 됩니다~ let sameWithAbove = test.compactMap { value in return.. 2023. 3. 9. [iOS/Swift] Dynamic Link 정리 로그인 - Google 계정 이메일 또는 휴대전화 accounts.google.com Firebase > 콘솔로 이동 > 프로젝트 선택 > 모든 제품 > Dynamic Links 시작하기 버튼 선택 사용하고자 하는 도메인 프리픽스를 입력하면 Google에서 제공하는 도메인 목록이 뜸 구글에서 제공하는 도메인을 선택하고 계속 버튼을 누름 (구글에서 제공하는 도메인은 xxx.page.link) 이미 등록된 이름은 사용 불가능 사용가능한 도메인인 경우 완료 단계로 넘어감 새 동적 링크 버튼 클릭 단축 URL을 사용하는 경우 사용할 링크를 지정함 임의로 지정되는 URL을 사용하면 됨 url 프리픽스 + ibi에 번들 아이디를 적어줌 푸시 설정 했다면 team ID가 등록되어 있음 App store id를 입력하.. 2023. 3. 8. [iOS/Swift] Firebase Remote Notification 정리 Apple Develper Site Setting 1. APNs key 준비 Apple Developer 사이트 > 왼쪽 메뉴 > Keys 선택 Keys + 버튼을 눌러 새로운 키 등록 Apple Push Notification service 버튼을 누르고, key name을 지정 Continue 버튼이 활성화 되면 눌러 줌 정보를 확인한 뒤 Register을 눌러 키를 등록함 2. Key ID 확인 인증 키의 Key ID 확인 추후 Firebase 설정 시 필요함 3. Team ID 확인 apple developer 인증서, 식별자 및 프로파일 관리 페이지에서 오른쪽 상단에 팀 아이디가 나와 있지만 해당 사이트로도 확인 가능 로그인 - Apple idmsa.apple.com 로그인 후 스크롤 하게 되면.. 2023. 3. 8. 이전 1 2 3 4 5 6 7 ··· 17 다음