iOS) how to fix the image of default fbsdkloginbutton? - ios

I'm not asking about customizing fbsdkloginbutton, I want to use default fbsdkloginbutton.
My problem is that after the button is clicked, the button's image changes, also action of button for logout.
But I just want to use that button to enter my app, not logging out.
So I want to fix the image of default fbsdkloginbutton for LogIn.
after or being executed method 'didCompleteWithResult', that button changes... How can i solve this problem?

Related

In Swift, why does IBAction take the button as a parameter if its linked to only that one button?

I'm giving myself a crash course on functions and what I can't seem to understand is when using storyboard to create an IBAction by clicking and dragging from a UIButton, why does it give you the option to create a parameter for the button if the button already corresponds to the IBAction you just created? Why would creating the button as a parameter be helpful?This isn't clear to me yet but I really want to understand.
Thank you in advance.
You can connect more than one button to the same action. The button parameter then tells you which button was tapped.
Even when only connected to one button, the parameter is useful. You may wish to access the button in the action. Having the parameter gives you that direct access. No need to access any outlet property you may or may not have.

UIImagePickerController - Retake button on custom Overlay (Swift)

I am trying to implement a custom cameraOverlayView with a UIImagePickerController. I manage to hide the button and have my own interface , but a custom interface blocks the editing screen with the Preview option and the Retake. I noticed on some older posts adding two Notifications for "_UIImagePickerControllerUserDidCaptureItem", "_UIImagePickerControllerUserDidRejectItem" and then adding and removing the overlay would fix the issue. But with Swift 3 I cannot seem to find how to access these notifications and the delegate from UIImagePickerController is very limited. Is there another way ?
It seems like you cannot access the "Retake" event , so there is a need to create also a custom "Edit" screen. I have on the same customCameraOverlay , buttons for "Retake" and "Use it". So when the user stops capturing I hide the record and the cancel button and I present the retake and use it options, adding also a preview. So when the user clicks on retake I reverse the buttons again and remove the preview View. Likewise on "Use it" didfinishcapturing is being called

Change background color of facebook login button for ios

I am using facebook sdk for facebook login but I am unable to customize facebook button. Is there any way I can subclass my button as FBSDKLoginButton and change the background color as my need.Thank you.
I will simplify this:
1- make the facebook button but dont show it (don't addsubView the facebook page)
2- make a UIButton of your own, customize it the way you want and display it instead iof the faecbook button
3- onClick of your button fake the touch of the hidden facebook button [facebookbutton sendActionsForControlEvents: UIControlEventTouchUpInside];
Happy coding!
You can make your own UIButton and connect with login function.
Try to check the link below, FBSDK docs.
https://developers.facebook.com/docs/facebook-login/ios#custom-login-button
In Swift
Make your own design UIButton.
Create button action on your viewcontroller class.
Add the following line inside button action,
loginButtonFacebook.sendActions(for: .touchUpInside)

UIButton and UIControlStateHighlighted issues when starting app

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.

Popup notification box

Im trying to create a popup style notification, which is shown at the top of the screen (using a basic animation). The notification is going to be a simple form with a submit button.
Im trying to figure out how to go about this, and what are the best options i have. I've found this popup library: https://www.cocoacontrols.com/controls/cqmfloatingcontroller
What are the best options for 1. creating the popup and 2. animating to popup
If this is something that you will be reusing a lot, it might be worth subclassing UIAlertView, as you can then automatically use all "popup" methods provided by it,and by customizing it's view you can get the appearance you want.

Resources