inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

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

Chat_3_Keyboard_Notification

알림후 클릭시 이동 문제

270

문태부

작성한 질문수 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

598

3

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

0

625

2

cell 안에label을 넣었는데

0

333

1

Graph_2_Code_extension 에서 스레드 오류

0

320

1

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

0

213

0

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

0

276

0

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

0

309

1

5분50초쯤에

0

258

1

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

0

273

1

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

0

420

2

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

0

298

1

오토레이아웃 code vs storyboard

0

303

1

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

0

234

1

플로팅 버튼 실습 중 질문

0

384

1

버튼 insets

0

226

1

질문있습니다

3

240

1

질문있습니다!

1

271

1

xcode 13 에서 vari for Traits 질문

1

245

1

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

0

218

1

Calc_StackView_1에서 equal Widths 질문이요

3

328

1

개발자 아이디 관련 문의

0

318

2

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

0

236

1

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

0

539

3

tableView function에 대해서

0

164

1