iOS Swift Notifications action background color - ios

After some search i couldn't find information on how to change notification button background colors. Is this possible to do with Swift in iOS?
Thanks :)

The only thing you can do is to set it to red color. You can achieve it if you set actionButton.destructive equal to true

Related

iOS - Is it possible to change statusBarStyle to a custom colour?

I'm a beginner with iOS app development and want to customize the Status Bar colour. I have set my scene to a dark background and I want to battery and time in the Status Bar to match the colour.
At the moment I have added
var navigationBarAppearace = UINavigationBar.appearance()
UIApplication.shared.statusBarStyle = .lightContent
in AppDelegate.swift
Is there a way to add a custom hex colour for the text, not background?
I'm afraid there isn't without accessing private API's, which will get your app declined from apple review.
It's best to just find a way to make your app design work with the given, white or black status bar style.
The one thing you could do is create your own status bar that imitated the UIStatusBar, with your own labels and icons, but that would be a reasonable amount of hassle.

Change color of send message bar (JSQMessagesViewController)

I am adding chat functionality to my app using JSQMessagesViewController. I am going with a dark theme and made the chat dark except for the send message bar. I have not been able to figure out how to change its color (See screenshot below). Can someone tell me how to change the color of the send message bar?
Thanks!
Here is how I changed it. Thanks Sargeras for the help.
self.inputToolbar.contentView.backgroundColor = UIColor.blackColor()

Change iOS System Keyboard Background Image and Buttons Image

Rather than creating a custom keyboard...how can I change the ios keyboard background image and get reference of the keyboard button or just the keyboard view programatically?
I do not want to replicate the whole ios keyboard, just tweak the keyboard here and there.
Solution Update:
You cannot update only the background or the buttons of the iOS System Keyboard! This is dues to the reason that Apple has limited the access to the Keyboard API. The most you can do is change the keyboard background color i.e. dark or light.
If you need to change the background to an image like me, you need to extend the ios keyboard i.e. make your own custom keyboard!
Please check below for accepted answer!
Hope this helps!
You can do something like this,
myTextField.keyboardType = UIKeyboardTypeDecimalPad; // many other options
myTextField.keyboardAppearance = UIKeyboardAppearanceDark; //many other options
If you want totally customize keyboard then refer this tutorial.
Hope this will help :)
For dark background you can use
mytextfield.keyboardAppearance = UIKeyboardAppearanceAlert;
For more customisation follow this link:
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UITextInputTraits_Protocol/index.html

iOS 7 UIDatePicker - missing white text?

I'm just updating my application to use iOS 7. My plan is to set the background color in black with white text on a UIDatePicker. Is there a possible way I can set the color of the text on a UIDatePicker? If not, then it would be nice to have "setDatePickerViewStyle:UIDatePickerStyleLightContent" for UIDatePicker to be similar to the status bar style.
Any suggestion appreciated.
According the the styling guide, UIDatePickers cannot be styled:
https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/UIKitUICatalog/UIDatePicker.html#//apple_ref/doc/uid/TP40012857-UIDatePicker-SW1

Is it possible to customize application icon badge: Xcode?

This may be a foolish question. But I'm asking it because of my curiosity. Is there is any possible way to customize an iOS application icon badge image(as below:)..?
Thanks in advance...
Not possible at all. You have to use Default. After the app launch you can show custom badge icon of the UITabbar.
All the best !!!
If you mean the badge number that can be shown on an app icon, in white text over a red circle, then no, it cannot be set to a custom image. You can only control the number that is shown. It is set using the -[UIApplication setApplicationIconBadgeNumber:] method, i.e., the applicationIconBadgeNumber property on UIApplication:
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:99];
I have a possible solution, instead of using the OS to add a badge, what if you programmatically replace the app icon with a version that has the badge built into it.
You can use libraries such as:
https://github.com/skb1129/react-native-change-icon
The only question is, does anyone know if Apple would have any objections?

Resources