Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
117 views

I have 2 view controllers. View Controller A** and View Controller B I want to achieve a very simple thing. Setting left and right navigation bar buttons on View Controller A and change title and ...
Murat Yasar's user avatar
  • 1,064
0 votes
1 answer
816 views

Fixed by changing the title update line to: self.title = "" self.title = "\(currentQuestion+1)/\(gameObject!.results.count)" After messing around with constraints to find a good look on every iPhone ...
bernas's user avatar
  • 1
0 votes
1 answer
46 views

I added 2 bar button items on my main view controller and linked them into code. I also created outlet to navigation item. Although, when I run the iOS simulator none of my bar button items appear, ...
Taras's user avatar
  • 1,989
2 votes
1 answer
642 views

So I'm looking for how can I add shadow to NavigationBar and remove the bottom black line from NavigationBar? Also if I have searchBar in NavigationBar then shadow should go below to search bar. I ...
jay patel's user avatar
  • 258
0 votes
1 answer
417 views

Maybe this is impossible, but I always assumed you could just throw a UISearchController instance onto any old view controller's navigationItem and get a search bar. It seems to me like no matter what ...
cookednick's user avatar
  • 1,098
0 votes
2 answers
147 views

I've looked through a few online tutorials, but nothing is working. That's the code of my viewController: import UIKit class ViewController: UINavigationController { let textView = UITextView()...
swift-lynx's user avatar
  • 3,845
0 votes
2 answers
3k views

First of all: I'm using Swift 5 with Xcode 10 (iOS 12.0). I'm pretty new to Swift/iOS development and watched a couple of videos on how to add a "back" button to the navigation bar. In all of them (...
Neph's user avatar
  • 2,013
2 votes
3 answers
1k views

I want to achieve something very simple: a search bar in the navigation bar, with a Cancel button that shows when the bar is activated. I am using a UISearchController, and currently I have the ...
danqing's user avatar
  • 3,708
0 votes
0 answers
124 views

I'm using an integrated UISearchBar with UINavigationItem: navigationItem.searchController = searchController navigationItem.hidesSearchBarWhenScrolling = false It looks like this: ...
Richard Topchii's user avatar
-1 votes
2 answers
152 views

I was set pdf vector image in UINavigationBar rightBarButtonItem but it still displaying too small. How to display full size vector image in UINavigationBar? I was try following code:- First way:- ...
Bhaumik Surani's user avatar
0 votes
0 answers
23 views

I have a navigation bar button item with a shadow. When my controller appears the first time, the shadow shows fine: When I navigate somewhere and return back, the navigation bar cuts the shadow:
Alexey Chekanov's user avatar
0 votes
1 answer
144 views

When I try to add my image to a UIBarButtonItem, it changes its size. Setting the width for the UIBarButtonItem does not help fix the situation. I would like to add one large image that would suit any ...
Alex Kirov's user avatar
0 votes
1 answer
36 views

I'm presenting my view controller with the following code: UINavigationController* navigation = [[UINavigationController alloc] initWithRootViewController:sessionController]; [self ...
user3335999's user avatar
1 vote
3 answers
3k views

I am trying to add custom view (Label) as title view of navigation item. but it is not appearing in centre func setupNavigationMultilineTitle(title:String) { let autoscrollLabel = ...
Prashant Tukadiya's user avatar
0 votes
1 answer
409 views

On iOS 11 and 12, I can't figure out a way to make the searchBar use the whole width of the screen. navigationItem.searchController = searchController I can add more margin using: let sb = ...
Kugutsumen's user avatar
0 votes
1 answer
194 views

I'm trying to adjust spacing between UIBar Button items. func addLeftBarButtonItems() { let btn1 = UIButton(type: UIButton.ButtonType.custom) as UIButton let list_icon = UIImage(named: "list")...
Ravi's user avatar
  • 940
0 votes
0 answers
53 views

I'm having trouble finding a way to remove a 'ghost' back button (nothing but a blue back arrow) when I initialize my uinavigationcontroller with a custom uinavigationbar. When I click that back ...
Shekar 's user avatar
  • 250
1 vote
1 answer
1k views

I have a UINavigationItem i am trying to show a UIBarButtonItem. Now the problem is i added them correctly, they're functional and working 100%. but they're not showing on the UINavigationBar. ...
Mohmmad S's user avatar
  • 5,108
0 votes
0 answers
185 views

I have an iOS project with UINavigationController. When I pushviewcontroller with animated = YES [self.navigationController pushViewController:viewController animated:YES]; the top ...
wes. i's user avatar
  • 638
3 votes
3 answers
3k views

I want to add/set unread flag as red dot top right corner on UIbarButtonItem, See attached image for this What should i do to add/set red dot on Bar Button item? Once user tap on item then i want to ...
AtulParmar's user avatar
  • 4,570
0 votes
0 answers
270 views

I need to allow the users to edit the large title of a navigation bar after they tap it. The solution I have so far is to instantiate a UITextField and assign it as the titleView property of the nav ...
amirfl's user avatar
  • 1,632
1 vote
2 answers
192 views

When going to a secondary page, I'm trying to slide the back button in from the left over a period of 0.33 seconds. Right now the animation doesn't appear to be doing that, even after slowing duration ...
Joey Nash's user avatar
0 votes
1 answer
37 views

I want to add a something like a UITapGesture when you tap at the title it goes to another controller. I think UITapGesture only works for UIView but I want it to be for a text(String). @objc func ...
Omar Rashidi's user avatar
0 votes
1 answer
314 views

I created a custom view for navigationItem but somehow it is not receiving any click events: The code for customView is below class CustomNavigationView: UIView { let backButton: UIButton = { ...
Shivam Pokhriyal's user avatar
1 vote
1 answer
348 views

Is there a clean way in swift 4 to preserve the exact same UINavigationItems in the navigation bar that is presented when pushing from one UIViewController to the other. This means I want the ...
Zigglzworth's user avatar
  • 6,891
0 votes
1 answer
59 views

I'm building a social network that allows users to navigate from one profile to the next, by viewing who they follow. For simplicity, I created a test project with two view controllers: ViewController ...
Richard Poutier's user avatar
-1 votes
1 answer
1k views

I worked on app, and I cannot choose what to do: 1) Modify default UINavigationBar or 2) Create my own view as navigation bar and use it 3) Or even more - just place need elements (buttons, imageViews ...
Aleksei Danilov's user avatar
0 votes
1 answer
6k views

So the way I understand navigation bar (navigation item) is that it has three locations you can modify, which is left (leftBarButtomItem), middle (titleView), and right (rightBarButtonItem). Now what ...
Chen Li Yong's user avatar
  • 6,177
1 vote
1 answer
555 views

I am not able to show a back bar button item in my navigation item in my root view controller of my navigation controller. I have tried setting different properties. Other questions like this do not ...
daniel's user avatar
  • 1,036
1 vote
0 answers
712 views

I have an old ObjC iOS 9.3 App I am updating to iOS 12 and the iPhone X series. The main view is a UIViewController with an embedded UITableView using STCollapseTableView. The table has a ...
BlueskyMed's user avatar
  • 1,345
1 vote
1 answer
372 views

I am using Xcode 10 today, during development and testing I noticed that icons did not appear in iPhone 5s, iPhone 6s, iPhone 7s, just work on iPhone X, I set this icons by using xCode storyboard, I ...
Ahmed Abdallah's user avatar
1 vote
0 answers
121 views

I'm working on an iOS application that allows a user to change the primary accent color. When the user selects the accent color, all currently displayed elements that contain the accent color need to ...
jhnatr's user avatar
  • 543
2 votes
1 answer
967 views

I'm currently implementing a very simple TableViewController that has a navigation bar. I have set the title, turned the navigation bar translucent = true , and turned PrefersLargeTitles = true ...
Logan's user avatar
  • 1,212
7 votes
0 answers
236 views

I know there are a lot of questions out there on this topic; however, none of those answers have helped me and I have tried so many ways of going about solving this. My problem is that my bar button ...
Jaqueline's user avatar
  • 485
0 votes
1 answer
67 views

short: I don´t understand how to programmatically add the default back button. long: I have been asked to write an iOS app, without any previous experience I decided to follow the advices and code ...
eqtèöck's user avatar
  • 1,115
0 votes
0 answers
57 views

I am trying to add a UILabel as a custom view to the backButtonItem of the navigationItem but it doesn’t show up. I want to achieve something like the Mail iOS App as in the following picture where ...
Farid Rahmani's user avatar
1 vote
1 answer
2k views

So Im trying to create a UIBarButtonItem with a custom UIView by subclassing it like so. import UIKit import SnapKit class LocationManager: UIBarButtonItem { let createdView = UIView() lazy ...
HiDungLing's user avatar
5 votes
2 answers
1k views

Setup A simple view controller with a UISearchController set in the navigation item to use iOS 11's search functionality in the search bar. Any view with it's top constrained to the SafeArea.Top ...
Marc-Alexandre Bérubé's user avatar
2 votes
1 answer
84 views

I have three controller. let's say Controller A, B and C in sequence. navigation title color in controller A is red. blue in controller B and green in controller C. When i push these viewcontroller ...
tahiat's user avatar
  • 126
0 votes
1 answer
385 views

I'm trying to change the title in Product but somehow the navigationItem is different. How come the navigationItem in Container is different compared to the one in Product? class VC1: ...
Henny Lee's user avatar
  • 3,082
1 vote
1 answer
1k views

I have added a couple labels and an image to my navigation title bar. That all works great. But I want to cover all of it with a UIButton, but I can't get the UIButton to register any taps. Here's ...
Clifton Labrum's user avatar
1 vote
1 answer
583 views

I have custom UINavigationBar(for JSQMessagesViewController) with some items. But I have some problems with leftBarButtonItem func setNavigationBar() { let screenSize: CGRect = UIScreen.main....
Vladyslav Vdovychenko's user avatar
0 votes
1 answer
2k views

I am wondering to programmatically put a UISearchBar into UINavigationController, rather than replacing UINavBar title, as I want the large title to show up. See Files app on iOS. Here is my .swift ...
Tomáš Pánik's user avatar
0 votes
1 answer
477 views

I'd like to have a separate viewController as the searchResultsController however, I am getting unusual behaviour illustrated below. I am setting up searchController as such; func ...
David Henry's user avatar
  • 3,090
-1 votes
1 answer
58 views

I'm using this code to display a custom button as leftButtonItem: let button = UIButton(type: .system) button.setTitleColor(.white, for: .normal) button.setImage(UIImage(named: "Back"), ...
Francesco Bordignon's user avatar
1 vote
2 answers
445 views

I am using pushViewController like the following code: let vc = A() self.navigationController?.pushViewController(vc, animated:true) I want to add a navigationItem to the page that opens. This ...
Hilalkah's user avatar
  • 1,055
2 votes
0 answers
191 views

I'm trying to set a custom UILabel my navigationItem's titleView. In viewDidLoad I have the following code: override func viewDidLoad() { super.viewDidLoad() let subtopicLabel = UILabel() ...
Kex's user avatar
  • 8,687
1 vote
2 answers
722 views

I'm using custom UIBarButtonItem with image for backBarButtonItem. I discovered strange behavior, because in addition to my image, the default Arrow icon is also displayed. class ViewController: ...
Alexander Khitev's user avatar
1 vote
3 answers
107 views

I used 2 bar button items. One is for back button and second is for the title. It is working fine. But when the title string is large, the title shifts to left and back button does not appear, but it ...
Sakshi's user avatar
  • 15
2 votes
1 answer
67 views

I am creating RightBarButtonItem in UINavigationItem, Programmatically. Using this simple code UIButton *backButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 30, 30)]; [backButton setImage:[...
Talha Ahmad Khan's user avatar

1 2
3
4 5
23