LaunchEnvironmentResource
public struct LaunchEnvironmentResource
Stores resource
as a name of the resource and Bundle in which the resource is available.
Resource is initialized with a bundle description (a bundle name or a bundle identifier) and a name of the resource.
If bundle name is nil then Bundle.main is used.
Resource can be parsed from string.
Resources representation: is made of resource representation
separated by comma.
In addition, the CleanFlag can be used as first element.
Resource representation: is made of a bundle name (or a bundle identifier) and a resource name
separated with colon. Bundle name can be a nil string then the Bundle.main will be used.
Example:
Test data:events,nil:contacts
AM_CLEAN_DATA_FLAG,Test data:events,nil:contacts
-
Clean flag indicating that existing data should be removed (eg. contacts) before adding new one.
Declaration
Swift
public static let CleanFlag: String -
Bundleobject where resource is available.Declaration
Swift
public let bundle: Bundle -
Resource name.
Declaration
Swift
public let name: String
-
Initialize the resource with a bundle description (a bundle name or a bundle identifier) and a name of the resource.
Declaration
Swift
public init?(bundle bundleDescription: String?, name: String)Parameters
bundleDescriptionBundle name or bundle identifier. If
nilBundle.mainwill be used.nameName of the resource.
Return Value
nilif cannot find a bundle with given name or identifier.
-
Parse resource from string.
String representation is made of a bundle name (or a bundle identifier) and a resource name separated with colon. Bundle name can be a
nilstring then theBundle.mainwill be used.Example:
Test data:events nil:contactsDeclaration
Swift
public static func resource(from resourceString: String) -> LaunchEnvironmentResource?Parameters
resourceStringString representation of the resource.
Return Value
nilif cannot find a bundle with given name or identifier. -
Parse resources from string.
String representation is made of
resource representation
separated by comma. In addition, theCleanFlagcan be used as first element.Resource representation: is made of a bundle name (or a bundle identifier) and a resource name separated with colon. Bundle name can be a
nilstring then theBundle.mainwill be used.Example:
Test data:events,nil:contacts AM_CLEAN_DATA_FLAG,Test data:events,nil:contactsDeclaration
Swift
public static func resources(from resourcesString: String) -> ([LaunchEnvironmentResource], Bool)Parameters
resourcesStringString representation of the resources.
Return Value
List of resources and
cleanflag.
LaunchEnvironmentResource Structure Reference