steve228uk / MessengerKit

:speech_balloon: A UI framework for building messenger interfaces on iOS
MIT License
1.48k stars 128 forks source link

How to add custom header/footer and why can't I change the font size of the bubble text? #38

Closed dan007b3 closed 5 years ago

smhk commented 4 years ago

To change font size ...

It's just the ".font" property in the style. So for example:

override var style: MSGMessengerStyle {
    var s = MessengerKit.Styles.iMessage
    s.incomingBubbleColor = .white
    s.outgoingBubbleColor = .white

    s.incomingTextColor = .black
    s.outgoingTextColor = .black

    s.font = .systemFont(ofSize: 14)
    return s
}

The relevant file is "MSGIMessageStyle.swift"

Note that in the file, the default is

public var font: UIFont = .preferredFont(forTextStyle: .body)

which explains why generally it is pretty large by default.