Recent

Author Topic: Develop IOS Apps with Lazarus.  (Read 22290 times)

lff

  • New Member
  • *
  • Posts: 13
Develop IOS Apps with Lazarus.
« on: January 12, 2013, 11:30:33 pm »
Hello
I have invested a lot of time with the „firing components“ for IOS, but the performance of  “TListView” or “TScrollbox” was not enough. So one year ago I started a complete new development of native IOS components. Target was to get them working on Lazarus and Free Pascal in order to commercially sell them when ready.
Now I have a huge project:
Lazarus was easily adapted for ios development.
With the additional program xcodebuilder you can quickly create new projects for Lazarus and Xcode.
Starting the app with Lazarus, the IOS-Simulator starts automatically and is put into the foreground. In the source code you can still set breakpoints as you used to, to be able to debug the app. There is an auto-completion of the source code and hints that explain the respective command.
Under project options you can easily change between iPhone and iPad.
Here is a link to a video showing these features.
http://www.youtube.com/watch?v=aE8o3vbMx78&feature=youtu.be

The inherited components (pas4ios) have been taken from the original in most parts. So the commands.

Objective-c (Objective-Pascal)
UIObject -> UIResponer -> UIView -> UILabel

Components pas4ios
TObject-> pmUIObject -> pmUIResponer -> pmUIView -> pmUILabel


For the database connection you can use Zeos, Kbmmemtable, Omnixml, AnyDAC or other.

Current status as is:
•   Complete installation set for Mac
•   Different examples
•   80% of most important components
•   Xcodebuilder (for creation of Xcode and Lazarus projects)

Still in search or necessary:
•   Beta tester
•   Create help
•   More components

Here you can download a first demo. Works under mac lion or higher, Xcode 4.4 or higher.
http://pas4mobile.com/wp-content/uploads/2013/01/pmExample1_0_0_8.zip

lff

  • New Member
  • *
  • Posts: 13
Re: Develop IOS Apps with Lazarus.
« Reply #1 on: January 26, 2013, 12:54:44 pm »
Now i could combine the Xcode's Interface Builder with Lazarus and the pas4ios components. Now you can easily create your own surface with the original IOS components.
Have a look at the video on youtube:

http://youtu.be/VoW8RQaKghw
« Last Edit: January 26, 2013, 01:14:54 pm by lff »

otorres

  • Jr. Member
  • **
  • Posts: 94
Re: Develop IOS Apps with Lazarus.
« Reply #2 on: January 26, 2013, 05:38:21 pm »
Wow, amazing job!!!

IndianaJones

  • Hero Member
  • *****
  • Posts: 509
Re: Develop IOS Apps with Lazarus.
« Reply #3 on: January 26, 2013, 06:00:38 pm »

Firstly, impressive and fantastic.
xcodebuilder will be commercial product or an addition to the Lazarus project?
Regards.

lff

  • New Member
  • *
  • Posts: 13
Re: Develop IOS Apps with Lazarus.
« Reply #4 on: January 31, 2013, 10:10:47 pm »
As long as you work on the IOS simulator, pas4ios is free.

For a better understanding, I would like to emphasize that this type of developing iOS apps is very simple and in my opinion is unique, because:
  • Pascal is easier to learn than Objective-C.
  • Optimized touch behavior when writing professional applications (compared to universal surfaces such as "web-based" or "FM2").
  • Pascal experts can continue to work with known components, such as kbmmemtable, OmniXML, Zeos, AnyDAC and many more.
  • Fast compiling when testing apps. (Xcode takes longer with Objective-C).
  • SPEED.
  • FREE version to develop for the simulator.
  • With one XML file, you can create your own options, see: FILE
  • And and and.
In the coming days, the first version pas4ios is available on www.pas4mobile.com (currently beta).

Meli

lff

  • New Member
  • *
  • Posts: 13
