How to simulate a click in a webpage in iOS with objective-C - objective-c

I'm looking for an equivalent of Mechanize (Ruby/python and more) for iOS.
I need to simulate a click in a webpage (form submission) and get the response back. I tried to construct a POST-request using ASIHTTPRequest without succes. I was able to create a solution in Ruby (with Mechanize) but I want to be able to do the same in objective-c for iphone development. Any suggestions ?

As described in the duplicated posts, the API to programmatically simulate touches is private, so not appropriate for a shipping app. Follow the links if you want to know how to do it anyway.

Related

React Native Multiple Images Picker

The problem
So, I am developing a react native application and I am facing the callenge of selecting multiple images from the user gallery. Just like apps like WhatsApp, Telegram, Twitter and even Reddit do. So with that in mind, i tried to use launchImageLibraryAsync from expo-image-picker but, as specified in their documentation, the "multiple selecion" of images is only supported on the web.
What I have thinked of
So, based on several searches, it seemed like i had to build my own "Gallery". To do this, so far i've tried to use #react-native-community/cameraroll and expo-media-library, but both of them requires that we pass the first property to the getPhotos (for #react-native-community/cameraroll) or to the getAssetsAsync (for expo-media-library) functions, which defines the first items to be fetched. This is a problem because I do not want to fetch like 20 items and then, when the user reaches the end of the list, it fetches more 20 items. I need something like this (this example is from Telegram). You can see that the app never stops me from scrolling, it goes all the way through my entire gallery.
What would also be nice
If you use reddit mobile, you can see that you can also select multiple photos using the several Apps like Google Photos, Files, Google Drive and so on.
This would be even nicer because I wouldn't need to implement a custom made Picker. Do you guys know how could I implement this?
OBS: I am using Expo with Bare Workflow, so I can use just about any package. I also opened a discussion at the Expo repo about it. You can check it here: https://github.com/expo/expo/discussions/15210.
Thank you in advance :)
I have been using this package called expo-images-picker check it out. It has similar function to what you need. It works in Mobile as well.
Link here

How to work with voice over in objective-C?

Its the first time when I work with voice over on objective c. i'm trying to make some simple app for blind community.
tell me necessary classes and methods to work with voice?
what should my application to except play and pause voice?
please show me main protocols and methods with examples.
Full tutorial will be appreciated :-)
video will be perfect
You just need to make the elements in your app accessible in the accessibility tree. By default they are all set to YES, so all the elements are ready by voice over. You don't have to write any code for that.
However you need to write code to post accessibility notifications, and to make some elements not read by voice over.
You can change the voice over settings in the device accessibility settings.
Please read the Apple's Documentation regarding the UIAccessibility.

What is the best way to display and interact with a skill tree

I am trying to create an interface that is similar to the interface on this website for the skill tree: http://www.pathofexile.com/passive-skill-tree. What is the best way to go about doing this and have the same or similar user interaction. ie. you click on a node and it activate or deactivates it. The movement of the tree and zooming on it would be nice as well. Would like to try to stay away from webView as I am thinking about features I want to add. Thanks in advance just want to see what a good way to do this is.
you can use webView and have almost a copy-paste of the presented webpage html source and load it.
However with native components you can have better performance, but it will "not a copy"
Native componets:
IIViewDeckController for iOS
iHasApp for iOS
iHasApp for iOS
There are more on that side. Consider a combination of they,

Apple Mail and its Webview Component

Does anyone know what Apple Mail is written in?
I'm trying to determine what component it uses to render HTML, is it using the Webview Class?
Are there any other options to render HTML when building OS X applications?
It's an Objective-C/Cocoa app and it's using WebView.
I know secondhand (from a developer who was tracking down bugs in his app and comparing behavior to Mail) it takes advantage of some undocumented calls to accomplish certain things. But for the most part it's the same WebView that you've got access to.
If you'd rather render HTML a different way, you could check out Gecko, the engine/library that Firefox and Camino are based on.

How can I expose an Objective-C function to JavaScript using WebKit on Mac OS X?

I understand to do this on the iPhone you need to trap link requests (as per my other iPhone question UIWebView Expose JavaScript) and you can easily do the reverse and access JavaScript from Obj-C code.
However, I would like to have JavaScript be able to call some Objective-C functions that would somehow be registered with WebKit. I assume that you can do this better than trapping links like on the iPhone as on Mac OS X we have access to the full WebKit.
I wish to basically do the reverse of Using JavaScript from Objective-C
Update: For example is it possible to expose the objective-c method in JavaScript like self.external.objcmethod();
Have a look at my answer to this question, which is very similar. I provide code that shows you exactly how to do what you want.
Essentially, you need to implement the WebScripting protocol as per the documentation.
You don't need to define your own URL scheme handler, that is only necessary for iPhone applications. On the Mac the WebView object is many orders of magnitude more powerful than UIWebView on the iPhone and allows full bridging from JavaScript to Objective-C and vice versa.
You can browse to "javascript:my_method()" and intercept the loading...
Look at UIWebViewDelegate delegate.
Documentation at http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIWebViewDelegate_Protocol/Reference/Reference.html
Look at the method shouldStartLoadWithRequest
((BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType)
Addtionally, you may want to look at https://dev.mobileread.com/trac/webkitbrowser/browser/trunk/WebKit-r30377/WebKit/qt/Api/qwebframe.cpp#L167
The way I've done this in the past is to implement my own URL scheme. In your HTML pages, you'd create links like myapp://dosomefunction?aParameter=aValue. Mac OS X will open your application (if it's not already running) and pass it the URL when you click these links. It's slightly more convenient than trapping requests, and it would work with any web view anywhere on the system.
See the accepted answer to this question for details on how to set up the handler. Unfortunately, this is a one-way operation. You won't be able to get any return values back from the application.