1

I'm new to swift, going to create an UI in that a tabor is being shown in it , As i gone through the apple's human interface guidelines , they said not use UITabBar on top. We can use it by custom , but many of them said while submitting in App Store it will get rejected.

So instead of UITabar what should use for the tab on top?

Joe
  • 859
  • 2
  • 10
  • 27
  • 2
    You can create a view containing buttons and place the view on top. You can customize the view and buttons as per your UI requirement. – ebby94 Sep 14 '16 at 06:31

2 Answers2

0

You should use a segmented control in the navigation bar, as in this example form the iOS Human Interface Guidelines:

https://developer.apple.com/ios/human-interface-guidelines/ui-controls/segmented-controls/

Segmented control in navigation bar

xpereta
  • 692
  • 9
  • 21
0

Is it possible? Sure, but it violates the human interface guidelines.

Swift Version

import UIKit

class TabViewController: UITabBarController, UITabBarControllerDelegate {

override func viewDidLoad() {
  super.viewDidLoad()
  self.delegate = self
  // Do any additional setup after loading the view.
}
override func viewWillLayoutSubviews() {
 super.viewWillLayoutSubviews()
 self.tabBar.invalidateIntrinsicContentSize()
 var tabSize: CGFloat = 44.0
 let orientation = UIApplication.sharedApplication().statusBarOrientation
 if UIInterfaceOrientationIsLandscape(orientation)
 {
    tabSize = 32.0;
 }
 var tabFrame = self.tabBar.frame
 tabFrame.size.height = tabSize
 tabFrame.origin.y = self.view.frame.origin.y
 self.tabBar.frame = tabFrame
 self.tabBar.translucent = false
 self.tabBar.translucent = true
}
  override func didReceiveMemoryWarning() {
  super.didReceiveMemoryWarning()
  // Dispose of any resources that can be recreated.
}
 /*
 // MARK: - Navigation

 // In a storyboard-based application, you will often want to do a little preparation before navigation
  override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
// Get the new view controller using segue.destinationViewController.
// Pass the selected object to the new view controller.
 }
 */
}
Harshal.y
  • 26
  • 4