mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-28 23:32:41 +00:00
UIButton: Add convenient method to modify font.
This commit is contained in:
parent
c92d1c4fd1
commit
a977dff806
1 changed files with 7 additions and 1 deletions
|
@ -14,7 +14,7 @@
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import Foundation
|
import UIKit
|
||||||
|
|
||||||
extension UIButton {
|
extension UIButton {
|
||||||
|
|
||||||
|
@ -51,4 +51,10 @@ extension UIButton {
|
||||||
self.titleLabel?.adjustsFontForContentSizeCategory = newValue
|
self.titleLabel?.adjustsFontForContentSizeCategory = newValue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Set title font and enable Dynamic Type support
|
||||||
|
func vc_setTitleFont(_ font: UIFont) {
|
||||||
|
self.vc_adjustsFontForContentSizeCategory = true
|
||||||
|
self.titleLabel?.font = font
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue