# FlutterPlatformViewFactory

Objective-C

    @protocol FlutterPlatformViewFactory <NSObject>
    /**
     * Create a `FlutterPlatformView`.
     *
     * Implemented by iOS code that expose a `UIView` for embedding in a Flutter app.
     *
     * The implementation of this method should create a new `UIView` and return it.
     *
     * @param frame The rectangle for the newly created `UIView` measured in points.
     * @param viewId A unique identifier for this `UIView`.
     * @param args Parameters for creating the `UIView` sent from the Dart side of the Flutter app.
     *   If `createArgsCodec` is not implemented, or if no creation arguments were sent from the Dart
     *   code, this will be null. Otherwise this will be the value sent from the Dart code as decoded by
     *   `createArgsCodec`.
     */
    - (NSObject<FlutterPlatformView>*)createWithFrame:(CGRect)frame
                                       viewIdentifier:(int64_t)viewId
                                            arguments:(id _Nullable)args;

    /**
     * Returns the `FlutterMessageCodec` for decoding the args parameter of `createWithFrame`.
     *
     * Only needs to be implemented if `createWithFrame` needs an arguments parameter.
     */
    @optional
    - (NSObject<FlutterMessageCodec>*)createArgsCodec;
    @end

Swift

    protocol FlutterPlatformViewFactory : NSObjectProtocol

Undocumented

- `-createWithFrame:viewIdentifier:arguments:`

  Create a `FlutterPlatformView`.

  Implemented by iOS code that expose a `UIView` for embedding in a Flutter app.

  The implementation of this method should create a new `UIView` and return it.

  #### Declaration

  Objective-C

      - (nonnull NSObject<FlutterPlatformView> *)createWithFrame:(CGRect)frame
                                                  viewIdentifier:(int64_t)viewId
                                                       arguments:(id _Nullable)args;

  Swift

      func create(withFrame frame: CGRect, viewIdentifier viewId: Int64, arguments args: Any?) -> FlutterPlatformView

  #### Parameters

  `frame` | The rectangle for the newly created `UIView` measured in points.
  `viewId` | A unique identifier for this `UIView`.
  `args` | Parameters for creating the `UIView` sent from the Dart side of the Flutter app. If `createArgsCodec` is not implemented, or if no creation arguments were sent from the Dart code, this will be null. Otherwise this will be the value sent from the Dart code as decoded by `createArgsCodec`.

- `-createArgsCodec`

  Undocumented

  #### Declaration

  Objective-C

      - (NSObject<FlutterMessageCodec>*)createArgsCodec;

  Swift

      optional func createArgsCodec() -> FlutterMessageCodec & NSObjectProtocol

© 2023 Flutter. All rights reserved. (Last updated: 2023-02-08)

Generated by jazzy ♪♫ v0.14.3, a Realm project.