CocoaPods로 InboxUI 설정
-
프로젝트 디렉토리에서 터미널에 ‘pod init’ 명령어를 실행합니다.
-
새로 생성된 Podfile 을 엽니다.
-
프로젝트 이름 타겟 아래에 Pushwoosh 종속성을 추가합니다:
# Uncomment the next line to define a global platform for your project# platform: ios, ‘9.0’
target ‘MyApp’ do # Comment the next line if you don’t want to use dynamic frameworks use_frameworks!
# Pods for MyApp pod 'PushwooshInboxUI'
end- 프로젝트 디렉토리에서 터미널에 다음 명령어를 실행합니다:
pod install-
새로 생성된 <your_project_name>.xcworkspace 파일을 엽니다.
-
잘하셨습니다! Pushwoosh InboxUI 가 프로젝트에 통합되었습니다.
Pushwoosh InboxUI 코드 추가
Anchor link to앱에 Inbox UI 를 표시하려면 Inbox 뷰 컨트롤러를 추가합니다:
self.navigationController?.pushViewController(PWIInboxUI.createInboxController(with: PWIInboxStyle.default()), animated: true)[self.navigationController pushViewController:[PWIInboxUI createInboxControllerWithStyle:[PWIInboxStyle defaultStyle]] animated:YES];Inbox 가 앱의 모양과 일치하도록 하려면 PWIInboxStyle 의 매개변수를 변경합니다. 글꼴, 배경색 등과 같은 매개변수를 사용자 지정할 수 있습니다.
//creating a new Inbox stylelet inboxStyle = PWIInboxStyle.customStyle(withDefaultImageIcon: UIImage.init(named: "custom_image"),textColor: UIColor.darkText,accentColor: UIColor.blue,font: UIFont.systemFont(ofSize: 17))
inboxStyle?.backgroundColor = UIColor.init(white: 1, alpha: 1)inboxStyle?.listErrorMessage = NSLocalizedString("Custom error message", comment: "Custom error message")inboxStyle?.listEmptyMessage = NSLocalizedString("Custom empty message", comment: "Custom empty message")
PWIInboxStyle.setupDefaultStyle(inboxStyle)//creating a new Inbox stylePWIInboxStyle *inboxStyle = [PWIInboxStyle customStyleWithDefaultImageIcon:[UIImage imageNamed:@"custom_image"]textColor:UIColor.darkTextColoraccentColor:UIColor.blueColorfont:[UIFont systemFontOfSize:17]];
inboxStyle.backgroundColor = [UIColor colorWithWhite:1 alpha:1];inboxStyle.listErrorMessage = NSLocalizedString(@"Custom error message", @"Custom error message");inboxStyle.listEmptyMessage = NSLocalizedString(@"Custom empty message", @"Custom empty message");
[PWIInboxStyle setupDefaultStyle:inboxStyle];사용자 지정
Anchor link toInbox UI 스타일을 사용자 지정하려면 다음을 참조하십시오:
자세한 내용은 Inbox 샘플을 참조하십시오.