Scrolling in UIView using IQKeyboardManager but without using UIScrollView - swift

I am stuck in a screen where?
I have two UITextFields at top and one UIButton at bottom.
I have used IQKeyboardManager library so it is possible to scroll the entire page (till the bottom button) with keyboard present on the screen with the help of IQKeyboardManager and without use of UIScrollView.
Though I have set layout constraint of IQKeyboardManager which is IQLayoutGuideConstraint to my bottom constraint but it is not working for me.
self.IQLayoutGuideConstraint = self.bottomLayoutConstraint
Please help. Thanks in advance.

Related

Swift: How to make view controller scroll to text field when keyboard appears

I have a view controller with 8 text fields placed vertically in the view. The problem is that the keyboard obstructs some of the text fields so that the user cannot enter any data. So, basically I need a way to scroll the view.
I did try following the approach listed in this StackOverflow question but had trouble converting some of the objective-c to Swift.
How to make the view controller scroll to text field when keyboard appears
I was wondering if anyone has solved this problem in Swift and if so could post an example?
Thanks in advance!
Hi I've resolved this problem through subclassing UIScrollView. This is a swift version of scrollView and it works with auto layout.
You can checkout here https://github.com/honghaoz/AutoKeyboardScrollView
Basically, the idea is registering keyboard notifications (e.g. UIKeyboardWillChangeFrameNotification), and scroll to let active textFields visible when keyboarding is showing.

uitableview inside a uiscrollview (scrolling issue)

I have got a uitableview inside of a uiscrollview.
So the uitableview is smaller than the uiscrollview. And when I start to scroll down on the uitableview and it reaches the bottom, I am able to scroll in the uiscrollview.
And it works fairly. But not perfectly.
I would like to make the ux perfect so the scrollview would be kind of an extension (or another section of the uitableview). I don't want to add any section or footerview at the bottom of the tableview.
I was wondering on doing this by implementing something like this:
//
if tableview didscroll to bottom
then scrollview scrolltorect xxx
//
but it would only work if the uitableview was scrolling down.
I am not sure if this would replicate the correct ux behaviour.
Could you guys give me your advice on how to do this?
Thank you and best regards.
I found this very hard and difficult to execute so I changed my UI in order to put the bottom of the interface inside the tableview footer's view. This way the experience of scrolling my app got much smoother.

Cannot Impliment UITextview inside a UIPageViewController

I have a strange issue , I have a page app in which one page I had used a UITextView, but when I tap on the UITextView it moves to the next page, can't write anything on it.
There is no issue when I use UIPageViewControllerTransitionStylePageCurl. The only issue is with UIPageViewControllerTransitionStyleScroll. Anyone know the solution? please help me
I ran into the same issue myself, and it appears that it's a consequence of some default behavior that occurs whenever a UITextField or UITextView becomes first responder inside a UIScrollView.
The solution to prevent your UITextView from scrolling the UIPageViewController is to first embed it into a UIScrollView instead of directly into a page's main view.
This works because when the UITextView becomes first responder it will search for the earliest superview in the view hierarchy that is of type UIScrollView, and it will scroll that scrollview to accommodate for the keyboard covering the screen. If you don't wrap the UITextView inside a UIScrollView, your UIPageViewController's internal UIScrollView will be chosen and scrolled, producing undesired behavior.
You can refer the link below..
UIPageViewControllerTransitionStylePageCurl - http://developer.apple.com/library/ios/#documentation/uikit/reference/UIPageViewControllerClassReferenceClassRef/UIPageViewControllerClassReference.html
UIPageViewControllerTransitionStyleScroll - http://developer.apple.com/library/ios/#documentation/uikit/reference/UIPageViewControllerClassReferenceClassRef/UIPageViewControllerClassReference.html

UITableView scrolling UINavigationBar

How can i scroll my UINavigationBar according to a UITableView scroll,i mean:
When the user scrolls the UITableView down,the UINavigationBar should scroll with the UITableView and disappear;
When the user scrolls the UITableView up,the UINavigationBar should stay fixed on the top of the view.
I want a similar effect to this question but instead of a UISearchBar i need to do the same effect with a UINavigationBar,i've already tried the code from the link.Please any piece of code or source code will be appreciated.
Thanks in advance.
You can checkout the code for this library. It behaves a little differently (it mimicks the Chrome ios7 app), but you can easily rework the navbar handling to fit your needs.
I found an interesting post that might help.
http://horseshoe7.wordpress.com/2012/05/18/uinavigationbar-that-scrolls-away/
I would do this by hiding the navigationBar of the ViewController and adding a fake UINavigationBar into the Header of the first section of the tableView.

Adding a button in the bottom of a TableView

I'm trying to add a button on the bottom of a TableView, without any success.
The idea isn't to use the tableFooterView property, as that doesn't show the button in a fixed position.
My idea is more along the lines of the Facebook application's Notifications bar on the bottom.
I'm using Three20.
Any pointers on how I can achieve this?
Thanks
Just add button to the view below your tableview but ensure your table height is less than the position you are adding the button,this way your can scroll table above button & your button will always be visible
Just embed custom view over your tableview.i mean on the bottom of tableview.so the tableview will scroll and the view don't.
Add a UIView as the footerView and then add the UIButton to the UIView.