You can very easily customise the appearance of all Pulsate SDK's UI so it fits your needs. You can change colors of all elements and the content of texts.

Pulsate Configuration JSON

The pulsateConfiguration.json file can be found the PULPulsateBasic.bundle. The easiest way to find the file is just to type it's name into XCode's explorer.

604604

If you want to use a custom color, just put a hexadecimal color in the element you want to change. If you want to color the navigation bar to yellow just put a hexadecimal number in the corresponding element "pulsate_top_nav_bar_background_color" : "#ffde17"

17001700 17001700 17001700 17001700

Pulsate Toolbar Customization

With the release of version 2.14.12 Developers can now add an additional button in the Pulsate Feed. The button will appear in the main Feed Toolbar in the right corner.

750750

To add this button you need to call the new setInboxRightButton method and pass an UIBarButtonItem that you want to show. This should be done in the AppDelegate under didFinishLaunchingWithOptions.

UIButton* _helpButton = [UIButton buttonWithType:UIButtonTypeSystem];
[_helpButton setTitle:@"Help" forState:UIControlStateNormal];
[_helpButton sizeToFit];
[_helpButton addTarget:self action:@selector(helpPressed) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem* helpItem = [[UIBarButtonItem alloc] initWithCustomView:_helpButton];
[pulsateManager setInboxRightButton:helpItem];

-(void) helpPressed {

}
let helpButton = UIBarButtonItem(
  title: "Help",
  style: .plain,
  target: self,
  action: #selector(helpPressed(sender:))
)
pulsateManager.setInboxRightButton(helpButton)
    
@objc func helpPressed(sender: UIBarButtonItem) {

}

User Avatar Customization

The user avatar by default is set to use the user initials when possible, when not available the user avatar will be an anonymous icon. With the release of version 2.14.12 Developers can now disable showing initials as the user avatar, this will cause the avatar to be the anonymous icon even if FirstName and LatName are set. This can be done by calling the new useInitialsForUserAvatar method. This should be done in the AppDelegate under didFinishLaunchingWithOptions.

[pulsateManager useInitialsForUserAvatar:NO];
pulsateManager.useInitials(forUserAvatar: false)

Font Customization

To change the fonts that are used in the Pulsate Inbox Developers can override the UIFont class and set default fonts for UITextField and UILabel in their AppDelegate.

Please create the following files in your project - UIFont+SystemFontOverride.h and UIFont+SystemFontOverride.m. The font we will use in this Demo is called "PartyLetPlain", change this font to any other you want to use.

//  UIFont+SystemFontOverride.h

#import <UIKit/UIKit.h>

@interface UIFont (SystemFontOverride)
@end
//  UIFont+SystemFontOverride.m

#import <objc/runtime.h>
#import "UIFont+SystemFontOverride.h"

NSString *const FORegularFontName = @"PartyLetPlain";
NSString *const FOBoldFontName = @"PartyLetPlain";
NSString *const FOItalicFontName = @"PartyLetPlain";

@implementation UIFont (SystemFontOverride)

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wobjc-protocol-method-implementation"
+ (void)replaceClassSelector:(SEL)originalSelector withSelector:(SEL)modifiedSelector {
    Method originalMethod = class_getClassMethod(self, originalSelector);
    Method modifiedMethod = class_getClassMethod(self, modifiedSelector);
    method_exchangeImplementations(originalMethod, modifiedMethod);
}

+ (void)replaceInstanceSelector:(SEL)originalSelector withSelector:(SEL)modifiedSelector {
    Method originalDecoderMethod = class_getInstanceMethod(self, originalSelector);
    Method modifiedDecoderMethod = class_getInstanceMethod(self, modifiedSelector);
    method_exchangeImplementations(originalDecoderMethod, modifiedDecoderMethod);
}

+ (UIFont *)regularFontWithSize:(CGFloat)size
{
    return [UIFont fontWithName:FORegularFontName size:size];
}

+ (UIFont *)boldFontWithSize:(CGFloat)size
{
    return [UIFont fontWithName:FOBoldFontName size:size];
}

+ (UIFont *)italicFontOfSize:(CGFloat)fontSize
{
    return [UIFont fontWithName:FOItalicFontName size:fontSize];
}

- (id)initCustomWithCoder:(NSCoder *)aDecoder {
    BOOL result = [aDecoder containsValueForKey:@"UIFontDescriptor"];
    
    if (result) {
        UIFontDescriptor *descriptor = [aDecoder decodeObjectForKey:@"UIFontDescriptor"];
        
        NSString *fontName;
        if ([descriptor.fontAttributes[@"NSCTFontUIUsageAttribute"] isEqualToString:@"CTFontRegularUsage"]) {
            fontName = FORegularFontName;
        }
        else if ([descriptor.fontAttributes[@"NSCTFontUIUsageAttribute"] isEqualToString:@"CTFontEmphasizedUsage"]) {
            fontName = FOBoldFontName;
        }
        else if ([descriptor.fontAttributes[@"NSCTFontUIUsageAttribute"] isEqualToString:@"CTFontObliqueUsage"]) {
            fontName = FOItalicFontName;
        }
        else {
            fontName = descriptor.fontAttributes[@"NSFontNameAttribute"];
        }
        
        return [UIFont fontWithName:fontName size:descriptor.pointSize];
    }
    
    self = [self initCustomWithCoder:aDecoder];
    
    return self;
}

+ (void)load
{
    [self replaceClassSelector:@selector(systemFontOfSize:) withSelector:@selector(regularFontWithSize:)];
    [self replaceClassSelector:@selector(boldSystemFontOfSize:) withSelector:@selector(boldFontWithSize:)];
    [self replaceClassSelector:@selector(italicSystemFontOfSize:) withSelector:@selector(italicFontOfSize:)];
    
    [self replaceInstanceSelector:@selector(initWithCoder:) withSelector:@selector(initCustomWithCoder:)];
}
#pragma clang diagnostic pop
@end