Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

format politeia details description (no UIWebview) #773

Merged
merged 1 commit into from May 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -8,6 +8,7 @@

import Foundation
import UIKit
import Down

class PoliteiaDetailController: UIViewController {
@IBOutlet weak var titleLabel: UILabel!
Expand Down Expand Up @@ -140,7 +141,9 @@ class PoliteiaDetailController: UIViewController {
}

if politeia.indexfile != "" && politeia.fileversion == politeia.version {
self.contentTextView.text = politeia.indexfile
let down = Down(markdownString: politeia.indexfile)
let attributedString = try? down.toAttributedString()
self.contentTextView.attributedText = attributedString
} else {
self.contentLoadingIndicator.isHidden = false
DispatchQueue.global(qos: .userInitiated).async {
Expand All @@ -151,7 +154,9 @@ class PoliteiaDetailController: UIViewController {
if error != nil {
self.contentTextView.text = error?.localizedDescription
} else {
self.contentTextView.text = description
let down = Down(markdownString: description!)
let attributedString = try? down.toAttributedString()
self.contentTextView.attributedText = attributedString
}
}
}
Expand Down
1 change: 1 addition & 0 deletions Podfile
Expand Up @@ -7,5 +7,6 @@ target 'Decred Wallet' do

pod 'JGProgressHUD'
pod 'QRCodeReader.swift'
pod 'Down'

end
6 changes: 5 additions & 1 deletion Podfile.lock
@@ -1,20 +1,24 @@
PODS:
- Down (0.11.0)
- JGProgressHUD (2.2)
- QRCodeReader.swift (10.1.0)

DEPENDENCIES:
- Down
- JGProgressHUD
- QRCodeReader.swift

SPEC REPOS:
trunk:
- Down
- JGProgressHUD
- QRCodeReader.swift

SPEC CHECKSUMS:
Down: b6ba1bc985c9d2f4e15e3b293d2207766fa12612
JGProgressHUD: d83d7a981b85d11205e19ff8ad5bb9c40571c847
QRCodeReader.swift: 373a389fe9a22d513c879a32a6f647c58f4ef572

PODFILE CHECKSUM: 64169a56707a1ecbb7c4d47f0d73f353f9e24ba6
PODFILE CHECKSUM: 9b9ccdaabb19ede54b35393bb86595cf157fece5

COCOAPODS: 1.10.1