File tree Expand file tree Collapse file tree 3 files changed +17
-20
lines changed Expand file tree Collapse file tree 3 files changed +17
-20
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ final class ArticleBuilder {
3333 if newText. contains ( " <!--more--> " ) { newText = newText. replacingOccurrences ( of: " <!--more--> " , with: " " ) }
3434 if newText. contains ( " <br> " ) { newText = newText. replacingOccurrences ( of: " <br> " , with: " " ) }
3535 if newText. contains ( " " ) { newText = newText. replacingOccurrences ( of: " " , with: " " ) }
36+ if newText. contains ( " <span></span> " ) { newText = newText. replacingOccurrences ( of: " <span></span> " , with: " " ) }
3637 newText = newText. trimmingCharacters ( in: . whitespacesAndNewlines)
3738
3839 if newText. count == 0 { return nil }
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ final class ArticleView: UIView {
6666 private( set) var stackView : UIStackView = {
6767 let stackView = UIStackView ( )
6868 stackView. axis = . vertical
69- stackView. distribution = . fill
69+ stackView. distribution = . fillProportionally
7070 stackView. spacing = 16
7171 return stackView
7272 } ( )
Original file line number Diff line number Diff line change 77
88import UIKit
99
10- final class PDAResizingImageViewWithText : UIView {
10+ final class PDAResizingImageViewWithText : UIStackView {
1111
12- let imageView = PDAResizingImageView ( )
12+ private ( set ) var imageView = PDAResizingImageView ( )
1313
14- let textLabel : UILabel = {
14+ private let textLabel : UILabel = {
1515 let label = UILabel ( )
1616 label. textColor = . systemGray
1717 label. font = UIFont . systemFont ( ofSize: 15 )
@@ -22,26 +22,22 @@ final class PDAResizingImageViewWithText: UIView {
2222
2323 init ( _ text: String ) {
2424 super. init ( frame: . zero)
25- setupView ( )
25+
26+ distribution = . fillProportionally
27+ axis = . vertical
28+ spacing = 4
29+
2630 textLabel. text = text
27- }
28-
29- required init ? ( coder: NSCoder ) {
30- fatalError ( " init(coder:) has not been implemented " )
31- }
32-
33- private func setupView( ) {
34- addSubview ( imageView)
35- addSubview ( textLabel)
3631
37- imageView. snp. makeConstraints { make in
38- make. top. leading. trailing. equalToSuperview ( )
39- }
32+ addArrangedSubview ( imageView)
33+ addArrangedSubview ( textLabel)
4034
4135 textLabel. snp. makeConstraints { make in
42- make. leading. trailing. equalToSuperview ( ) . inset ( 16 )
43- make. top. equalTo ( imageView. snp. bottom) . offset ( 4 )
44- make. bottom. equalToSuperview ( )
36+ make. horizontalEdges. equalToSuperview ( ) . inset ( 16 )
4537 }
4638 }
39+
40+ required init ( coder: NSCoder ) {
41+ fatalError ( " init(coder:) has not been implemented " )
42+ }
4743}
You can’t perform that action at this time.
0 commit comments