This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// UIScreenAdjuster.swift | |
// Created by Petr Grigorev | |
// This code could be used for automatic keyboard appearance handling. | |
// It automatically moves screen whenever a new text editing session from | |
// UITextField or UITextView is recognized. | |
// | |
// To start using it, just declare a constant inside your AppDelegate, like: | |
// | |
// private let screenAdjuster = UIScreenAdjuster() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This code was reshaped from Joel Fischer's answer from here: | |
// https://stackoverflow.com/questions/8812192/how-to-set-font-size-to-fill-uilabel-height/17622215#17622215 | |
import UIKit | |
extension UIFont { | |
static func getFont(name: String, maxSize: CGFloat, heightToFit: CGFloat) -> UIFont { | |