swift 3 - reverse scrolling. can it be done? - ios

I have tried several options in order to implement reverse scrolling, but nothing seems to work.
The best example for what I am trying to do can be found in this link:
https://codepen.io/patrikhjelm/pen/klcnj
$(document).ready(function(){
$(window).scroll(function(){
$('.right').css('transform', 'translate3d(0,' + $(this).scrollTop()*2 + 'px, 0)');
}).scroll();
});
(I would explain with words but the visual in this case is much more expressive..)
I have already tried programming in JS while using UIWebView and WKWebView - but the scroll seems really choppy (I mean like really really choppy)
I was looking into SpriteKit before I decided to write here cause things just were not adding up. Has anyone had this particular demand and managed to solve it?
Thank - you

problem solved!
Just use view.frame.origin.y = scrollView.contentOffset.y * 2
works like a charm.

Related

UICollectionView weird animation (ghost cell, flash) on reload data

Hello as you can see in the video link below when I reload the data, for a frame something happens and some ghost cells appear and disappear, it's like a weird animation... Is it because of using reusable cells? and if it is, is it preventable cause that's not so pretty and it seems to cause a bit of frame drop with use of CATransition animation (not shown in the video). Any help would be appreciated.
Google Drive Link
Video Youtube Link
* EDIT *
Seems the video is not processed by google drive, sorry you gotta download it first to watch it.
Added Youtube link for convenience
Ok I Found the answer myself thanks to all the unnecessary downvotes:
The first solution was to use
collectionView.reloadItems(at: collectionView.indexPathsForVisibleItems)
but that still caused some problem and flicker stuff.
Some other said to use layoutIfNeeded() after that, yet that did not help.
The Solution I Found was to use func reloadSections(_ sections: IndexSet)
so when I use collectionView.reloadSections(IndexSet(integer:0)) (in my case it is the first section) The animation will happen smooth and perfect.

iOS error message tooltip

I need to show error message as a tooltip in iOS 8 but i don't know how to do it. What I want is something similar to the one shown in below image (I'm referring to the tooltip with messages Select and Select All):
There is a great collection of libraries which already target your problem.
For example have a look at: AMPopTip.
Then you could show the popover like:
self.popTip = [AMPopTip popTip];
[self.popTip showText:errorMessage direction:AMPopTipDirectionUp maxWidth:200 inView:self.view fromFrame:textField.frame];
and hide it:
[self.popTip hide];
Have a look at the github repo there are more examples for customizing this control.
You can find more which might suit your needs better here: cocoacontrols.com
I had a similar problem and wrote my own custom tooltip.
You can init with your custom view (i assume you write some delegations to detect actions within.) and present from anywhere.
Maybe not the best replacement of UIPopoverController but still works great. And a lifesaver for iPhone. Also highly customisable.
https://github.com/akeara/AKETooltip
Hope this helps.

Corona SDK Easing outBounce

I'm having a bit of trouble with Corona's transitions with easing.
Here is my code:
transitionTime = 120
transition.to( newDot, { time = transitionTime, y = newDot.destination_y, transition=easing.outBounce } )
Unfortunately, it's not actually bouncing at all. It just seems to be moving normally. I'm not sure if I'm doing something wrong or if something else needs to be done before the easing transition will display.
Any help would be greatly appreciated!
Thank you!
I'm pretty sure that transition API never worked properly. What I always would do is make 2 transitions with one having a slight delay like so:
transition.to(newDot, {time=80,y = newDot.destination_y - 50})
transition.to(newDot, {delay=80, time=40, y=newDot.destination_y})
Just work with something like that so just change up the numbers to your liking. Hope this helps.
I think you are using old corona version.The easing properties inBounce, outBounce, inOutBounce, outInBounce are applied only in new versions of corona. These properties will not work in old one.

How to disable long press gesture on UIWebView of iOS

I'm just wondering how to disable the long press gesture on webview in iOS.
I need to disable only long press gesture not others.
should work on iOS 5.0 +
thank you
I want to thank all for help. I finally found the solution after intensive stackoverflow research. For help other :
In the javascript/html, you can avoid dealing with the longpress event.
The solution was given long time ago : Preventing default context menu on longpress / longclick in mobile Safari (iPad / iPhone)
I did it and it is just perfect. Thanks and thanks again.
JM
You could make UIWebView as a super class to one of your custom class, extend it.. and override touchesBegan.. methods from UIView class..

IOS 3.2 MPMoviePlayerControler Controls do no disapear as advertised

i was having problems to make the MPMoviePlayerController controls disappear.
I tried to do it via:
...
MPMoviePlayerController *mplayer;
[mplayer setControlStyle:MPMovieControlStyleNone];
...
The problem is however that the controls appear for a brief second. I don't want to make my app look unprofessional so making them disappear completely is what i aim for.
There is a suggestion for a solution to this problem, but i in my tests it didn't work. I also tried the old var for solving this but no effect in this case either
mplayer.movieControlMode = MPMovieControlModeHidden; // old var
If anyone can give me hint on how to solve this it would be much appreciated!
Thanks in advance!
Best regards,
zhengtonic
If anyone is interested you can solve this by NOT using the MPMoviePlayerViewController.
Just use the MPMoviePlayerController and it works. Don't know why ...
Much thanks to the ppl on #iphonedev who gave me the tip.
Best regards,
zhengtonic.

Resources