Drag UIKeyboard to hide [duplicate] - ios

This question already has answers here:
iMessage Style Receding Keyboard in an iOS App
(3 answers)
Closed 8 years ago.
I wonder how to prepare similar functionality to Skype app, which allow user down drag UITableVIew to hide in live mode UIKeyboard.
Do you have any suggestions to resolve this issue, or maybe have used before of some cocopods?

As of iOS 7, this functionality has been built into the UIScrollView class
Choose whichever of these fits your needs best.
scrollView.keyboardDismissMode = UIScrollViewKeyboardDismissModeInteractive;
scrollView.keyboardDismissMode = UIScrollViewKeyboardDismissModeOnDrag;
If however you want to achieve this in an older iOS version, you can't do anything interactive, but you can use the UIScrollViewDelegate method scrollViewWillBeginDragging: to dismiss the keyboard when the user starts scrolling.

Related

iphone x home indicator issue while using tableViewController [duplicate]

This question already has answers here:
TableView and the home indicator on iPhone X
(3 answers)
Closed 5 years ago.
I have some doubts. I'm using a UITableViewController, and at bottom it's not giving space for the home indicator. It goes behind the home indicator (refer to the image). If I add any button actions to the last cell, this will surely cause an error.
Refer this to add programmatically... https://developer.apple.com/documentation/uikit/uiview/positioning_content_relative_to_the_safe_area
Use Safe area layout constraints. See the attachment bellow.Your problem will be solved.

iOS Blur effect for a view behind when showing a UIView on top (dialog) [duplicate]

This question already has answers here:
Creating a blurring overlay view
(25 answers)
Closed 7 years ago.
I want to blur a view behind the the popped up UIView.
Is there anyway to achieve this programatically?
Thanks in advance!
You can do this through many ways depending the iOS you are supporting. Here are two ways backwards compatible with before iOS8:
FXBlurView
iOS-Blur (Similar to you implement a UIToolbar view)
In iOS8 you can use a UIVisualEffectView. The process is simple and you can checkout this tutorial of Ray Wenderlich on how to do it.
Since you have asked a "programatically" way, here is a example using iOS-Blur library mentioned before:
JCRBlurView *blurView = [JCRBlurView new];
[blurView setFrame:CGRectMake(0.0f,0.0f,100.0f,100.0f)];
[self.view addSubview:blurView];

Library to Animate UITextView`lik a banner "a la" Music App [duplicate]

This question already has answers here:
Scrolling UILabel like a marquee in a subview
(4 answers)
Closed 9 years ago.
I'm trying to have a UITextView reproducing the following effect (Apple Music App) :
The label The Rolling Stones - Sweet Summer Sun, Live in Hyde Park ... is too big fit in the view, and so it moving like a banner.
I'm looking for a library of a way to implement this effect.
Look at this library MarqueeLabel I am sure it'll help you.
I found an other good Library :
CBAutoScrollLabel
I don't know with one is the best. I just implement CBAutoScrollLabelI'm it working perfectly.
A tips for some one who want to use it : It's a UIView not a UITextView (I've done the mistake in my Storyboard)

Cancel and Clear button behaving differently in iOS 6 and iOS 7 [duplicate]

This question already has answers here:
UISearchBar's Cancel and Clear Buttons Not Working in iOS 7
(6 answers)
Closed 8 years ago.
In iOS 6 the Cancel and Clear button in UISearchBar work with single click but in iOS 7 it takes long tap and hold to get them work. I am confused why is it so?
I want those buttons to work with a single click in iOS 7 as well.
Maybe have a view(or something else) overlap this Cancel/Clear button. Or it's not have the right frame. So it's just work when you tap on the right position and this behavior make user confuse and they think those button not work.
My Bad.
In one of the implementation files a category was written on UIButton purposefully. See code below:
#implementation UIButton(PassTapGesture)
-(BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer
{
return YES;
}
#end
I just removed above code and everything is charm in iOS 7 too. Still I am confused that with the same code why it was working in iOS 6.

iOS 5 UIAlertView customisation [duplicate]

This question already has answers here:
Alert view is showing white rectangle in iOS7
(3 answers)
Closed 9 years ago.
I am adding UIButton to UIAlertView as below
it is fine with iOS 6 and below now in iOS 7 it comes like this
Please let us know the way to resolve this issue.
You can't add any view as a sub view in alert view as per the IOS 7 standard. please refer apple document. (UIAlert view customization not possible in IOS 7)
Please refer:
https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/UIKitUICatalog/UIAlertView.html#//apple_ref/doc/uid/TP40012857-UIAlertView-SW1
You can find the answer on this link
But this is wrong approach , you can see this on same link
Alertview should only use to show below details
Be immediately informed of critical information
Make a decision about a course of action
For above task you should use pickerview or tableview depends on the requirement.

Resources