diff --git a/src/lib.rs b/src/lib.rs index 4cc5afe..fb8e5e0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,6 +2,7 @@ unix, not(any( target_os = "macos", + target_os = "ios", target_os = "android", target_os = "emscripten" )) @@ -12,6 +13,7 @@ mod platform; #[cfg(not(all( unix, not(any( + target_os = "ios", target_os = "macos", target_os = "android", target_os = "emscripten" diff --git a/src/platform/not_linux.rs b/src/platform/not_linux.rs index eb5d15d..fd3d627 100644 --- a/src/platform/not_linux.rs +++ b/src/platform/not_linux.rs @@ -15,6 +15,11 @@ pub fn new_clipboard( { Ok(Box::new(clipboard_macos::Clipboard::new()?)) } + + #[cfg(target_os = "ios")] + { + Ok(Box::new(clipboard_ios::Clipboard::new()?)) + } } #[cfg(target_os = "windows")] @@ -30,3 +35,22 @@ impl ClipboardProvider for clipboard_macos::Clipboard { self.read() } } + + +#[cfg(target_os = "ios")] +mod clipboard_ios { + use std::error::Error; + pub struct Clipboard; + impl Clipboard { + pub fn new() -> Result> { + Ok(Self) + } + } +} + +#[cfg(target_os = "ios")] +impl ClipboardProvider for clipboard_ios::Clipboard { + fn read(&self) -> Result> { + unimplemented!(); + } +}