This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UIKit | |
| public class ScrollableStackView: UIView { | |
| // MARK: Private Properties | |
| private lazy var scrollView: UIScrollView = { | |
| let scrollView = UIScrollView(frame: .zero) | |
| scrollView.backgroundColor = .clear | |
| scrollView.translatesAutoresizingMaskIntoConstraints = false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // ViewController.swift | |
| // Demo | |
| // | |
| // Created by Andey on 04.01.2023. | |
| // | |
| import Combine | |
| import UIKit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct Weakify<Object: AnyObject> { | |
| weak var object: Object? | |
| } | |
| func weak<Object: AnyObject>(_ object: Object) -> Weakify<Object> { | |
| Weakify(object: object) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extension StringProtocol { | |
| subscript(_ offset: Int) -> String.Element { | |
| if offset >= 0 { | |
| self[index(startIndex, offsetBy: offset)] | |
| } else { | |
| self[index(endIndex, offsetBy: offset)] | |
| } | |
| } | |
OlderNewer