iPad Safari scrolling causes HTML elements to disappear and reappear with a delay

You need to trick the browser to use hardware acceleration more effectively. You can do this with an empty three-dimensional transform: -webkit-transform: translate3d(0, 0, 0) Particularly, you’ll need this on child elements that have a position:relative; declaration (or, just go all out and do it to all child elements). It is not a guaranteed fix, … Read more

convert UIImage to NSData

Try one of the following, depending on your image format: UIImageJPEGRepresentation Returns the data for the specified image in JPEG format. NSData * UIImageJPEGRepresentation ( UIImage *image, CGFloat compressionQuality ); UIImagePNGRepresentation Returns the data for the specified image in PNG format NSData * UIImagePNGRepresentation ( UIImage *image ); Here the docs. EDIT: if you want … Read more

Xcode/Simulator: How to run older iOS version?

To anyone else who finds this older question, you can now download all old versions. Xcode -> Preferences -> Components (Click on Simulators tab). Install all the versions you want/need. To show all installed simulators: Target -> In dropdown “deployment target” choose the installed version with lowest version nr. You should now see all your … Read more

The identity used to sign the executable is no longer valid

Neither restarting Xcode nor restarting my Mac helped. Solution within Xcode: In Xcode, go to Preferences –> Accounts –> View Details Press the + symbol and select iOS Development Press the refresh button in the lower left corner (called Download all in Xcode 7) PS: Sometimes it may also help to delete invalid provisioning profiles: … Read more

How can I click a button behind a transparent UIView?

Create a custom view for your container and override the pointInside: message to return false when the point isn’t within an eligible child view, like this: Swift: class PassThroughView: UIView { override func point(inside point: CGPoint, with event: UIEvent?) -> Bool { for subview in subviews { if !subview.isHidden && subview.isUserInteractionEnabled && subview.point(inside: convert(point, to: … Read more

How do I URL encode a string

Unfortunately, stringByAddingPercentEscapesUsingEncoding doesn’t always work 100%. It encodes non-URL characters but leaves the reserved characters (like slash / and ampersand &) alone. Apparently this is a bug that Apple is aware of, but since they have not fixed it yet, I have been using this category to url-encode a string: @implementation NSString (NSString_Extended) – (NSString … Read more

How can I recognize touch events using jQuery in Safari for iPad? Is it possible?

Core jQuery doesn’t have anything special for touch events, but you can easily build your own using the following events touchstart touchmove touchend touchcancel For example, the touchmove document.addEventListener(‘touchmove’, function(e) { e.preventDefault(); var touch = e.touches[0]; alert(touch.pageX + ” – ” + touch.pageY); }, false); This works in most WebKit based browsers (incl. Android). Here … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)