UIButton and UIControlStateHighlighted issues when starting app - ios

for my UIButton I have its Default State Config set to buttonLong_beige.png and Highlighted State Config set to buttonLong_beige_pressed.png everything works as it should when the button is pressed, I press the button and the image changes from buttonLong_beige.png to buttonLong_beige_pressed.png each time i press it but the issue is when the app starts... before the button is even selected, it is already highlighted even though I never touched it yet... but once I press the button it returns to buttonLong_beige.png and then changes back and forth each time its pressed..... I have no code to display since this is all done in the storyboard, im very confused...

Check this in the "atribute inspector"
Its looks thats your button starts highligted, so un-check that.

Related

UIAlertController changes UIButton colour after dismiss

Whats happening is that I am making a post request using Alamofire.
Now when I hit api the button colour is light grey but after I show some message using AlertController and then Click on Ok Button the colour of button changes to Blue. Now in Identity inspector, button has UIButton set as class. I don't know whats going wrong I am not changing buttons background at any stage for selected, highlighted or other states.
There is no button category as well.
Attached images display step by step process.
pop is showing
blue background button
A bit late to the conversation, but for everyone looking for the answer, changing button.tintAdjustmentMode = .normal will ignore tint changes.

Program UIButton on swift

i have created a button on main.storyboard and i can add IBAction too. But, my aim is to make a sticky button(after you clicked once it is stayed pressed until you click it again) can somebody suggest please.
Set Image in selected state of uiButton,
means you need two image one for unselected and another for selected

My UITableView quit showing its delete button

I have a UITableView that came with the masterViewController in an Xcode split view template.
When I started working with it, it came all wired up with an edit button in the top left that showed the typical deletion business--the spinny lock button and the delete button on the all left, and it supported a swipe-to-reveal of a delete button on the right side. That all worked, including my delegate call to handle the underlying data function when a cell was deleted.
Somewhere along the way, that has broken, and now when the edit button is pressed, nothing happens. When I slide the cell to the left, it slides, and it stays where it's supposed to, hitched off to the left, but there's no delete button, and nothing happens when I tapped that area.
I have literally no idea what might have changed to have that quit working. Can anyone guide me to what I should be looking for?
My delegate's "shouldDelete" method always returns YES. My commitEdit method never gets called, as far as I can tell.

iOS: How to disable Fading in and out effect of UIButton

First of all, sorry for the title and asking this incredibly question but I simply couldn't figure it out. Also, since it is not related to code, I don't have code to show
I am working on an app and using iOS7 and I created a button from IB, set its background image to an image I designed. Connected it with header and set its touch up inside action as an IBAction
Yet, here is my problem. Whenever I click on the button, as an effect the image fades half transparent. I do not want this default attribute. I checked all the states on IB (highlighted, disabled, selected) and couldn't figure it out.
If I create the same button programmatically, only the text color changes, however when I set the background image, image fades (perhaps to indicate the button being pressed). How can I remove this effect?
A bit late but I believe this would solve the problem
in the xib file, set the button's type to Custom.
My button was set to system and when pressed on, it shows transparency and has a little fade in effect. Once I changed it to custom this effect is gone.
This cannot be changed once button is created. only in xib or when the button is first created.
have you tried this one yourButton.adjustsImageWhenHighlighted = NO?
If you set same background-image/background-color for every buttons states in IB (highlight, disable, selected) you will not get any fading in UIBUtton when you press it. You can set text color for every states also. If needed you can set different colors for every state and check the press action.
Hope the answered you expect. Thanks
Storyboard Solution
1:set button type to custom
2:uncheck "Highlighted adjusts Image"
If you want fading in & out effect your UIButton Type Should be a system, not custom.

UIBarButtonItem triggers action only when pressed for long enough

I have a few simple UIBarButtonsItems(no customization other than changing style, color and alpha). Everything was working perfectly fine for some time. But now I need to press BarButton for a long time(4-5 seconds) before the action is triggered. I just moved toolbar around and changed color and alpha after which this started happening. I don't exactly understand what caused this change of behavior.
I used interface builder to build the view and assigned action to UIBarButtonItems by Ctrl+Dragging.
I tried looking up a lot both on google and so. Most of the questions are about UIBarButtons not responding at all. Still I tried the solution of cleaning build of project and Xcode cache. But nothing changed.
Could someone help me with this?
I realized my mistake. I had two events getting triggered in same space in view. First was to reveal toolbar(i.e. increase its alpha) when tapped in particular area of the view and second one was of course button tap event for UIBarButtonItem. When tapped in that area the first event got triggered and eventually when pressed for long it also fired the second event once the toolbar was visible(if toolbar was invisible before).
Sorry to bother you all.

Resources