Get access to over 100 FireMonkey cross platform samples for Android, IOS, OSX, Windows, and Linux!
Enter your email address below to receive new post updates!
FMXExpress.com has over 700 tips and tricks for building cross platform apps on Android, IOS, OSX, Windows, and Linux with a single codebase and single UI using the FireMonkey framework found in Delphi and C++Builder.
FMXExpress covers top cross platform secrets for FireMonkey in C++Builder and Delphi XE5, XE6, XE7, XE8, Seattle, Berlin, Tokyo, Rio, and Sydney.
HOW CAN I SHARE A LOCAL PDF FILE ON USING iOS?
http://www.tmssoftware.com/site/tmsicl.asp
uses
FMX.TMSNativeUIActivityViewController
{$IFDEF IOS}
, iOSapi.Foundation, FMX.Platform.Ios, iOSapi.UIKit, Macapi.Helpers
{$ENDIF}
TMyForm = class(TForm)
AVC: TTMSFMXNativeUIActivityViewController;
private
{$IFDEF IOS}
FController : UIDocumentInteractionController;
{$ENDIF}
procedure OpenIn(path: string);
procedure TMyForm.Button1Click(Sender: TObject);
begin
OpenIn(TPath.GetDocumentsPath + PathDelim + ‘manual.pdf’);
end;
{$IFDEF IOS}
function MakeNSRect(ox, oy, sx, sy: Single): NSRect;
begin
Result.origin.x := ox;
Result.origin.y := oy;
Result.size.width := sx;
Result.size.height := sy;
end;
{$ENDIF}
procedure TDocsListForm.FormCreate(Sender: TObject);
begin
{$IFDEF IOS}
FController := TUIDocumentInteractionController.Wrap(
TUIDocumentInteractionController.Alloc.init);
{$ENDIF}
end;
procedure TDocsListForm.OpenIn(path: string);
{$IFDEF IOS}
var
URL: NSURL;
success : Boolean;
{$ENDIF}
begin
{$IFDEF IOS}
URL := TNSUrl.Wrap(TNSUrl.OCClass.fileURLWithPath(StrToNSStr(path)));
FController.setURL(URL);
FController.setUTI(StrToNSStr(‘com.adobe.pdf’));
success := FController.presentOpenInMenuFromRect(MakeNSRect(0, 0, 0, 0),AVC.GetParentView,True)
{$ENDIF}
end;