InboxUI mit CocoaPods einrichten
1. Führen Sie den Befehl ‘pod init’ im Terminal in Ihrem Projektverzeichnis aus.
2. Öffnen Sie die neu erstellte Podfile.
3. Fügen Sie die Pushwoosh-Abhängigkeit unter dem Ziel Ihres Projektnamens hinzu:
# 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. Führen Sie den folgenden Befehl im Terminal in Ihrem Projektverzeichnis aus:
pod install5. Öffnen Sie die neu erstellte <Ihr_Projektname>.xcworkspace-Datei.
6. Gut gemacht! Sie haben Pushwoosh InboxUI erfolgreich in Ihr Projekt integriert.
Pushwoosh InboxUI-Code hinzufügen
Anchor link toUm die Inbox UI in Ihrer App anzuzeigen, fügen Sie den Inbox-View-Controller hinzu:
self.navigationController?.pushViewController(PWIInboxUI.createInboxController(with: PWIInboxStyle.default()), animated: true)[self.navigationController pushViewController:[PWIInboxUI createInboxControllerWithStyle:[PWIInboxStyle defaultStyle]] animated:YES];Um den Posteingang an das Erscheinungsbild Ihrer App anzupassen, ändern Sie die Parameter von PWIInboxStyle. Sie können Parameter wie Schriftart, Hintergrundfarbe usw. anpassen.
//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 error message");
[PWIInboxStyle setupDefaultStyle:inboxStyle];Anpassung
Anchor link toUm den Stil der Inbox UI anzupassen, beachten Sie bitte:
Weitere Details finden Sie im Inbox-Beispiel.