I am currently trying trying to implement an Action Extension that transforms content on a Safari web page through Google's Translation API.
My issue is that I would like to display some UI on the screen without covering the whole screen, but no matter what I do that doesn't seem to work.
I have tried the following:
Setting this in the info.plist
<key>NSExtensionActionWantsFullScreenPresentation</key>
<false/>
Trying to change the content size in the interface builder to the following
https://imgur.com/a/gfYvFiD (Uploading images through stack isn't working for some reason)
Giving the UI a clear background color (always ends up being grey after the presentation is complete)
Setting the presentation style to be over current context.
Now i have seen a similar question where the accepted response was that it cannot be done due to Apple restrictions (https://stackoverflow.com/a/38764183/10058854), but I have seen some apps that seem to do it.
For example, iTranslate:
https://imgur.com/a/QpFo5St
The above 2 images clearly show that they have created an Action Extension and that the added UI is just the bar at the bottom of the web view.
Any help would be much appreciated, and thank you for reading this.
Related
My iOS app is working with web content, and at certain time I need to take a screenshot of the web content. I'm using WKWebView (UIWebView was deprecated) for that purposes. All works fine, but recently I start to notice, that not all content appears on the screenshot. After some research, I've learned that some HTML pages have CANVAS tag, which is used for some real-time rendering/video playback. And this canvas content didn't appear on my screenshots. This quite frequently happens with ads.
I'm always using the following method for screenshot:
webView.drawHierarchy(in: rect, afterScreenUpdates: true)
At the moment, I can't find a way to take the screenshot as it appears on the screen.
Any ideas here are welcome since can't find any solutions.
Update:
Also, when trying to capture the view using Xcode debugger, it renders all the layers, view hierarchy etc.. Except that "canvas" view. It remains black.
I have been trying to implement the Google Places API and stumbled upon the Place Picker Demo provided by Google. I have been trying to edit the code and tailor it to my project but to no avail. For example I tried changing the launchscreen.storyboard file to fit my needs, but in the simulator it shows up for about a second before it goes back the original app screen. So is it even possible to edit the demo code that Google has created or transfer it to my project somehow? I am also quite new to Swift and Xcode so any help would be appreciated.
This is the link to where I obtained the code from:
https://developers.google.com/places/ios-api/code-samples
The LaunchScreen.storyboard interface is only shown for a split second while the app is loading and should not contain any actual content besides a logo or a barebones preview interface (Apple discourages logos) so that the app appears to have a fast start time.
On the Human Interface Guidelines:
A launch screen appears instantly when your app starts up. The launch
screen is quickly replaced with the first screen of your app, giving
the impression that your app is fast and responsive. The launch screen
isn’t an opportunity for artistic expression. It’s solely intended to
enhance the perception of your app as quick to launch and immediately
ready for use.
If you want to have a different starting screen, add a View Controller to the Main.storyboard and set it as the Initial View Controller (a checkbox in the right sidebar).
Currently it is cumbersome for the user to repeatedly scroll and take a screenshot if they want to capture more than what can fit on the screen at a time.
I would like to implement functionality such that at the request of a user (e.g. via tapping a special button on a custom keyboard), screenshots of the entire scrollable area of the currently opened app are automatically taken and stitched together.
Is this possible? And if so, how?
To clarify, the application containing the scrollable area is a third party application over which I have no control, e.g. iMessage or Facebook.
Edit: I am aware of answers like this one and this one that are about taking screenshots within an app that I control. As far as I can tell, these are not applicable in my situation. Please correct me if I am wrong about this.
This is not possible. Each app is contained in a protected sandbox that no other apps have access to.
You could make a custom keyboard, but you still wouldn't have access to any of the views in the app that you don't control.
I'm new to native development on xcode and have gotten started working with WatchKit to put together a Watch extension for my HTML5 hybrid app. I'm trying to figure out how to hide the indicator dot on a page-based app view. It looks like the iOS analogue provides the ability to hide the dot, but I can't seem to find anything for WatchKit. The Apple reference site doesn't appear to indicate any such functionality, and don't see any config in the storyboard. I've Googled and searched on StackOverflow, and haven't found anything there either.
Is it possible to hide the page indicator dot on a page-based app view? If so, how might I accomplish this?
It is currently not possible to hide page indicator.
My app is in landscape and uses a UINavigationController as its RootViewController. My goal with it is:
Disable the normal iOS StatusBar ( I know how to do that and already did it )
Have a semi-transparent StatusBar (a view) above the UINavigationBar, so that I can show custom information on it
Parts of the content of my main view must be visible underneath my custom StatusBar (exactly like it works with the normal UIStatusBar, just that I don't want the clock and battery and want to show my own information on it)
How can I best achieve this?
A quick search on GitHub gave me multiple libraries that offer the exact functionality you are looking for.
MTStatusBarOverlay
KGStatusBar
CWStatusBarNotification
FDStatusBarNotifierView
BWStatusBarOverlay
WTStatusBar
TWStatus
Try them out, test them and see which one is best for you.
If none of them are good enough, you should get an idea on how to achieve this functionality using the source code those libraries provide.
iOS 7 Human Interface Design, page 143 says:
Don’t create a custom status bar. Users depend on the consistency of
the system-provided status bar. Although you might hide the status bar
in your app, it’s not appropriate to create custom UI that takes its
place.
iOS Human Interface Guidelines