cozzin
코찐 기술 블로그
cozzin
전체 방문자
오늘
어제
  • 분류 전체보기
    • Kotlin
    • 백엔드
    • iOS
      • Swift
      • SwiftUI
      • Combine
      • Architecture
    • 개발환경
    • 세미나
    • 생각정리
    • 스터디
    • CS
      • Refactoring
      • OS

블로그 메뉴

  • 홈
  • 태그
  • 방명록
  • LinkedIn
  • 강의

공지사항

인기 글

태그

  • 리팩토링
  • 워닝제거
  • ios
  • Combine
  • os
  • SwiftUI
  • 테스트
  • CS
  • 컴퓨터공학
  • 디자인패턴
  • Swift
  • WWDC21
  • WWDC
  • darkmode
  • 운영체제
  • Ribs
  • Warning
  • XCode
  • multicast
  • slide-over

최근 댓글

최근 글

티스토리

hELLO · Designed By 정상우.
cozzin

코찐 기술 블로그

워닝 제거하기: Implicit import of bridging header '{YourApp}-Bridging-Header.h' via module '{YourApp}' is deprecated and will be removed in a later version of Swift
iOS

워닝 제거하기: Implicit import of bridging header '{YourApp}-Bridging-Header.h' via module '{YourApp}' is deprecated and will be removed in a later version of Swift

2021. 1. 29. 11:41
반응형

안녕하세요 코찐입니다.

오늘은 다음과 같은 에러를 만나서 해결하는 과정을 기록해봅니다.

 

Implicit import of bridging header '{AppName}-Bridging-Header.h' via module '{AppName}' is deprecated and will be removed in a later version of Swift

원래는 Briding-Header 를 암시적으로 import 해주고 있었는데, 이제는 자동적으로 브릿징 헤더를 import 해주지 않겠다는 워닝입니다.

워닝이 뜨는 테스트 파일이 있고, 안뜨는 테스트 파일도 있습니다.

 

1. 언제 워닝이 발생할까?

그럼 이번 테스트 파일에서는 왜 워닝으로 저 내용을 알려줄까요?

알고보면 현재 테스트 내용에서 objcective-c 내용을 사용하고 있는게 아닐까요?

테스트 내용을 주석처리 하고 워닝이 동일하게 뜨는지 확인해보겠습니다.

ㅋㅋ 놀랍게도 동일하게 워닝이 뜹니다.

테스트 케이스에서 랜덤하게 워닝이 뜨고 있다...고 생각하고 넘어가겠습니다.

 

2. 워닝 해결 방안

stackoverflow.com/a/45326611

 

Warning 'myframe-Bridging-Header.h' in Xcode 8.3

I updated Xcode to Version 8.3 (8E162) and in my unit test file I have this warning: Implicit import of bridging header 'myframe-Bridging-Header.h' via module 'myframe' is deprecated and will be

stackoverflow.com

워닝을 해결하기 위한 두가지 해결 방안이 있다고 합니다.

 

1. 개별 유닛 테스트에 앱 브릿징 헤더 import 하기

2. 유닛 테스트 브릿징 헤더에 앱 브릿징 헤더 import 하기 

 

제가 개발하는 환경에는 유닛 테스트 브릿징 헤더가 이미 만들어져 있습니다.

여기에 앱 브릿징 헤더를 추가하겠습니다.

//
//  YourAppTests-Bridging-Header.h
//  YourApp
//

#ifndef YourAppTests_Bridging_Header_h
#define YourAppTests_Bridging_Header_h

#import "YourApp-Bridging-Header.h"

#endif /* YourAppTests_Bridging_Header_h */

이렇게 추가해주면 더 이상 워닝이 뜨지 않습니다!

좀 더 나은 해결책이 있다면 알려주시면 감사하겠습니다.

반응형
저작자표시 (새창열림)

'iOS' 카테고리의 다른 글

워닝 제거하기: ld: warning: method '{methodName}' in category from {file build path}.o conflicts with same method from another category  (0) 2021.01.29
워닝 제거하기: Skipping duplicate build file in Compile Sources build phase  (0) 2021.01.29
[iOS] grouped style tableView에서 위아래 여백 제거하기  (0) 2021.01.28
[iOS] 이슈 해결: CloudKit integration does not support unique constraints  (0) 2021.01.23
[iOS] UITextField placeholder color 변경하기  (0) 2021.01.20
    'iOS' 카테고리의 다른 글
    • 워닝 제거하기: ld: warning: method '{methodName}' in category from {file build path}.o conflicts with same method from another category
    • 워닝 제거하기: Skipping duplicate build file in Compile Sources build phase
    • [iOS] grouped style tableView에서 위아래 여백 제거하기
    • [iOS] 이슈 해결: CloudKit integration does not support unique constraints
    cozzin
    cozzin
    Software Engineer

    티스토리툴바