Skip to content

Commit

Permalink
📱 hacky iOS 15 UITableView fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lucanaef committed Oct 12, 2021
1 parent d2c9104 commit 8850644
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
7 changes: 2 additions & 5 deletions PGPro/Decryption/Controller/DecryptionViewController.swift
Expand Up @@ -230,11 +230,7 @@ extension DecryptionViewController: UITableViewDataSource, UITableViewDelegate {
}

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
var cell: UITableViewCell!
cell = tableView.dequeueReusableCell(withIdentifier: cellIdentifier)
if cell == nil {
cell = UITableViewCell(style: .default, reuseIdentifier: cellIdentifier)
}
var cell = UITableViewCell(style: .default, reuseIdentifier: cellIdentifier)
cell.selectionStyle = .none

switch (indexPath.row) {
Expand All @@ -256,6 +252,7 @@ extension DecryptionViewController: UITableViewDataSource, UITableViewDelegate {
imageView.image = symbol.withTintColor(UIColor.label)
}
case DecryptionRows.message.rawValue:
cell.separatorInset = UIEdgeInsets(top: 0.0, left: 0.0, bottom: 0.0, right: 10000) // hack way to hide last separator
let cellView = cell.contentView
cellView.addSubview(textView)
textView.pinEdges(to: cellView)
Expand Down
8 changes: 2 additions & 6 deletions PGPro/Encryption/Controller/EncryptionViewController.swift
Expand Up @@ -296,12 +296,7 @@ extension EncryptionViewController: UITableViewDataSource, UITableViewDelegate {
}

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {

var cell: UITableViewCell!
cell = tableView.dequeueReusableCell(withIdentifier: cellIdentifier)
if cell == nil {
cell = UITableViewCell(style: .default, reuseIdentifier: cellIdentifier)
}
var cell = UITableViewCell(style: .default, reuseIdentifier: cellIdentifier)
cell.selectionStyle = .none

switch (indexPath.row) {
Expand All @@ -321,6 +316,7 @@ extension EncryptionViewController: UITableViewDataSource, UITableViewDelegate {
passphraseCell.textField.addTarget(self, action: #selector(textFieldDidChange), for: .editingChanged)
cell = passphraseCell
case EncryptionRows.message.rawValue:
cell.separatorInset = UIEdgeInsets(top: 0.0, left: 0.0, bottom: 0.0, right: 10000) // hack way to hide last separator
let cellView = cell.contentView
cellView.addSubview(textView)
textView.pinEdges(to: cellView)
Expand Down

0 comments on commit 8850644

Please sign in to comment.