Skip to content

Commit

Permalink
Removed Donate cell. Added Github link cel
Browse files Browse the repository at this point in the history
  • Loading branch information
antonlorani committed Jan 18, 2021
1 parent ebaac0a commit 9dbe1a3
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import UIKit
import os.log


class InitialViewController: UIViewController {

// MARK: - Properties
Expand Down
5 changes: 3 additions & 2 deletions Jottre/Controllers/SettingsScene/SettingsExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ extension SettingsViewController: UICollectionViewDelegate, UICollectionViewData
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {

if indexPath.row == 0 {

guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "appearanceSettingsCell", for: indexPath) as? AppearanceSettingsCell else {
fatalError("Cell is not of type AppearanceSettingsCell")
}
Expand All @@ -46,7 +46,8 @@ extension SettingsViewController: UICollectionViewDelegate, UICollectionViewData
guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "settingsCell", for: indexPath) as? SettingsCell else {
fatalError("Cell is not of type SettingsCell")
}
cell.title = "Donate"
cell.title = "Github repository"
cell.image = UIImage(systemName: "arrow.up.right.square.fill")!
return cell

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class SettingsViewController: UIViewController {
label.translatesAutoresizingMaskIntoConstraints = false
label.font = UIFont.systemFont(ofSize: 18, weight: .regular)
label.textAlignment = .center
label.text = "Version 0.9 Build 1"
label.text = "Version A71f Build 1"
label.textColor = .secondaryLabel
return label
}()
Expand Down
20 changes: 20 additions & 0 deletions Jottre/Views/SettingsCell/SettingsCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ class SettingsCell: UICollectionViewCell {
}
}

var image: UIImage = UIImage() {
didSet {
imageView.image = image
}
}



// MARK: - Subviews

Expand All @@ -28,6 +35,13 @@ class SettingsCell: UICollectionViewCell {
return label
}()

var imageView: UIImageView = {
let imageView = UIImageView()
imageView.translatesAutoresizingMaskIntoConstraints = false
imageView.tintColor = UIColor.gray
return imageView
}()



// MARK: - Override methods
Expand Down Expand Up @@ -63,6 +77,12 @@ class SettingsCell: UICollectionViewCell {
titleLabel.heightAnchor.constraint(equalToConstant: 50).isActive = true
titleLabel.widthAnchor.constraint(greaterThanOrEqualToConstant: 20).isActive = true

addSubview(imageView)
imageView.centerYAnchor.constraint(equalTo: centerYAnchor).isActive = true
imageView.rightAnchor.constraint(equalTo: rightAnchor, constant: -10).isActive = true
imageView.widthAnchor.constraint(equalToConstant: 35).isActive = true
imageView.heightAnchor.constraint(equalToConstant: 35).isActive = true

}

}
Expand Down

0 comments on commit 9dbe1a3

Please sign in to comment.