Programmatically rotate Apple Watch Display - iphone

Is there any way to programmatically rotate the apple watch display 180 degrees? This would enable a person wearing an Apple Watch to orient the Apple Watch display for easier reading by a person standing opposite to the person wearing the watch.
I see this can be done via the phone using the Apple Watch App => General => Watch Orientation. There, the user can indicate which side the digital crown is situated (and that rotates the screen exactly as I'd need), But I want to code up a button directly on the watch UI that will do the same rotation trick right within my watch-app.
I've been looking at properties and methods on WKInterfaceController or WKInterfaceGroup to no avail.

Although you cannot rotate the display, if you want to make text more legible to people on the other side of the device, you can try using upside down characters to make this easier.
This answer explains how this can be done: https://stackoverflow.com/a/2995356/2035473
However, if you want more than text to be rotated, you are out of luck. This is obviously not the most optimal solution, but is as close to what you are looking for as possible in the current API. This solution will not look great, either; the text looks strange using these unicode characters, but it is still something.

I have been sitting in the Watch Lab for almost three hours and I did talk to them about the Watch. Actually, there are so many limitations. Whatever you can do, they will specify it in the following documentation which it's relatively simple compared to other SDKs they released. So, I don't think you have the control on changing the orientation manually. Have fun making watch app.
https://developer.apple.com/library/ios/documentation/General/Conceptual/WatchKitProgrammingGuide/

Unfortunately, there is no method to programmatically rotate the Apple Watch display in the current version of WatchKit.
If you can limit the scenario to showing an image, you could render your UI in the Watch extension then send the rotated image to the Watch. However, there is also no way to determine the orientation of the Watch, so you'd have to add manual controls.
At the end of the day, I don't think there's any realistic or user-friendly way to accomplish this with the current version of WatchKit.

I gotchu bro
import WatchKit
import Foundation
class InterfaceController: WKInterfaceController {
override func awake(withContext context: Any?) {
// Configure interface objects here.
}
override func willActivate() {
// This method is called when watch view controller is about to be visible to user
super.willActivate()
WKExtension.shared().isAutorotating = true
}
override func didDeactivate() {
super.willDisappear()
WKExtension.shared().isAutorotating = false
}
}

Related

How to disable IMA UI on iOS

How to switch off entire UI of IMA (Google Interactive Media Ads)? It can't be customised so I need to turn it off and create my own.
So I could not find any better solution than to search through hierarchy and hide view manually. As IMA uses AVplayer as a container for its own ad player, I need to look through hierarchy of my AVPlayer, find IMAWKWebView and hide it. I am not big fan of this kind of solutions but as I can't find anything better at the moment, here it is:
for view in adContainer.subviews {
for subView in view.subviews {
if subView.description.range(of: "IMAWKWebView") != nil {
subView.isHidden = true
}
}
}
Where adContainer is usually your AVPlayer or anything you submit to IMAAdDisplayContainer.
I call this on STARTED event in IMAAdsManagerDelegate. It works well, however, even if I can't reproduce it now but I think it showed original UI after start for a while.

Callout within UITableView

I am looking for a iOS Music app style Callout functionality. What I mean with that is that I want to get the same kind of callout "bubble" you get when press-and-hold within the Music app on iOS5.
I have been searching for a good solution for this, but can't find it.
The closest to what I need is: Use UITableView bubble/callout like iPod app However, this user didn't share what solution he had.
The libs I have looked at are:
https://github.com/jayway/CWUIKit
https://github.com/edanuff/MonoTouchCalloutView
http://www.eidac.de/?p=183
All of these have one this in common: They are useless.
The problem with these are that they all use a static callout view using PNG images, not one with a pointer beneath. Also, they do not adapt to the size of the screen; thus the bubble gets outside of the screen.
Any suggestions on a good library which I can use to implements this within my app?
What about WEPopover?
It might be what you want.
WEPopover for iOS

Block external Window (TV-Out) from changing orientation

I'm playing around with the TV-out Adapter for the iphone. My goal is to have an external window display on my tv in order to play movies from my iphone.
the big problem I've got now, is that if the phones orientation changes (physically) the window that shows on the tv turns as well. which is of course unwanted behaviour..
So far i return NO from shouldAutoRotateToInterfaceOrientation. But it still turns and turns.
I'm very grateful for any help on that topic
cheers
sam..
Ah well the solution was rather simple.
I had to assign a RootViewController to the Window that I'm using. Said Rootviewcontroller then needs to implement a shouldAutoRotateToInterfaceOrientation Method (that of course returns NO).

Playing iPhone movies through TV out

Is there any way to emulate the Videos app such that we still maintain controls on the device (iPad/iPhone), but sends the video out through the cables to the TV? I looked into screen mirroring, but it's way too slow for videos, and regardless, the UIGetScreenImage() used by screen mirroring is no longer allowed by Apple.
The Videos app seems to have exactly what I need, but I don't see anything simple to make that happen.
Update (10/15/10): So apparently movies played through UIWebView have TV-Out support, while MPMoviePlayerController movies don't.
http://rebelalfons.posterous.com/iphone-os-support-for-tv-out
However, there is a caveat: this does not work on older devices updated to the most recent iOS. That is, iPod touches, iPhone 3G & 3GS don't work, while iPhone 4 and iPads do. Hoping there's some more stuff that we can use to fill in the gaps in compability, since I know its possible. Apps like AirVideo and StreamToMe currently support this functionality.
I am not sure if there is an official way to do this. But as for your examples, AirVideo uses method Swizzling (check out: http://www.cocoadev.com/index.pl?MethodSwizzling) to override checks in Movie Player, and acting like Videos app
I guess some with some reverse engineering on SDK, you can find where the checks are made, and swizzle that method, with your custom one.
In 3.2 and later (postdating the site you link to), UIScreen has a class method, 'screens' that'll return an array of one object — the main screen — if no external display is available, or two screens — the main screen and the external screen — if a TV lead is connected. The task should be as simple as positioning the views you want to appear on the external screen within its frame and the controls you want on the device within the other.
Have you tried that?
Edited for one additional comment: also as of 3.2, it is explicitly permissible to create an MPMovieController and then grab the view from it to treat as a normal UIView rather than doing a full 'present'. So that's how you'd get a movie view that you can position as you wish.

Modify photo selected by UIImagePicker before it's used in the move-and-scale screen

as you probably know, the UIImagePickerController in the UIKit Framework allows the user to take a photo which is then handed over to my App for further processing.
If the property allowsEditing is set to YES, the user is allowed to move and scale the photo after taking it.
What I'd like to accomplish is to modify the photo in my code BEFORE the user is presented with the move and scale screen. This is because I'd like to add some visual effects to the photo and the user should be able to move and scale with these effects already applied to the photo.
I know that there's the cameraOverlayView property, but this is not useful in my case as far as I'm concerned.
Any ideas?
Thanks, Thomas
Not so easy way is to implement move and scale functionality on your own.
make showsCameraControls NO. You can design your own preview screen (with modified Image).
Looks like there are issues with touches in IOS5 cameraOverlayView. Make sure the above solution works for IOS5 also :).