diff --git a/ElementX/Sources/Other/UserIndicators/ActivityIndicatorPresenter.swift b/ElementX/Sources/Other/UserIndicators/ActivityIndicatorPresenter.swift index de5c1876f..25c2787f5 100755 --- a/ElementX/Sources/Other/UserIndicators/ActivityIndicatorPresenter.swift +++ b/ElementX/Sources/Other/UserIndicators/ActivityIndicatorPresenter.swift @@ -35,20 +35,20 @@ final class ActivityIndicatorPresenter: ActivityIndicatorPresenterType { private weak var presentingView: UIView? var isPresenting: Bool { - return self.activityIndicatorView != nil + activityIndicatorView != nil } // MARK: - Public func presentActivityIndicator(on view: UIView, animated: Bool, completion: (() -> Void)? = nil) { - if self.presentingView != nil { + if presentingView != nil { if let completion = completion { completion() } return } - self.presentingView = view + presentingView = view view.isUserInteractionEnabled = false @@ -77,11 +77,11 @@ final class ActivityIndicatorPresenter: ActivityIndicatorPresenterType { } if animated { - UIView.animate(withDuration: Constants.animationDuration, animations: { + UIView.animate(withDuration: Constants.animationDuration) { animationInstructions() - }, completion: { _ in + } completion: { _ in completion?() - }) + } } else { animationInstructions() completion?() @@ -109,11 +109,11 @@ final class ActivityIndicatorPresenter: ActivityIndicatorPresenterType { } if animated { - UIView.animate(withDuration: Constants.animationDuration, animations: { + UIView.animate(withDuration: Constants.animationDuration) { animationInstructions() - }, completion: { _ in + } completion: { _ in animationCompletionInstructions() - }) + } } else { animationInstructions() animationCompletionInstructions() @@ -134,7 +134,7 @@ private extension UIView { /// Add a subview matching parent view using autolayout @objc func vc_addSubViewMatchingParent(_ subView: UIView) { - self.addSubview(subView) + addSubview(subView) subView.translatesAutoresizingMaskIntoConstraints = false let views = ["view": subView] ["H:|[view]|", "V:|[view]|"].forEach { vfl in diff --git a/ElementX/Sources/Other/UserIndicators/ActivityIndicatorPresenterType.swift b/ElementX/Sources/Other/UserIndicators/ActivityIndicatorPresenterType.swift index 6b90389f5..7ff6d7284 100644 --- a/ElementX/Sources/Other/UserIndicators/ActivityIndicatorPresenterType.swift +++ b/ElementX/Sources/Other/UserIndicators/ActivityIndicatorPresenterType.swift @@ -25,10 +25,10 @@ protocol ActivityIndicatorPresenterType { // `ActivityIndicatorPresenterType` default implementation extension ActivityIndicatorPresenterType { func presentActivityIndicator(on view: UIView, animated: Bool) { - self.presentActivityIndicator(on: view, animated: animated, completion: nil) + presentActivityIndicator(on: view, animated: animated, completion: nil) } func removeCurrentActivityIndicator(animated: Bool) { - self.removeCurrentActivityIndicator(animated: animated, completion: nil) + removeCurrentActivityIndicator(animated: animated, completion: nil) } } diff --git a/ElementX/Sources/Other/UserIndicators/ActivityIndicatorView.swift b/ElementX/Sources/Other/UserIndicators/ActivityIndicatorView.swift index 79f91dae4..95fb55d96 100755 --- a/ElementX/Sources/Other/UserIndicators/ActivityIndicatorView.swift +++ b/ElementX/Sources/Other/UserIndicators/ActivityIndicatorView.swift @@ -46,7 +46,7 @@ final class ActivityIndicatorView: UIView { // MARK: - Setup private func commonInit() { - self.activityIndicatorBackgroundView.layer.masksToBounds = true + activityIndicatorBackgroundView.layer.masksToBounds = true } convenience init() { @@ -55,37 +55,37 @@ final class ActivityIndicatorView: UIView { required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) - self.loadNibContent() - self.commonInit() + loadNibContent() + commonInit() } override init(frame: CGRect) { super.init(frame: frame) - self.loadNibContent() - self.commonInit() + loadNibContent() + commonInit() } // MARK: - Overrides override var intrinsicContentSize: CGSize { - return CGSize(width: self.activityIndicatorView.intrinsicContentSize.width + Constants.activityIndicatorMargin.width, - height: self.activityIndicatorView.intrinsicContentSize.height + Constants.activityIndicatorMargin.height) + return CGSize(width: activityIndicatorView.intrinsicContentSize.width + Constants.activityIndicatorMargin.width, + height: activityIndicatorView.intrinsicContentSize.height + Constants.activityIndicatorMargin.height) } override func layoutSubviews() { super.layoutSubviews() - self.activityIndicatorBackgroundView.layer.cornerRadius = Constants.cornerRadius + activityIndicatorBackgroundView.layer.cornerRadius = Constants.cornerRadius } // MARK: - Public func startAnimating() { - self.activityIndicatorView.startAnimating() + activityIndicatorView.startAnimating() } func stopAnimating() { - self.activityIndicatorView.stopAnimating() + activityIndicatorView.stopAnimating() } } @@ -98,7 +98,7 @@ private extension UIView { let layoutAttributes: [NSLayoutConstraint.Attribute] = [.top, .leading, .bottom, .trailing] for case let view as UIView in type(of: self).nib.instantiate(withOwner: self, options: nil) { view.translatesAutoresizingMaskIntoConstraints = false - self.addSubview(view) + addSubview(view) NSLayoutConstraint.activate(layoutAttributes.map { attribute in NSLayoutConstraint( item: view, attribute: attribute, diff --git a/ElementX/Sources/Other/UserIndicators/LabelledActivityIndicatorView.swift b/ElementX/Sources/Other/UserIndicators/LabelledActivityIndicatorView.swift index c0cf01da3..1aec8b32f 100644 --- a/ElementX/Sources/Other/UserIndicators/LabelledActivityIndicatorView.swift +++ b/ElementX/Sources/Other/UserIndicators/LabelledActivityIndicatorView.swift @@ -52,7 +52,7 @@ final class LabelledActivityIndicatorView: UIView { }() private let label: UILabel = { - return UILabel() + UILabel() }() init(text: String) { diff --git a/ElementX/Sources/Other/UserIndicators/RoundedToastView.swift b/ElementX/Sources/Other/UserIndicators/RoundedToastView.swift index 8488e7ff9..922b5ea2e 100644 --- a/ElementX/Sources/Other/UserIndicators/RoundedToastView.swift +++ b/ElementX/Sources/Other/UserIndicators/RoundedToastView.swift @@ -58,7 +58,7 @@ class RoundedToastView: UIView { }() private let label: UILabel = { - return UILabel() + UILabel() }() init(viewState: ToastViewState) { diff --git a/ElementX/Sources/Other/UserIndicators/UserIndicatorPresentationContext.swift b/ElementX/Sources/Other/UserIndicators/UserIndicatorPresentationContext.swift index 94656ad6b..30e09f1e0 100644 --- a/ElementX/Sources/Other/UserIndicators/UserIndicatorPresentationContext.swift +++ b/ElementX/Sources/Other/UserIndicators/UserIndicatorPresentationContext.swift @@ -37,6 +37,6 @@ public class StaticUserIndicatorPresentationContext: UserIndicatorPresentationCo public private(set) weak var indicatorPresentingViewController: UIViewController? public init(viewController: UIViewController) { - self.indicatorPresentingViewController = viewController + indicatorPresentingViewController = viewController } } diff --git a/ElementX/Sources/Other/UserIndicators/UserIndicatorPresenter.swift b/ElementX/Sources/Other/UserIndicators/UserIndicatorPresenter.swift index dc5d39d6c..d7631b9a7 100644 --- a/ElementX/Sources/Other/UserIndicators/UserIndicatorPresenter.swift +++ b/ElementX/Sources/Other/UserIndicators/UserIndicatorPresenter.swift @@ -49,7 +49,7 @@ class UserIndicatorTypePresenter: UserIndicatorTypePresenterProtocol { init(presentationContext: UserIndicatorPresentationContext) { self.presentationContext = presentationContext - self.queue = UserIndicatorQueue() + queue = UserIndicatorQueue() } convenience init(presentingViewController: UIViewController) { diff --git a/ElementX/Sources/Other/UserIndicators/UserIndicatorStore.swift b/ElementX/Sources/Other/UserIndicators/UserIndicatorStore.swift index c7734b637..20fd8b7a7 100644 --- a/ElementX/Sources/Other/UserIndicators/UserIndicatorStore.swift +++ b/ElementX/Sources/Other/UserIndicators/UserIndicatorStore.swift @@ -27,7 +27,7 @@ typealias UserIndicatorCancel = () -> Void init(presenter: UserIndicatorTypePresenterProtocol) { self.presenter = presenter - self.indicators = [] + indicators = [] } /// Present a new type of user indicator, such as loading spinner or success message. diff --git a/Tools/Scripts/Templates/SimpleScreenExample/ElementX/TemplateSimpleScreenCoordinator.swift b/Tools/Scripts/Templates/SimpleScreenExample/ElementX/TemplateSimpleScreenCoordinator.swift index f572d0819..e68de349c 100644 --- a/Tools/Scripts/Templates/SimpleScreenExample/ElementX/TemplateSimpleScreenCoordinator.swift +++ b/Tools/Scripts/Templates/SimpleScreenExample/ElementX/TemplateSimpleScreenCoordinator.swift @@ -64,7 +64,7 @@ final class TemplateSimpleScreenCoordinator: Coordinator, Presentable { } func toPresentable() -> UIViewController { - return self.templateSimpleScreenHostingController + templateSimpleScreenHostingController } // MARK: - Private