mastodon-ios/Mastodon/Extension/UIView+Remove.swift

19 lines
336 B
Swift

//
// UIView+Remove.swift
// Mastodon
//
// Created by xiaojian sun on 2021/4/16.
//
import Foundation
import UIKit
extension UIView {
func removeFromStackView() {
if let stackView = self.superview as? UIStackView {
stackView.removeArrangedSubview(self)
}
self.removeFromSuperview()
}
}