|
New Features in LiveCode iOS LiveCode with iOS support has now launched, and it is packed with a whole range of exciting features that can be included and used in your applications. Full iOS support is now integrated in LiveCode 4.5.2, released Monday 6th December. Demonstrating LiveCode at Apps World We demonstrated some of the new features during the Apps World Exhibition in London last week, and the positive response was overwhelming. The look and feel of writing and deploying applications fits right into the familiar development environment you have become used to from LiveCode. So, what's new in 4.5.2? Mobile devices are the future, and with our entrance into this market, we have extended the IDE to include a Simulate button in the LiveCode menubar. This allows you to link directly into a variety of simulator versions provided by Apple. The button is enabled for any stack that is configured for iOS deployment. Applications can be written in the familiar way and then tested with a click of a button, before deploying them to the devices of your choice, including iPhone, iPod Touch and iPad. You have to enroll on the Apple iOS Developer Program before being able to test your applications on a real device. Membership on this programme is an Apple requirement and allows you to generate the necessary certificates and profiles. For help getting up and running with the Apple Developer Program and building your iOS application, visit this lesson. In addition to supporting many of the desktop features, LiveCode iOS supports many iOS specific features that you can normally only access when developing your applications in Xcode. Features The current release of the iOS engine is based on a stable 4.0 branch that provides you with a robust framework for your iOS applications. It also means that not all of the features present in the 4.5.x engine are available to the current iOS platform. Work to bring these engines together into one stream is underway. The following features do work in iOS:
iOS Specific LiveCode Support In order to provide users of iOS applications with a familiar look and feel of the applications you write, LiveCode supports many features that are normally only accessible via Xcode. This includes:
The following 4.5.x features are currently not supported in iOS:
We will be adding support for these features in a number of forthcoming updates to this platform. LiveCode Browser Control The ease with which iOS applications can be developed in LiveCode is remarkable. Take the following example that demonstrates the key points of how to implement an iPhone based web navigator. This example incorporates key features that you would expect to find in most web browsers or navigators. A detailed lesson on implementing this web navigator can be found in the LiveCode Lessons for Mobile Devices here. As with many LiveCode applications, start developing this navigator by dragging and dropping the controls onto a card. This should include buttons to navigate to previous and next pages. You should also add buttons that allow you to stop loading a page and refresh the content of an existing page. Also create a text field for the URL, a label in which to display load status information and a group to present the content that is being downloaded from the Internet. The interface can be created without writing code and may present you with a navigator prototype that looks something like this:
Next add code to the mouseUp events of the four buttons: on mouseUp doAction "retreat" // for the previous end mouseUp on mouseUp doAction "advance" // for the next button end mouseUp on mouseUp doAction "stop" // for the stop button end mouseUp on mouseUp doAction "reload" // for the reload button end mouseUp Add code to the closeField and returnInField events of the text field: on closeField goUrl the text of me end closeField on returnInField focus on nothing end returnInField The remaining code should be place on the card of the application. This code ties the input from the buttons to actions that are submitted to web pages, updates the status bar and displays the web content in the display group. # declare the local id of the browser we are creating local sBrowserId on preOpenCard # quit if we are not on a mobile device if the environment is not "mobile" then exit preOpenCard end if # create the browser iphoneControlCreate "browser" put the result into sBrowserId # set up the basic defaults iphoneControlSet sBrowserId, "rect", the rect of group \ "Browser" iphoneControlSet sBrowserId, "visible", "true" iphoneControlSet sBrowserId, "url", "http://www.runrev.com" end preOpenCard on closeCard if the environment is not "mobile" then exit closeCard end if # destroy the browser we created iphoneControlDestroy sBrowserId end closeCard # provide a status message that indicates loading has started on browserStartedLoading pUrl put "Started loading:" && pUrl into field "Status" end browserStartedLoading # provide a status message that indicates loading has finished on browserFinishedLoading pUrl put "Finished loading:" && pUrl into field "Status" put pUrl into field "Url" end browserFinishedLoading # provides a status message that indicates the reason for loading on browserLoadRequest pUrl answer "Do you want to load:" && pUrl with "Yes" and "No" if it is "Yes" then pass browserLoadRequest else put "Refused:" && pUrl into field "Status" end if end browserLoadRequest # a handler that executes an action invoked by the controls on doAction pAction iphoneControlDo sBrowserId, pAction end doAction # a handler that loads the URL on goUrl pUrl iphoneControlSet sBrowserId, "url", pUrl end goUrl The simulator demonstrates what the web navigator could look like when deployed on a physical device. I hope you have found this article interesting, you can download the full release notes for 4.5.2 here. We look forward to bringing you more features and improvements as we continue to develop LiveCode for iOS.
|
|