CocoaPods로 InboxUI 설정하기
1. 프로젝트 디렉터리의 터미널에서 ‘pod init’ 명령을 실행합니다.
2. 새로 생성된 Podfile을 엽니다.
3. 프로젝트 이름 대상 아래에 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'
end4. 프로젝트 디렉터리의 터미널에서 다음 명령을 실행합니다:
pod install5. 새로 생성된 <your_project_name>.xcworkspace 파일을 엽니다.
6. 잘했습니다! 이제 프로젝트에 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 샘플을 참조하세요.