Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.

Commit

Permalink
Added IsBackground method
Browse files Browse the repository at this point in the history
  • Loading branch information
DelphiWorlds committed Dec 9, 2019
1 parent 90e8569 commit 411306b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Core/DW.iOSapi.Helpers.pas
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ TiOSHelperEx = record
public
class function GetLocationManagerAuthorization: TAuthorizationType; static;
class function HasBackgroundMode(const AMode: string): Boolean; static;
class function IsBackground: Boolean; static;
class function IsIPhoneX: Boolean; static;
class function NSDictionaryToJSON(const ADictionary: NSDictionary): string; static;
class function SharedApplication: UIApplication; static;
Expand Down Expand Up @@ -85,6 +86,11 @@ class function TiOSHelperEx.HasBackgroundMode(const AMode: string): Boolean;
end;
end;

class function TiOSHelperEx.IsBackground: Boolean;
begin
Result := SharedApplication.applicationState = UIApplicationStateBackground;
end;

class function TiOSHelperEx.IsIPhoneX: Boolean;
const
cIPhoneXHeight = 812;
Expand Down

0 comments on commit 411306b

Please sign in to comment.