How to disable JavaScript in Cocoa WebView? - objective-c

I'd like to use Cocoa WebView for display of email messages. For security/privacy purposes I want to disable JavaScript but, incredibly enough, can't find any way to do it in the documentation.
Thanks in advance for any hints.

Check out WebView's -(WebPreferences *)preferences, which has a -(void)setJavascriptEnabled:(BOOL)flag option.

Related

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,

Is it possible to prevent the user from using Safari on iOS?

I need to remove or at least make it impossible for the user to run Safari on an iPad.
Instead, the user should use a far more restricted browser that we will provide.
Is this possible?
With jailbreaking possibly, without jailbreaking, no.
Actually you can. Go to Settings > General > Restrictions, enable them, and turn off Safari. You can find more information on Apple's website.
If you mean to open url in your app by using your own webview instead of opening safari, you can register your class with the UIWebViewDelegate protocol and implement the method – webView:shouldStartLoadWithRequest:navigationType:
Inside this method, you can deal with the url and return NO, so that safari won't be opened.

How to create transparent notification window?

I'm not sure of the correct name, but I am wondering how to create (in Objective-C) a transparent notification "window/panel", such as is shown when you change the volume intensity, or keyboard illumination, or display brightness. I want to put my own icon/text on it, for my own notification.
I don't know the words to Google for, so I'm asking here.
Thanks for any suggestions.
Matt Gemmell's RoundedFloatingPanel component on his sample code page may do just what you're looking for.
After looking into using the solutions provided by the other two given answers, I found that they would not work for my purposes. So, I wrote up my own library:
BHBezelNotification
Growl is a widely-used implementation of this. By default, it doesn't look exactly like the system overlays, though it is skinnable - you probably want the Bezel notification:
See the Growl Developer Documentation for more.

Android Lockscreen API?

I've seen two apps that can customize lockscreens: Widget locker, slidescreen.
Do we really have an API that lets us customize the lockscreen?
If not, what is the trick?
See mylockforandroid:
mylockforandroid
Its GPL'ed but you will get the code tricks by viewing source.