분류 전체보기

Swift

LocalNotification

원하는 시간에 맞춰 알림을 등록하고 싶을 때 사용할만한 방법. 서버가 필요하지 않은 알림은 LocalNotification으로 처리할 수 있다.Create the notification's contentlet content = UNMutableNotificationContent()content.title = "Weekly Staff Meeting"content.body = "Every Tuesday at 2pm"UNMutableNotificationContent를 생성해 title과 body에 원하는 문구를 저장한다.필요한 경우 sound나 badge도 설정할 수 있다.Specify the conditions for delivery// Configure the recurring date.var dateC..

SwiftUI/Planting-Mind Dev Log

devlog 07. 나중에 보려고 만든 UITest 관련 모음.zip

UITest는 알파벳 순서대로 진행된다. 클래스 파일 - 파일 내부 메서드 순서까지 그래서 클래스는 UnitTest_A 이런식으로 만들고 내부 메서드는 test_01_테스트이름으로 관리했다. 앱실행 let app = XCUIApplication() app.launch() XCTestCase extension 원하는 element가 있는지 체크 후 tap할 수 있도록 XCTestCase에 extension 추가 func tap(element: XCUIElement?, timeout: Double = 1.0) { XCTAssertTrue(element?.waitForExistence(timeout: timeout) == true) element?.tap() } func checkAlert(app: XCUIA..

SwiftUI/Planting-Mind Dev Log

devlog 06. SwiftUI - FileImporter, FileExporter

기록을 jSON 파일로 내보내기 위해 사용한 fileImporter와 fileExporter. 추가로 json확장자를 내가 원하는 확장자로 지정하는 것까지의 기록. fileImporter와 fileExporter SwiftUI에서는 iOS14.0 이상부터 fileImporter, fileExporter 지원 fileImporter: 파일 가져오기 func fileImporter( isPresented: Binding, allowedContentTypes: [UTType], onCompletion: @escaping (Result) -> Void ) -> some View isPresented에 들어갈 Binding 값이 true가 되면 fileImporter가 나타난다. allowedContentType..

SwiftUI/Planting-Mind Dev Log

devlog 05. Scheme '__' is not currently configured for the test action.

잘만 돌아가던 테스트 코드가 위젯 익스텐션을 추가한 이후로 안돌아가고 제목과 같은 얼럿창만 띄웠다...... 해결 방법 지금은 해결하고 난 이후라 Test Plans에 2 test targets, 1 configuration이라고 적혀있지만 원래는 0 test targets였다. -> 버튼을 눌러 이동한 뒤에 좌측 하단의 +를 눌러 테스트를 추가해주었다. 설정 이후에 github action에서 테스트 커버리지가 안나와서 봤더니 Code Coverage 옵션이 꺼져있었다... On으로 바꿔주었다.

eunjuicy
'분류 전체보기' 카테고리의 글 목록