Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import UIKit
- //MARK:- ConfirmationView
- /**
- This Class is used to show a common View for limited time
- */
- class ConfirmationView: UIView
- {
- //MARK: UIView
- /// Main Content View
- @IBOutlet var contentView: UIView!
- //MARK: UILabel
- /// Title to display in View
- @IBOutlet weak var headerLabel: UILabel!
- //MARK: Init Class
- /**
- This function is used to Initialise the class
- */
- override init(frame: CGRect) {
- super.init(frame: frame)
- loadNib()
- }
- //MARK: Encoder
- /**
- This function is used to Store the class objects added
- */
- required init?(coder aDecoder: NSCoder) {
- super.init(coder: aDecoder)
- loadNib()
- }
- //MARK: Dienit class
- /**
- This function is used to De-Allocate the class objects
- */
- deinit {
- /// Remove all The Initiated Instances
- }
- }
- //MARK:- Required Functions
- extension ConfirmationView
- {
- //MARK: Load Nib
- /**
- This function is used to load the Nib from Bundle
- */
- func loadNib() {
- Bundle.main.loadNibNamed("ConfirmationView", owner: self, options: [:])
- // 2. Adding the 'contentView' to self (self represents the instance of a WeatherView which is a 'UIView').
- addSubview(contentView)
- // 3. Setting this false allows us to set our constraints on the contentView programtically
- contentView.translatesAutoresizingMaskIntoConstraints = false
- contentView.backgroundColor = UIColor.clear
- // 4. Setting the constraints programatically
- contentView.topAnchor.constraint(equalTo: topAnchor).isActive = true
- contentView.bottomAnchor.constraint(equalTo: bottomAnchor).isActive = true
- contentView.leftAnchor.constraint(equalTo: leftAnchor).isActive = true
- contentView.rightAnchor.constraint(equalTo: rightAnchor).isActive = true
- }
- }
- ///Create a Reference for XIB
- /// Confirmation View Xib Class Reference
- private var confirmationViewXib : ConfirmationView?
- confirmationViewXib = self.showConfirmationView(staticText: "Sign Up Completed using (loginType)")
- self.view.addSubview(confirmationViewXib!)
Add Comment
Please, Sign In to add comment