This application is modifying the autolayout engine from a background thread after the engine was accessed from the main thread. 오류 조치 방법

swift 3 에서 작성하는 도중에 이런 오류가 발생했다.

This application is modifying the autolayout engine from a background thread after the engine was accessed from the main thread. 

대충 내용은 백그라운드에서 메인 스레드를 접속해서 뭔가 안 맞는다는 이야기 같다. 

검색 결과 디스패치를 구현할 때 백그라운드에서는 데이터 처리만 그리고 메인은 UI 처리만 하면 된다고 한다.

DispatchQueue.global(qos: .background).async {
            // 오직 데이터 처리만

            DispatchQueue.main.async {
                // 오직 UI 
            }
        }
위와 같이 처리하니 오류가 안난다.

댓글

이 블로그의 인기 게시물

한글 2010 에서 Ctrl + F10 누르면 특수문자 안뜰 때

아이폰에서 RFID 사용하는 방법

VCC 와 GND 는 무엇일까?