blockchainethereumblockchain-walleterc20erc721walletxdaidappdecentralizederc1155erc875iosswifttokens
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.
39 lines
1.4 KiB
39 lines
1.4 KiB
7 years ago
|
// 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")
|
||
|
}
|
||
|
}
|