Swift 4.2

This commit is contained in:
Florian Gabach
2018-09-29 09:47:21 +02:00
parent 8ad819052c
commit c5947fa41b
14 changed files with 66 additions and 41 deletions
@@ -16,7 +16,7 @@ class OpenSourceViewController: UITableViewController {
y: 0,
width: 40,
height: 40) )
indicator.activityIndicatorViewStyle = UIActivityIndicatorViewStyle.gray
indicator.style = UIActivityIndicatorView.Style.gray
indicator.hidesWhenStopped = true
indicator.backgroundColor = UIColor.clear
indicator.color = UIColor.black
@@ -115,7 +115,7 @@ class OpenSourceViewController: UITableViewController {
// Applu navigation bar text color if needed
if let textColor = self.config.uiConfig.titleColor {
let attribut = [NSAttributedStringKey.foregroundColor: textColor]
let attribut = [NSAttributedString.Key.foregroundColor: textColor]
self.navigationController?.navigationBar.titleTextAttributes = attribut
}
}
@@ -177,7 +177,7 @@ class OpenSourceViewController: UITableViewController {
for: indexPath) as? OpenSourceTableViewCell
// Init cell
if cell == nil {
cell = OpenSourceTableViewCell(style: UITableViewCellStyle.default,
cell = OpenSourceTableViewCell(style: UITableViewCell.CellStyle.default,
reuseIdentifier: self.reuseIdentifier)
}
@@ -191,7 +191,7 @@ class OpenSourceViewController: UITableViewController {
override func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat {
// Automatic dimension
return UITableViewAutomaticDimension
return UITableView.automaticDimension
}
// MARK: - Action
+3 -3
View File
@@ -10,7 +10,7 @@ class OpenSourceTableViewCell: UITableViewCell {
// MARK: - Lifecycle
override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: .default,
reuseIdentifier: reuseIdentifier)
@@ -41,8 +41,8 @@ class OpenSourceTableViewCell: UITableViewCell {
func configure(licence: LicenceFile, config: OpenSourceControllerConfig) {
// Build attributed text
let libraryTitleAttribut = [NSAttributedStringKey.font: UIFont.boldSystemFont(ofSize: UIFont.systemFontSize + 2)]
let libraryLicenceAttribut = [NSAttributedStringKey.font: UIFont.systemFont(ofSize: UIFont.systemFontSize)]
let libraryTitleAttribut = [NSAttributedString.Key.font: UIFont.boldSystemFont(ofSize: UIFont.systemFontSize + 2)]
let libraryLicenceAttribut = [NSAttributedString.Key.font: UIFont.systemFont(ofSize: UIFont.systemFontSize)]
let libraryTitle = NSMutableAttributedString(string: licence.title ?? "",
attributes: libraryTitleAttribut)
libraryTitle.append(NSAttributedString(string: "\n\n"))