Re: Develop IOS Apps with Lazarus.
« Reply #5 on: March 06, 2013, 09:42:12 pm »
Hello
Quite some time has passed while pas4ios has been tested now. We have optimized some features so pas4ios is better and faster than at the beginning. Apps can now be created with the Beta Version on real devices. Prerequisite is an iPhone Developer Program from Apple. Received feedback is overall really positive.

Unfortunately german and european user are not as interested as rest of world. I would be happy though to have some more "regional" feedback as well! So please be welcome..
More information on www.pas4mobile.com

Meli

lff

  • New Member
  • *
  • Posts: 13
Re: Develop IOS Apps with Lazarus.
« Reply #6 on: April 15, 2013, 09:28:03 pm »
New pas4ios Beta Version 1.8

Now you can add gestures to objects, which inherited from TpmUIView.
When added a gesture to a view object it gives you the possibility to disconnect the logic for recognizing a gesture. Once the object recognizes a gesture, it sends an event to the view object OnGestureRecognize.
   
There are six types of gesture objects:

TpmUITapGestureRecognizer
TpmUIPinchGestureRecognizer
TpmUIRotationGestureRecognizer
TpmUISwipeGestureRecognizer
TpmUIPanGestureRecognizer
TpmUILongPressGestureRecognizer

TpmUITapGestureRecognizer checks if single/multiple taps exist. Only if a certain number of taps are recognized a specified number of times then a gesture can be recognized.

TpmUIPinchGestureRecognizer checks gestures such as two touches. For example, zooming-out means using two fingers towards each other; or zooming-in two fingers away from each other.

TpmUIRotationGestureRecognizer checks rotation gestures. For example you can move two fingers circling, then the underlying view should move accordingly.

TpmUISwipeGestureRecognizer checks if gestures swipe in one or more directions. Swiping this gestures is quite decent, so this action is sent only once per gesture.

TpmUIPanGestureRecognizer checks panning gestures. If you press on or more fingers on a view, it is automatically panned. Once you implement this object you can choose for current translation and velocity of the gesture.

TpmUILongPressGestureRecognizer checks if a view is pressed a long time. A long time means a specified amount of time, so that the action can be sent. Fingers are only allowed to move a specified distance, otherwise the gesture cannot be recognized.

Source for add a gesture:
Code: [Select]
aViewObject.AddGestureRecognizer(TpmUIRotationGestureRecognizer.CreateNewWithNSObject);
or/and:
Code: [Select]
aTap:=TpmUITapGestureRecognizer.CreateNewWithNSObject;
aTap.NumberOfTouchesRequired:=2;
aViewObject.AddGestureRecognizer(aTap);

Event handler for recognized gestures:
Code: [Select]
aViewObject. OnGestureRecognize
Source example for the event handler:
Code: [Select]
// *****************************************************************************
procedure TpmRootViewController.fOnGestureRecognize(Sender: TpmUIObject);
// *****************************************************************************
begin
  if (Sender is TpmUIRotationGestureRecognizer) then
    begin
      fLabel.Transform:=CGAffineTransformMakeRotation(TpmUIRotationGestureRecognizer(Sender).Rotation);
      fLabel.Text:='Rotate';
    end;
  if (Sender is TpmUISwipeGestureRecognizer) then
    begin
      if TpmUISwipeGestureRecognizer(Sender).Direction=UISwipeGestureRecognizerDirectionRight then
        fLabel.Text:='Swip right'
        else
        fLabel.Text:='Swip left';
    end;
  if (Sender is TpmUITapGestureRecognizer) then
    begin
      if TpmUITapGestureRecognizer(Sender).NumberOfTouchesRequired=1 then
        fLabel.Text:='Tap 1 Finger';
      if TpmUITapGestureRecognizer(Sender).NumberOfTouchesRequired=2 then
        fLabel.Text:='Tap 2 Fingers';
      if TpmUITapGestureRecognizer(Sender).NumberOfTouchesRequired=3 then
        fLabel.Text:='Tap 3 Fingers';
    end;
end;


Meli

 

TinyPortal © 2005-2018