In this Xojo tutorial we will see how simple it is to make an iOS App that shortens an entered URL using the public API of Bit.ly. We will use our own subclass inherited from Xojo.Net.HTTPSocket, and the Declare statement in order to use some functions and methods found on the native Cocoa Touch API. In fact, the use of Declare is mandatory because with the new Xojo Framewok we don’t yet have access to the EncodeURLComponent function available with the old framework. This one is a big help in substituting any ilegal character with his hexadecimal value for the final URL’s composition.
Comments closedTag: Declares
I’m sure you’ve all seen the iOS Mail app, which displays the number of unread messages in a small red badge in the top right of the app icon. You can do this too with your Xojo app and the magic of the Declare command.
Comments closedWhen doing a lot of manipulation to a TextArea’s contents under Cocoa, performance can suffer due to the underlying NSTextView doing work on layout and glyph selection. This can be sped up by telling the text view that you’re going to begin editing. You can do this by using a few Cocoa Declares.
Comments closedUpdate Aug 2017: Starting with Xojo 2017 Release 2 your app icons are automatically included in 64-bit Windows apps without having to do the workarounds described in this post. Upgrade today! If you are still using older versions of Xojo, then these workarounds are still necessary.
Comments closedOur user community has been busy enhancing the capabilities of Xojo for iOS with Declares!
We have been quite pleased with the feedback we’ve received about Xojo iOS, but we are commonly asked when Xojo will support a specific iOS feature that it does not yet have. We will be adding new iOS features with each release, but you may not have to wait for us to add a feature. With a bit of knowledge about CocoaTouch and the use of the Declare command in Xojo, there are many things you can take advantage of today.
Comments closedSometimes you need a feature that is not available directly from the Xojo framework. Responding to this need is what Declares are designed for: to get access to system native APIs. On OS X, you typically look at the Cocoa APIs. On Windows, the Win32 APIs. Finally on Linux, the GTK APIs.
Comments closed