Files
SideStore/AltStore/Settings/LicensesViewController.swift

54 lines
1.3 KiB
Swift
Raw Normal View History

//
// LicensesViewController.swift
// AltStore
//
// Created by Riley Testut on 9/6/19.
// Copyright © 2019 Riley Testut. All rights reserved.
//
import UIKit
final class LicensesViewController: UIViewController
{
private var _didAppear = false
@IBOutlet private var textView: UITextView!
2019-10-24 13:04:30 -07:00
override var preferredStatusBarStyle: UIStatusBarStyle {
return .lightContent
}
override func viewWillAppear(_ animated: Bool)
{
super.viewWillAppear(animated)
self.view.setNeedsLayout()
self.view.layoutIfNeeded()
// Fix incorrect initial offset on iPhone SE.
self.textView.contentOffset.y = 0
}
override func viewDidAppear(_ animated: Bool)
{
super.viewDidAppear(animated)
_didAppear = true
}
override func viewDidLayoutSubviews()
{
super.viewDidLayoutSubviews()
self.textView.textContainerInset.left = self.view.layoutMargins.left
self.textView.textContainerInset.right = self.view.layoutMargins.right
self.textView.textContainer.lineFragmentPadding = 0
if !_didAppear
{
// Fix incorrect initial offset on iPhone SE.
self.textView.contentOffset.y = 0
}
}
}