inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

iOS AutoLayout 완벽 가이드 - 실무 프로젝트를 위한 실전강의

Chat_3_Keyboard_Notification

알림후 클릭시 이동 문제

264

문태부

작성한 질문수 9

0

AppDelegate.swift

 

 

    func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response : UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {

        print("userNotificationCenter 2")

        if response.notification.request.identifier == "testIdentifier" {

            print("handling notification with the identifier 'testIdentifer'")

        }

        

        if let notification = response.notification.request.content.userInfo as? [String:AnyObject]{

            print (notification as Any)

            

            let message = parseRemoteNotification(notification: notification)

            print(message!)

            

            let seq = parseOrderSeq(notification: notification)

            print(seq!)

          

            var loginVC : UIViewController?

            loginVC = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "LoginViewController") as! LoginViewController

            

            let appDelegate = UIApplication.shared.delegate as! AppDelegate

            appDelegate.window?.rootViewController = loginVC

        }

        completionHandler()

    }


 

console log

2019-05-23 15:14:41.282374+0900 bossapp[38816:10485392] Warning: Attempt to present <UIAlertController: 0x105007200> on <bossapp.LoginViewController: 0x103526eb0> whose view is not in the window hierarchy!

하면서 구현이 안되고 그냥 바로 원래 되던 메인으로 가네요. 어떻게 구현 하면 좋을까요?!

iOS-Autolayout 모바일-디자인

답변 1

0

iOS Developer - 이정

안녕하세요

AppDelegate.swift

에서 직접 화면전환은 안될겁니다.

처음으로 진입하는 VC에서 화면전환할 수 있도록 코드를 구성하면 해결될걸로 보입니다.

안녕하세요. Autoshrink의 Minimum Font Size 관련 질문이 있습니다.

0

581

3

계산기 - 버튼들의 가로 간격과 세로 간격을 동일하게 하는 방법 질문드립니다.

0

601

2

cell 안에label을 넣었는데

0

323

1

Graph_2_Code_extension 에서 스레드 오류

0

308

1

키보드 Appear에 맞춰서 tableView의 마지막셀도 자연스레 올라가는 방법에 대하여

0

203

0

image view와 view사이의 빈틈이 생기는 이유에 대해서

0

272

0

iOS AUtoLayout 강의자료 문의입니다.

0

305

1

5분50초쯤에

0

253

1

text가 이미지 밖으로 삐져나와요

0

269

1

버튼 사이즈가 줄어들지 않아요.

0

413

2

equal spacing이 안먹는거 같은데..

0

294

1

오토레이아웃 code vs storyboard

0

297

1

실습에 사용되는 이미지는 제공이 안되나요?

0

231

1

플로팅 버튼 실습 중 질문

0

375

1

버튼 insets

0

216

1

질문있습니다

3

238

1

질문있습니다!

1

270

1

xcode 13 에서 vari for Traits 질문

1

240

1

Popup View Controller를 다른 story boardf로 만든 이유가 있을까요?

0

212

1

Calc_StackView_1에서 equal Widths 질문이요

3

320

1

개발자 아이디 관련 문의

0

310

2

이미지 소스를 찾을 수 없습니다

0

233

1

스크롤뷰 컬렉션뷰 질문드립니다.

0

530

3

tableView function에 대해서

0

161

1