Snippets Collections
Issue: place parentview at top of all views, buttons, labels

    
    public static var BottomBarVC: BottomBarViewController!
    public static var parentViewHeight: CGFloat = 0
    
    var homeVC : HomeViewController!
    var favoriteVC : FavouriteItemsViewController!
    var profileVC : ProfileViewController!
    
    override func viewDidLoad() {
        super.viewDidLoad()

        BottomBarViewController.BottomBarVC = self
        BottomBarViewController.parentViewHeight = self.parentView.frame.height
        
        assignViewControllers()
//        setScanImage()
    }
    
    func assignViewControllers() {
        let storyboard = UIStoryboard(name: "Main", bundle: nil)
        homeVC = storyboard.instantiateViewController(withIdentifier: "HomeViewController") as? HomeViewController
        favoriteVC = storyboard.instantiateViewController(withIdentifier: "FavouriteItemsViewController") as? FavouriteItemsViewController
        profileVC = storyboard.instantiateViewController(withIdentifier: "ProfileViewController") as? ProfileViewController
        
        embedHomeVC()
    }
    
    func embedHomeVC() {
        AppDelegate.embed(self.homeVC, inParent: self, inView: self.parentView)
    }
    
    @IBAction func homeButtonPressed(_ sender: Any) {
      // C59104
      // 9A9A9A
        
        homeImageView.image = UIImage(named: "home_sel")
        homeLabel.textColor = hexStringToUIColor(hex: "C59104")
        
        favoriteImageView.image = UIImage(named: "favorite_unsel")
        favoriteLabel.textColor = hexStringToUIColor(hex: "9A9A9A")
        
        shoppingImageView.image = UIImage(named: "shopping_unsel")
        shoppingLabel.textColor = hexStringToUIColor(hex: "9A9A9A")
        
        profileImageView.image = UIImage(named: "profile_unsel")
        profileLabel.textColor = hexStringToUIColor(hex: "9A9A9A")
        
        AppDelegate.embed(self.homeVC, inParent: self, inView: self.parentView)
    }
    
    @IBAction func favoriteButtonPressed(_ sender: Any) {
      
        homeImageView.image = UIImage(named: "home_unsel")
        homeLabel.textColor = hexStringToUIColor(hex: "9A9A9A")
        
        favoriteImageView.image = UIImage(named: "favorite_sel")
        favoriteLabel.textColor = hexStringToUIColor(hex: "C59104")
        
        shoppingImageView.image = UIImage(named: "shopping_unsel")
        shoppingLabel.textColor = hexStringToUIColor(hex: "9A9A9A")
        
        profileImageView.image = UIImage(named: "profile_unsel")
        profileLabel.textColor = hexStringToUIColor(hex: "9A9A9A")
        
        AppDelegate.embed(self.favoriteVC, inParent: self, inView: self.parentView)
    }
    
    @IBAction func shoppingButtonPressed(_ sender: Any) {
      
        homeImageView.image = UIImage(named: "home_unsel")
        homeLabel.textColor = hexStringToUIColor(hex: "9A9A9A")
        
        favoriteImageView.image = UIImage(named: "favorite_unsel")
        favoriteLabel.textColor = hexStringToUIColor(hex: "9A9A9A")
        
        shoppingImageView.image = UIImage(named: "shopping_sel")
        shoppingLabel.textColor = hexStringToUIColor(hex: "C59104")
        
        profileImageView.image = UIImage(named: "profile_unsel")
        profileLabel.textColor = hexStringToUIColor(hex: "9A9A9A")
    }
    
    @IBAction func profileButtonPressed(_ sender: Any) {
      
        homeImageView.image = UIImage(named: "home_unsel")
        homeLabel.textColor = hexStringToUIColor(hex: "9A9A9A")
        
        favoriteImageView.image = UIImage(named: "favorite_unsel")
        favoriteLabel.textColor = hexStringToUIColor(hex: "9A9A9A")
        
        shoppingImageView.image = UIImage(named: "shopping_unsel")
        shoppingLabel.textColor = hexStringToUIColor(hex: "9A9A9A")
        
        profileImageView.image = UIImage(named: "profile_sel")
        profileLabel.textColor = hexStringToUIColor(hex: "C59104")
        
        AppDelegate.embed(self.profileVC, inParent: self, inView: self.parentView)
    }
<!-- Tab links -->
		<div class="tab">
			<button class="tablinks tab-font" onclick="openCity(event, 'footer')">Footer</button>
			<button class="tablinks tab-font" onclick="openCity(event, 'projects')">Projects</button>
			<button class="tablinks tab-font" onclick="openCity(event, 'disclaimer')">disclaimer</button>
		</div>

		<!-- Tab content -->
		<div id="projects" class="tabcontent">
			<h2>Projects</h2>
			<h3>Hey, If your reading this you obviously wanna find out about more of my projects</h3>
		</div>

		<div id="footer" class="tabcontent">
			<h3><a href="./index.html" class="js-gps-track -link-title" data-gps-track="footer.click({ location: 0, link: 15})"><strong>Home</strong></a></h3>
            <h3><a href="./pages/about.html" class="js-gps-track -link-title" data-gps-track="footer.click({ location: 0, link: 15})"><strong>About</strong></a></h3>
			<h3><a href="./pages/projects.html" class="js-gps-track -link-title" data-gps-track="footer.click({ location: 0, link: 15})"><strong>Projects</strong></a></h3>
            <h3><a href="#" class="js-gps-track -link-title" data-gps-track="footer.click({ location: 0, link: 15})"><strong>Contact</strong></a></h3>
            <p class="copyright">&copy;2020 WHY?</p>
		</div>

		<div id="disclaimer" class="tabcontent">
			<h2>Disclaimer</h2>
			<p><strong>THIS IS JUST A JOKE!
                <br>
                <br>
                I dont truely think this of python, I think python is a great language and would love to learn,<br>
                all of the acusations above are comepletely false and should not be followed.<br>
                Please respect what i am doing and dont hate on the joke.</strong>
			</p>
		</div>
            
 <!-- CSS -->
 		<style>
              .-link {
    color: rgb(0, 0, 0);
    text-decoration: none;
}
  
.-link-title {
    color: #000000;
    text-decoration: none;
    padding-left: 5rem;
}

.tablinl {
    padding: 5px
}

.tab-font {
    font-weight: bold;
}

.tab {
    overflow: hidden;
    border: 1px solid #ccc;
    background-color: #f1f1f1;
  }
  
  /* Style the buttons that are used to open the tab content */
  .tab button {
    background-color: inherit;
    float: left;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 14px 16px;
    transition: 0.3s;
  }
  
  /* Change background color of buttons on hover */
  .tab button:hover {
    background-color: #ddd;
  }
  
  /* Create an active/current tablink class */
  .tab button.active {
    background-color: #ccc;
  }
  
  /* Style the tab content */
  .tabcontent {
    display: none;
    padding: 6px 12px;
    border: 1px solid #ccc;
    border-top: none;
  }
		</style>
star

Fri Jan 27 2023 17:06:39 GMT+0000 (Coordinated Universal Time)

#ios #swift #bottombar #bottom #tab #tabbar #snippet #snipet #snipit #code
star

Sun Dec 13 2020 19:33:28 GMT+0000 (Coordinated Universal Time)

#html #css #tab #footer

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension