Skip to content

Commit 89fd7ef

Browse files
authored
Edit iOS plugin documentation updates
1 parent efc0a86 commit 89fd7ef

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

tutorials/platform/ios/ios_plugin.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ When a plugin is active, you can access it in your using ``Engine.get_singleton(
2929
Creating an iOS plugin
3030
----------------------
3131

32-
At its core, a Godot iOS plugin is an iOS library (*.a* archive file or *.xcframework* that contains static libraries) with the following requirements:
32+
At its core, a Godot iOS plugin is an iOS library (*.a* archive file or *.xcframework* containing static libraries) with the following requirements:
3333

3434
- The library must have a dependency on the Godot engine headers.
3535

@@ -58,9 +58,9 @@ To build an iOS plugin:
5858

5959
3. In the ``Build Settings`` tab, specify the compilation flags for your static library in ``OTHER_CFLAGS``. The most important ones are ``-fcxx-modules``, ``-fmodules``, and ``-DDEBUG`` if you need debug support. Other flags should be the same you use to compile Godot. For instance, ``-DPTRCALL_ENABLED -DDEBUG_ENABLED, -DDEBUG_MEMORY_ALLOC -DDISABLE_FORCED_INLINE -DTYPED_METHOD_BIND``.
6060

61-
4. Add the required logic for your plugin and build your library to generate a ``.a`` file. You will probably need to build both ``debug`` and ``release`` targeted ``.a`` files. Depending on your need, pick only one or both. If you need both ``.a`` files their name should match following pattern: ``[PluginName].[TargetType].a``. You can also build the static library with your SCons configuration.
61+
4. Add the required logic for your plugin and build your library to generate a ``.a`` file. You will probably need to build both ``debug`` and ``release`` target ``.a`` files. Depending on your needs, pick either or both. If you need both debug and release ``.a`` files, their name should match following pattern: ``[PluginName].[TargetType].a``. You can also build the static library with your SCons configuration.
6262

63-
5. iOS plugin system also support ``.xcframework`` files. To generate one you can use a command such as: ``xcodebuild -create-xcframework -library [DeviceLibrary].a -library [SimulatorLibrary].a -output [PluginName].xcframework``.
63+
5. The iOS plugin system also supports ``.xcframework`` files. To generate one, you can use a command such as: ``xcodebuild -create-xcframework -library [DeviceLibrary].a -library [SimulatorLibrary].a -output [PluginName].xcframework``.
6464

6565
6. Create a Godot iOS Plugin configuration file to help the system detect and load your plugin:
6666

@@ -95,10 +95,10 @@ To build an iOS plugin:
9595

9696
- **binary**: this should be the filepath of the plugin library (``a`` or ``xcframework``) file.
9797

98-
- The filepath can be relative (e.g.: ``MyPlugin.a``, ``MyPlugin.xcframework``) in which case it's relative to the directory where ``gdip`` file is located.
98+
- The filepath can be relative (e.g.: ``MyPlugin.a``, ``MyPlugin.xcframework``) in which case it's relative to the directory where the ``gdip`` file is located.
9999
- The filepath can be absolute: ``res://some_path/MyPlugin.a`` or ``res://some_path/MyPlugin.xcframework``.
100-
- In case you need multitarget library usage, filename should be ``MyPlugin.a`` and ``a`` files should be named as ``MyPlugin.release.a`` and ``MyPlugin.debug.a``.
101-
- In case of using multitarget ``xcframework`` libraries filename in configuration should be ``MyPlugin.xcframework`` and ``xcframework`` files should be named as ``MyPlugin.release.xcframework`` and ``MyPlugin.debug.xcframework``.
100+
- In case you need multitarget library usage, the filename should be ``MyPlugin.a`` and ``.a`` files should be named as ``MyPlugin.release.a`` and ``MyPlugin.debug.a``.
101+
- In case you use multitarget ``xcframework`` libraries, their filename in the configuration should be ``MyPlugin.xcframework``. The ``.xcframework`` files should be named as ``MyPlugin.release.xcframework`` and ``MyPlugin.debug.xcframework``.
102102

103103
The ``dependencies`` and ``plist`` sections are optional and defined as follow:
104104

@@ -114,6 +114,6 @@ To build an iOS plugin:
114114

115115
- **files**: contains a list of files that should be copied on export. This is useful for data files or images.
116116

117-
- **linker_flags**: containts a list of linker flags that should be added to the Xcode project if plugin is exported.
117+
- **linker_flags**: contains a list of linker flags to add to the Xcode project when exporting the plugin.
118118

119119
- **plist**: should have keys and values that should be present in ``Info.plist`` file following pattern: ``KeyName="key value"``

tutorials/platform/ios/plugins_for_ios.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ ARKit and Camera access are also provided as plugins.
1111
Accessing plugin singletons
1212
---------------------------
1313

14-
To access plugin functionality it's first required to use check if plugin
15-
is exported and available with `Engine.has_singleton` function. After
16-
that calling a `Engine.get_singleton` will return a singleton. This
17-
is an example of how this can be done:
14+
To access plugin functionality, you first need to check that the plugin is
15+
exported and available by calling the `Engine.has_singleton()` function, which
16+
returns a registered singleton.
17+
18+
Here's an example of how to do this in GDScript:
1819

1920
::
2021

@@ -24,7 +25,6 @@ is an example of how this can be done:
2425
if Engine.has_singleton("InAppStore"):
2526
in_app_store = Engine.get_singleton("InAppStore")
2627
27-
# Plugin setup
2828
else:
2929
print("iOS IAP plugin is not exported.")
3030

0 commit comments

Comments
 (0)