Recent

Author Topic: ProjectXC template for iOS  (Read 8444 times)

Frank

  • Jr. Member
  • **
  • Posts: 69
ProjectXC template for iOS
« on: November 29, 2017, 10:54:52 pm »
Is there a ProjectXC template for iOS? I have used osx-simple-new for MacOS, works great. Sorry, I'm very new to Xcode & this sounded like a great bridge from Lazarus/Delphi.

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: ProjectXC template for iOS
« Reply #1 on: November 29, 2017, 11:04:20 pm »
Is there a ProjectXC template for iOS? I have used osx-simple-new for MacOS, works great. Sorry, I'm very new to Xcode & this sounded like a great bridge from Lazarus/Delphi.

No, but there certainly could be.

I would suggest starting with Swift in Xcode 9 and do the iOS UI there, combining any Pascal code as dynamic libraries.

Frank

  • Jr. Member
  • **
  • Posts: 69
Re: ProjectXC template for iOS
« Reply #2 on: November 29, 2017, 11:12:23 pm »
@Phil - Thanks for the direction... sounds like I'm learning Swift      ;D

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: ProjectXC template for iOS
« Reply #3 on: November 30, 2017, 09:34:47 pm »
Is there a ProjectXC template for iOS? I have used osx-simple-new for MacOS, works great. Sorry, I'm very new to Xcode & this sounded like a great bridge from Lazarus/Delphi.

No, but there certainly could be.

I would suggest starting with Swift in Xcode 9 and do the iOS UI there, combining any Pascal code as dynamic libraries.

Let me expand a bit on this. I was running short of time yesterday.

Here's what you would want before you start doing iOS development with FPC and Xcode:

(1) One or more iOS Pascal templates for Xcode (https://macpgmr.github.io/ObjP/ProjectXC.html). Xcode provides a half dozen templates for the various types of iOS apps (Single View, Master-Detail, Page-Based, Tabbed, etc.), so ProjectXC equivalents would be needed for several of those. Plus the ability to specify whether universal app, iPhone-only or iPad-only.

(2) Parsed Pascal headers for iOS 11. Parsed headers are available for iOS 8 (https://github.com/genericptr) and you could probably use them when compiling against the iOS 11 SDK, but you would not have access to any frameworks, classes or methods added in iOS 9, iOS 10 or iOS 11.

(3) Example Pascal iOS app that shows how the process works (and that it does work), plus documentation.

None of these things exist today and no one is working on them. Programming should be fun and productive and even if these things did exist I'm not sure that the development process, particularly if you're new to it, would be either fun or productive.

Hence why I suggested that for now you use Swift. Think of Swift as the UI language of your iOS app, just as JavaScript is the UI language of a Web app.

With Swift you would start out designing the UI of your app the same as other iOS developers, with full support for the latest versions of the hundred or so frameworks included with iOS 11, using a language that's fully integrated with Xcode.

To integrate your Pascal code, put it into a dynamic library and add a Swift wrapper class for it. See the SwiftCast example for macOS given here: https://macpgmr.github.io/MacXPlatform/PascalDynLibs_3.html#WebMaps . One difference is that with iOS you deploy your library as a framework (.framework) instead of just a library (.dylib), but that's not difficult to do. The rest of the details of calling your Pascal library from Swift in iOS is pretty much the same as with macOS.


 

TinyPortal © 2005-2018