Configurar InboxUI con CocoaPods
1. Ejecute el comando ‘pod init’ desde la terminal en el directorio de su proyecto.
2. Abra el Podfile recién creado.
3. Agregue la dependencia de Pushwoosh bajo el target del nombre de su proyecto:
# 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. Ejecute el siguiente comando en la terminal en el directorio de su proyecto:
pod install5. Abra el archivo <your_project_name>.xcworkspace recién creado.
6. ¡Bien hecho! Acaba de integrar Pushwoosh InboxUI en su proyecto.
Agregar código de Pushwoosh InboxUI
Anchor link toPara mostrar la UI de Inbox en su aplicación, agregue el controlador de vista de Inbox:
self.navigationController?.pushViewController(PWIInboxUI.createInboxController(with: PWIInboxStyle.default()), animated: true)[self.navigationController pushViewController:[PWIInboxUI createInboxControllerWithStyle:[PWIInboxStyle defaultStyle]] animated:YES];Para que el Inbox coincida con la apariencia de su aplicación, cambie los parámetros de PWIInboxStyle. Puede personalizar parámetros como la fuente, el color de fondo, etc.
//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];Personalización
Anchor link toPara personalizar el estilo de la UI de Inbox, consulte:
Para más detalles, eche un vistazo a la muestra de Inbox.