iphoneRotateInterface command in mobile apps

Ben Rubinstein benr_mc at cogapp.com
Wed Oct 6 17:33:53 EDT 2010


On 06/10/2010 15:06, Colin Holgate wrote:
> Is there an orientation change event that we can use, or can we read the current orientation?

Yes to both - the current card gets an "orientationChanged" message when the 
device physically changes, and you can query the orientation at any time 
(including getting "face up" and "face down").  So you can tell when it 
changes, you can ask what it is at any time, and you can set the interface to 
any rotation at will.  But of course the basic implementation is just to tie 
these three things together with a handler like this:

	on orientationChanged
		iphoneRotateInterface iphoneDeviceOrientation()
	end orientationChanged


BTW, revMobile is unbelievably exciting.  I say this as someone with a whole 
bunch of people in the studio working on iPhone and iPad projects in Xcode and 
ObjectiveC, who thought it was very nice but not interesting (and was 
selfishly perfectly content that the barrier to entry was kept high).  But I 
finally decided to get a copy to look at just before Steve Jobs did his 
U-turn, and it is utterly fantastic.  While my colleagues with more bare-metal 
skills are fully occupied, I was able to whip up a prototype for a client for 
one project, and a handy utility to assist the team on another, in an 
incredibly short time.  Now that the price has dropped so far, I'd advise 
anyone with an iPhone, iPad, (or WinMob phone?) and any interest in the 
subject to get hold of it.  I think this has massive potential.

Ben



More information about the use-livecode mailing list