An advanced Ethereum/EVM mobile wallet
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
alpha-wallet-ios/Trust/UI/ContainerView.swift

39 lines
1.4 KiB

// Copyright SIX DAY LLC. All rights reserved.
import Foundation
import UIKit
class ContainerView: UIView {
public init(innerView: UIView, layoutMargins: UIEdgeInsets) {
super.init(frame: .zero)
let containerView = UIView()
containerView.translatesAutoresizingMaskIntoConstraints = false
containerView.preservesSuperviewLayoutMargins = true
containerView.layoutMargins = layoutMargins
containerView.addSubview(innerView)
addSubview(containerView)
innerView.translatesAutoresizingMaskIntoConstraints = false
innerView.preservesSuperviewLayoutMargins = true
NSLayoutConstraint.activate([
containerView.topAnchor.constraint(equalTo: topAnchor),
containerView.trailingAnchor.constraint(equalTo: trailingAnchor),
containerView.bottomAnchor.constraint(equalTo: bottomAnchor),
containerView.leadingAnchor.constraint(equalTo: leadingAnchor),
innerView.topAnchor.constraint(equalTo: containerView.topAnchor),
innerView.trailingAnchor.constraint(equalTo: containerView.trailingAnchor),
innerView.bottomAnchor.constraint(equalTo: containerView.bottomAnchor),
innerView.leadingAnchor.constraint(equalTo: containerView.leadingAnchor),
])
}
required public init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}