You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: surface.rs
    path of file: ./repos/vulkano/vulkano/src/swapchain
    
    the code of the file until where you have to start completion: use super::{FullScreenExclusive, PresentGravityFlags, PresentScalingFlags, Win32Monitor};
use crate::{
    cache::OnceCache,
    device::physical::PhysicalDevice,
    display::{DisplayMode, DisplayPlaneAlpha},
    format::Format,
    image::ImageUsage,
    instance::{Instance, InstanceExtensions, InstanceOwned},
    macros::{impl_id_counter, vulkan_bitflags_enum, vulkan_enum},
    DebugWrapper, Requires, RequiresAllOf, RequiresOneOf, Validated, ValidationError, VulkanError,
    VulkanObject,
};
#[cfg(any(target_os = "macos", target_os = "ios"))]
use objc::{class, 
    
unsafe fn get_metal_layer_ios(ui_view: *mut c_void) -> IOSMetalLayer {
    use core_graphics_types::{base::CGFloat, geometry::CGRect};

    let view: *mut Object = ui_view.cast();
    let main_layer: *mut Object = msg_send![view, layer];
    let class = class!(CAMetalLayer);
    let new_layer: *mut Object = msg_send![class, new];
    let frame: CGRect = msg_send![main_layer, bounds];
    let () = msg_send![new_layer, setFrame: frame];
    let () = msg_send![main_layer, addSublayer: new_layer];
    let screen: *mut Object = msg_send![class!(UIScreen), mainScreen];
    let scale_factor: CGFloat = msg_send![screen, nativeScale];
    let () = msg_send![view, setContentScaleFactor: scale_factor];
    IOSMetalLayer::new(view, new_layer)
}