diff --git a/readme.md b/readme.md index 3afcc635..b01882f8 100644 --- a/readme.md +++ b/readme.md @@ -97,18 +97,10 @@ var text = TextCopy.Clipboard.GetText(); * Linux with .NET Core 2.0 and up * Linux with Mono 5.20.1 and up * Xamarin.Android 9.0 and up + * Xamarin.iOS 10.0 and up * Universal Windows Platform version 10.0.16299 and up -### Not verified - -The following may work but have not been verified: - - * Xamarin.iOS - -If anyone verifies this, please submit a [Pull Request](https://help.github.com/articles/about-pull-requests/) to the readme with the outcome. - - ### Not supported * Xamarin.Mac Full, .NET Framework 4.7.2 diff --git a/readme.source.md b/readme.source.md index 670b20e3..e7c5a7a4 100644 --- a/readme.source.md +++ b/readme.source.md @@ -53,18 +53,10 @@ snippet: GetText * Linux with .NET Core 2.0 and up * Linux with Mono 5.20.1 and up * Xamarin.Android 9.0 and up + * Xamarin.iOS 10.0 and up * Universal Windows Platform version 10.0.16299 and up -### Not verified - -The following may work but have not been verified: - - * Xamarin.iOS - -If anyone verifies this, please submit a [Pull Request](https://help.github.com/articles/about-pull-requests/) to the readme with the outcome. - - ### Not supported * Xamarin.Mac Full, .NET Framework 4.7.2 diff --git a/src/TextCopy.sln b/src/TextCopy.sln index a2bb3b07..151b32af 100644 --- a/src/TextCopy.sln +++ b/src/TextCopy.sln @@ -25,16 +25,22 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AndroidApp", "AndroidApp\An EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Weavers", "Weavers\Weavers.csproj", "{7E80FA1F-BA79-4AE2-8E49-7334BE790815}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "iOSApp", "iOSApp\iOSApp.csproj", "{EAB4EF13-D4DE-4544-92B6-C1467683FA0B}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Debug|ARM = Debug|ARM Debug|ARM64 = Debug|ARM64 + Debug|iPhone = Debug|iPhone + Debug|iPhoneSimulator = Debug|iPhoneSimulator Debug|x64 = Debug|x64 Debug|x86 = Debug|x86 Release|Any CPU = Release|Any CPU Release|ARM = Release|ARM Release|ARM64 = Release|ARM64 + Release|iPhone = Release|iPhone + Release|iPhoneSimulator = Release|iPhoneSimulator Release|x64 = Release|x64 Release|x86 = Release|x86 EndGlobalSection @@ -45,6 +51,10 @@ Global {92E64F4E-6A8E-43C2-9C8D-694E0327BEF0}.Debug|ARM.Build.0 = Debug|Any CPU {92E64F4E-6A8E-43C2-9C8D-694E0327BEF0}.Debug|ARM64.ActiveCfg = Debug|Any CPU {92E64F4E-6A8E-43C2-9C8D-694E0327BEF0}.Debug|ARM64.Build.0 = Debug|Any CPU + {92E64F4E-6A8E-43C2-9C8D-694E0327BEF0}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {92E64F4E-6A8E-43C2-9C8D-694E0327BEF0}.Debug|iPhone.Build.0 = Debug|Any CPU + {92E64F4E-6A8E-43C2-9C8D-694E0327BEF0}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {92E64F4E-6A8E-43C2-9C8D-694E0327BEF0}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU {92E64F4E-6A8E-43C2-9C8D-694E0327BEF0}.Debug|x64.ActiveCfg = Debug|Any CPU {92E64F4E-6A8E-43C2-9C8D-694E0327BEF0}.Debug|x64.Build.0 = Debug|Any CPU {92E64F4E-6A8E-43C2-9C8D-694E0327BEF0}.Debug|x86.ActiveCfg = Debug|Any CPU @@ -55,6 +65,10 @@ Global {92E64F4E-6A8E-43C2-9C8D-694E0327BEF0}.Release|ARM.Build.0 = Release|Any CPU {92E64F4E-6A8E-43C2-9C8D-694E0327BEF0}.Release|ARM64.ActiveCfg = Release|Any CPU {92E64F4E-6A8E-43C2-9C8D-694E0327BEF0}.Release|ARM64.Build.0 = Release|Any CPU + {92E64F4E-6A8E-43C2-9C8D-694E0327BEF0}.Release|iPhone.ActiveCfg = Release|Any CPU + {92E64F4E-6A8E-43C2-9C8D-694E0327BEF0}.Release|iPhone.Build.0 = Release|Any CPU + {92E64F4E-6A8E-43C2-9C8D-694E0327BEF0}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {92E64F4E-6A8E-43C2-9C8D-694E0327BEF0}.Release|iPhoneSimulator.Build.0 = Release|Any CPU {92E64F4E-6A8E-43C2-9C8D-694E0327BEF0}.Release|x64.ActiveCfg = Release|Any CPU {92E64F4E-6A8E-43C2-9C8D-694E0327BEF0}.Release|x64.Build.0 = Release|Any CPU {92E64F4E-6A8E-43C2-9C8D-694E0327BEF0}.Release|x86.ActiveCfg = Release|Any CPU @@ -65,6 +79,8 @@ Global {87DB4CC0-4AC3-4AC1-97FD-7C55D3B921D9}.Debug|ARM.Build.0 = Debug|Any CPU {87DB4CC0-4AC3-4AC1-97FD-7C55D3B921D9}.Debug|ARM64.ActiveCfg = Debug|Any CPU {87DB4CC0-4AC3-4AC1-97FD-7C55D3B921D9}.Debug|ARM64.Build.0 = Debug|Any CPU + {87DB4CC0-4AC3-4AC1-97FD-7C55D3B921D9}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {87DB4CC0-4AC3-4AC1-97FD-7C55D3B921D9}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU {87DB4CC0-4AC3-4AC1-97FD-7C55D3B921D9}.Debug|x64.ActiveCfg = Debug|Any CPU {87DB4CC0-4AC3-4AC1-97FD-7C55D3B921D9}.Debug|x64.Build.0 = Debug|Any CPU {87DB4CC0-4AC3-4AC1-97FD-7C55D3B921D9}.Debug|x86.ActiveCfg = Debug|Any CPU @@ -75,6 +91,8 @@ Global {87DB4CC0-4AC3-4AC1-97FD-7C55D3B921D9}.Release|ARM.Build.0 = Release|Any CPU {87DB4CC0-4AC3-4AC1-97FD-7C55D3B921D9}.Release|ARM64.ActiveCfg = Release|Any CPU {87DB4CC0-4AC3-4AC1-97FD-7C55D3B921D9}.Release|ARM64.Build.0 = Release|Any CPU + {87DB4CC0-4AC3-4AC1-97FD-7C55D3B921D9}.Release|iPhone.ActiveCfg = Release|Any CPU + {87DB4CC0-4AC3-4AC1-97FD-7C55D3B921D9}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU {87DB4CC0-4AC3-4AC1-97FD-7C55D3B921D9}.Release|x64.ActiveCfg = Release|Any CPU {87DB4CC0-4AC3-4AC1-97FD-7C55D3B921D9}.Release|x64.Build.0 = Release|Any CPU {87DB4CC0-4AC3-4AC1-97FD-7C55D3B921D9}.Release|x86.ActiveCfg = Release|Any CPU @@ -85,6 +103,8 @@ Global {01C65189-BBE7-40B6-8D11-57CEF7ECD5BC}.Debug|ARM.Build.0 = Debug|Any CPU {01C65189-BBE7-40B6-8D11-57CEF7ECD5BC}.Debug|ARM64.ActiveCfg = Debug|Any CPU {01C65189-BBE7-40B6-8D11-57CEF7ECD5BC}.Debug|ARM64.Build.0 = Debug|Any CPU + {01C65189-BBE7-40B6-8D11-57CEF7ECD5BC}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {01C65189-BBE7-40B6-8D11-57CEF7ECD5BC}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU {01C65189-BBE7-40B6-8D11-57CEF7ECD5BC}.Debug|x64.ActiveCfg = Debug|Any CPU {01C65189-BBE7-40B6-8D11-57CEF7ECD5BC}.Debug|x64.Build.0 = Debug|Any CPU {01C65189-BBE7-40B6-8D11-57CEF7ECD5BC}.Debug|x86.ActiveCfg = Debug|Any CPU @@ -95,6 +115,8 @@ Global {01C65189-BBE7-40B6-8D11-57CEF7ECD5BC}.Release|ARM.Build.0 = Release|Any CPU {01C65189-BBE7-40B6-8D11-57CEF7ECD5BC}.Release|ARM64.ActiveCfg = Release|Any CPU {01C65189-BBE7-40B6-8D11-57CEF7ECD5BC}.Release|ARM64.Build.0 = Release|Any CPU + {01C65189-BBE7-40B6-8D11-57CEF7ECD5BC}.Release|iPhone.ActiveCfg = Release|Any CPU + {01C65189-BBE7-40B6-8D11-57CEF7ECD5BC}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU {01C65189-BBE7-40B6-8D11-57CEF7ECD5BC}.Release|x64.ActiveCfg = Release|Any CPU {01C65189-BBE7-40B6-8D11-57CEF7ECD5BC}.Release|x64.Build.0 = Release|Any CPU {01C65189-BBE7-40B6-8D11-57CEF7ECD5BC}.Release|x86.ActiveCfg = Release|Any CPU @@ -108,6 +130,8 @@ Global {2E246AC3-7005-4558-9088-B876DA5FF803}.Debug|ARM64.ActiveCfg = Debug|ARM64 {2E246AC3-7005-4558-9088-B876DA5FF803}.Debug|ARM64.Build.0 = Debug|ARM64 {2E246AC3-7005-4558-9088-B876DA5FF803}.Debug|ARM64.Deploy.0 = Debug|ARM64 + {2E246AC3-7005-4558-9088-B876DA5FF803}.Debug|iPhone.ActiveCfg = Debug|x86 + {2E246AC3-7005-4558-9088-B876DA5FF803}.Debug|iPhoneSimulator.ActiveCfg = Debug|x86 {2E246AC3-7005-4558-9088-B876DA5FF803}.Debug|x64.ActiveCfg = Debug|x64 {2E246AC3-7005-4558-9088-B876DA5FF803}.Debug|x64.Build.0 = Debug|x64 {2E246AC3-7005-4558-9088-B876DA5FF803}.Debug|x64.Deploy.0 = Debug|x64 @@ -121,6 +145,8 @@ Global {2E246AC3-7005-4558-9088-B876DA5FF803}.Release|ARM64.ActiveCfg = Release|ARM64 {2E246AC3-7005-4558-9088-B876DA5FF803}.Release|ARM64.Build.0 = Release|ARM64 {2E246AC3-7005-4558-9088-B876DA5FF803}.Release|ARM64.Deploy.0 = Release|ARM64 + {2E246AC3-7005-4558-9088-B876DA5FF803}.Release|iPhone.ActiveCfg = Release|x86 + {2E246AC3-7005-4558-9088-B876DA5FF803}.Release|iPhoneSimulator.ActiveCfg = Release|x86 {2E246AC3-7005-4558-9088-B876DA5FF803}.Release|x64.ActiveCfg = Release|x64 {2E246AC3-7005-4558-9088-B876DA5FF803}.Release|x64.Build.0 = Release|x64 {2E246AC3-7005-4558-9088-B876DA5FF803}.Release|x64.Deploy.0 = Release|x64 @@ -136,6 +162,12 @@ Global {2B499E73-CF11-4333-B9DC-691AF5B73D5C}.Debug|ARM64.ActiveCfg = Debug|Any CPU {2B499E73-CF11-4333-B9DC-691AF5B73D5C}.Debug|ARM64.Build.0 = Debug|Any CPU {2B499E73-CF11-4333-B9DC-691AF5B73D5C}.Debug|ARM64.Deploy.0 = Debug|Any CPU + {2B499E73-CF11-4333-B9DC-691AF5B73D5C}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {2B499E73-CF11-4333-B9DC-691AF5B73D5C}.Debug|iPhone.Build.0 = Debug|Any CPU + {2B499E73-CF11-4333-B9DC-691AF5B73D5C}.Debug|iPhone.Deploy.0 = Debug|Any CPU + {2B499E73-CF11-4333-B9DC-691AF5B73D5C}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {2B499E73-CF11-4333-B9DC-691AF5B73D5C}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {2B499E73-CF11-4333-B9DC-691AF5B73D5C}.Debug|iPhoneSimulator.Deploy.0 = Debug|Any CPU {2B499E73-CF11-4333-B9DC-691AF5B73D5C}.Debug|x64.ActiveCfg = Debug|Any CPU {2B499E73-CF11-4333-B9DC-691AF5B73D5C}.Debug|x64.Build.0 = Debug|Any CPU {2B499E73-CF11-4333-B9DC-691AF5B73D5C}.Debug|x64.Deploy.0 = Debug|Any CPU @@ -149,6 +181,12 @@ Global {2B499E73-CF11-4333-B9DC-691AF5B73D5C}.Release|ARM64.ActiveCfg = Debug|Any CPU {2B499E73-CF11-4333-B9DC-691AF5B73D5C}.Release|ARM64.Build.0 = Debug|Any CPU {2B499E73-CF11-4333-B9DC-691AF5B73D5C}.Release|ARM64.Deploy.0 = Debug|Any CPU + {2B499E73-CF11-4333-B9DC-691AF5B73D5C}.Release|iPhone.ActiveCfg = Debug|Any CPU + {2B499E73-CF11-4333-B9DC-691AF5B73D5C}.Release|iPhone.Build.0 = Debug|Any CPU + {2B499E73-CF11-4333-B9DC-691AF5B73D5C}.Release|iPhone.Deploy.0 = Debug|Any CPU + {2B499E73-CF11-4333-B9DC-691AF5B73D5C}.Release|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {2B499E73-CF11-4333-B9DC-691AF5B73D5C}.Release|iPhoneSimulator.Build.0 = Debug|Any CPU + {2B499E73-CF11-4333-B9DC-691AF5B73D5C}.Release|iPhoneSimulator.Deploy.0 = Debug|Any CPU {2B499E73-CF11-4333-B9DC-691AF5B73D5C}.Release|x64.ActiveCfg = Debug|Any CPU {2B499E73-CF11-4333-B9DC-691AF5B73D5C}.Release|x64.Build.0 = Debug|Any CPU {2B499E73-CF11-4333-B9DC-691AF5B73D5C}.Release|x64.Deploy.0 = Debug|Any CPU @@ -161,6 +199,10 @@ Global {7E80FA1F-BA79-4AE2-8E49-7334BE790815}.Debug|ARM.Build.0 = Debug|Any CPU {7E80FA1F-BA79-4AE2-8E49-7334BE790815}.Debug|ARM64.ActiveCfg = Debug|Any CPU {7E80FA1F-BA79-4AE2-8E49-7334BE790815}.Debug|ARM64.Build.0 = Debug|Any CPU + {7E80FA1F-BA79-4AE2-8E49-7334BE790815}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {7E80FA1F-BA79-4AE2-8E49-7334BE790815}.Debug|iPhone.Build.0 = Debug|Any CPU + {7E80FA1F-BA79-4AE2-8E49-7334BE790815}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {7E80FA1F-BA79-4AE2-8E49-7334BE790815}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU {7E80FA1F-BA79-4AE2-8E49-7334BE790815}.Debug|x64.ActiveCfg = Debug|Any CPU {7E80FA1F-BA79-4AE2-8E49-7334BE790815}.Debug|x64.Build.0 = Debug|Any CPU {7E80FA1F-BA79-4AE2-8E49-7334BE790815}.Debug|x86.ActiveCfg = Debug|Any CPU @@ -171,10 +213,32 @@ Global {7E80FA1F-BA79-4AE2-8E49-7334BE790815}.Release|ARM.Build.0 = Release|Any CPU {7E80FA1F-BA79-4AE2-8E49-7334BE790815}.Release|ARM64.ActiveCfg = Release|Any CPU {7E80FA1F-BA79-4AE2-8E49-7334BE790815}.Release|ARM64.Build.0 = Release|Any CPU + {7E80FA1F-BA79-4AE2-8E49-7334BE790815}.Release|iPhone.ActiveCfg = Release|Any CPU + {7E80FA1F-BA79-4AE2-8E49-7334BE790815}.Release|iPhone.Build.0 = Release|Any CPU + {7E80FA1F-BA79-4AE2-8E49-7334BE790815}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {7E80FA1F-BA79-4AE2-8E49-7334BE790815}.Release|iPhoneSimulator.Build.0 = Release|Any CPU {7E80FA1F-BA79-4AE2-8E49-7334BE790815}.Release|x64.ActiveCfg = Release|Any CPU {7E80FA1F-BA79-4AE2-8E49-7334BE790815}.Release|x64.Build.0 = Release|Any CPU {7E80FA1F-BA79-4AE2-8E49-7334BE790815}.Release|x86.ActiveCfg = Release|Any CPU {7E80FA1F-BA79-4AE2-8E49-7334BE790815}.Release|x86.Build.0 = Release|Any CPU + {EAB4EF13-D4DE-4544-92B6-C1467683FA0B}.Debug|Any CPU.ActiveCfg = Debug|iPhone + {EAB4EF13-D4DE-4544-92B6-C1467683FA0B}.Debug|ARM.ActiveCfg = Debug|iPhone + {EAB4EF13-D4DE-4544-92B6-C1467683FA0B}.Debug|ARM64.ActiveCfg = Debug|iPhone + {EAB4EF13-D4DE-4544-92B6-C1467683FA0B}.Debug|iPhone.ActiveCfg = Debug|iPhone + {EAB4EF13-D4DE-4544-92B6-C1467683FA0B}.Debug|iPhone.Build.0 = Debug|iPhone + {EAB4EF13-D4DE-4544-92B6-C1467683FA0B}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator + {EAB4EF13-D4DE-4544-92B6-C1467683FA0B}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator + {EAB4EF13-D4DE-4544-92B6-C1467683FA0B}.Debug|x64.ActiveCfg = Debug|iPhone + {EAB4EF13-D4DE-4544-92B6-C1467683FA0B}.Debug|x86.ActiveCfg = Debug|iPhone + {EAB4EF13-D4DE-4544-92B6-C1467683FA0B}.Release|Any CPU.ActiveCfg = Release|iPhone + {EAB4EF13-D4DE-4544-92B6-C1467683FA0B}.Release|ARM.ActiveCfg = Release|iPhone + {EAB4EF13-D4DE-4544-92B6-C1467683FA0B}.Release|ARM64.ActiveCfg = Release|iPhone + {EAB4EF13-D4DE-4544-92B6-C1467683FA0B}.Release|iPhone.ActiveCfg = Release|iPhone + {EAB4EF13-D4DE-4544-92B6-C1467683FA0B}.Release|iPhone.Build.0 = Release|iPhone + {EAB4EF13-D4DE-4544-92B6-C1467683FA0B}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator + {EAB4EF13-D4DE-4544-92B6-C1467683FA0B}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator + {EAB4EF13-D4DE-4544-92B6-C1467683FA0B}.Release|x64.ActiveCfg = Release|iPhone + {EAB4EF13-D4DE-4544-92B6-C1467683FA0B}.Release|x86.ActiveCfg = Release|iPhone EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/TextCopy/Clipboard_GetiOS.cs b/src/TextCopy/Clipboard_GetiOS.cs new file mode 100644 index 00000000..1b9acaf2 --- /dev/null +++ b/src/TextCopy/Clipboard_GetiOS.cs @@ -0,0 +1,27 @@ +#if IOS +using System; +using System.Threading.Tasks; +using System.Threading; +using UIKit; + +namespace TextCopy +{ + public static partial class Clipboard + { + static Func> CreateAsyncGet() + { + return token => Task.FromResult(GetTextiOS()); + } + + static Func CreateGet() + { + return GetTextiOS; + } + + static string? GetTextiOS() + { + return UIPasteboard.General.String; + } + } +} +#endif \ No newline at end of file diff --git a/src/TextCopy/Clipboard_SetiOS.cs b/src/TextCopy/Clipboard_SetiOS.cs new file mode 100644 index 00000000..7e98d001 --- /dev/null +++ b/src/TextCopy/Clipboard_SetiOS.cs @@ -0,0 +1,31 @@ +#if IOS +using System; +using System.Threading; +using System.Threading.Tasks; +using UIKit; + +namespace TextCopy +{ + public static partial class Clipboard + { + static Func CreateAsyncSet() + { + return (text, cancellation) => + { + SetTextiOS(text); + return Task.CompletedTask; + }; + } + + static Action CreateSet() + { + return SetTextiOS; + } + + static void SetTextiOS(string text) + { + UIPasteboard.General.String = text; + } + } +} +#endif \ No newline at end of file diff --git a/src/TextCopy/TextCopy.csproj b/src/TextCopy/TextCopy.csproj index 1ac05a11..174de301 100644 --- a/src/TextCopy/TextCopy.csproj +++ b/src/TextCopy/TextCopy.csproj @@ -1,6 +1,6 @@  - net461;netstandard2.0;netstandard2.1;uap10.0;monoandroid9.0 + net461;netstandard2.0;netstandard2.1;uap10.0;monoandroid9.0;xamarin.ios10 $(DefineConstants);UAP @@ -8,6 +8,9 @@ $(DefineConstants);ANDROID + + $(DefineConstants);IOS + diff --git a/src/iOSApp/AppDelegate.cs b/src/iOSApp/AppDelegate.cs new file mode 100644 index 00000000..1ba85d35 --- /dev/null +++ b/src/iOSApp/AppDelegate.cs @@ -0,0 +1,41 @@ +using Foundation; +using UIKit; + +namespace iOSApp +{ + // The UIApplicationDelegate for the application. This class is responsible for launching the + // User Interface of the application, as well as listening (and optionally responding) to application events from iOS. + [Register ("AppDelegate")] + public class AppDelegate : UIResponder, IUIApplicationDelegate { + + [Export("window")] + public UIWindow Window { get; set; } + + [Export ("application:didFinishLaunchingWithOptions:")] + public bool FinishedLaunching (UIApplication application, NSDictionary launchOptions) + { + // Override point for customization after application launch. + // If not required for your application you can safely delete this method + return true; + } + + // UISceneSession Lifecycle + + [Export ("application:configurationForConnectingSceneSession:options:")] + public UISceneConfiguration GetConfiguration (UIApplication application, UISceneSession connectingSceneSession, UISceneConnectionOptions options) + { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return UISceneConfiguration.Create ("Default Configuration", connectingSceneSession.Role); + } + + [Export ("application:didDiscardSceneSessions:")] + public void DidDiscardSceneSessions (UIApplication application, NSSet sceneSessions) + { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after `FinishedLaunching`. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. + } + } +} + diff --git a/src/iOSApp/Assets.xcassets/AppIcon.appiconset/Contents.json b/src/iOSApp/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..98f4d035 --- /dev/null +++ b/src/iOSApp/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,117 @@ +{ + "images": [ + { + "scale": "2x", + "size": "20x20", + "idiom": "iphone", + "filename": "Icon40.png" + }, + { + "scale": "3x", + "size": "20x20", + "idiom": "iphone", + "filename": "Icon60.png" + }, + { + "scale": "2x", + "size": "29x29", + "idiom": "iphone", + "filename": "Icon58.png" + }, + { + "scale": "3x", + "size": "29x29", + "idiom": "iphone", + "filename": "Icon87.png" + }, + { + "scale": "2x", + "size": "40x40", + "idiom": "iphone", + "filename": "Icon80.png" + }, + { + "scale": "3x", + "size": "40x40", + "idiom": "iphone", + "filename": "Icon120.png" + }, + { + "scale": "2x", + "size": "60x60", + "idiom": "iphone", + "filename": "Icon120.png" + }, + { + "scale": "3x", + "size": "60x60", + "idiom": "iphone", + "filename": "Icon180.png" + }, + { + "scale": "1x", + "size": "20x20", + "idiom": "ipad", + "filename": "Icon20.png" + }, + { + "scale": "2x", + "size": "20x20", + "idiom": "ipad", + "filename": "Icon40.png" + }, + { + "scale": "1x", + "size": "29x29", + "idiom": "ipad", + "filename": "Icon29.png" + }, + { + "scale": "2x", + "size": "29x29", + "idiom": "ipad", + "filename": "Icon58.png" + }, + { + "scale": "1x", + "size": "40x40", + "idiom": "ipad", + "filename": "Icon40.png" + }, + { + "scale": "2x", + "size": "40x40", + "idiom": "ipad", + "filename": "Icon80.png" + }, + { + "scale": "1x", + "size": "76x76", + "idiom": "ipad", + "filename": "Icon76.png" + }, + { + "scale": "2x", + "size": "76x76", + "idiom": "ipad", + "filename": "Icon152.png" + }, + { + "scale": "2x", + "size": "83.5x83.5", + "idiom": "ipad", + "filename": "Icon167.png" + }, + { + "scale": "1x", + "size": "1024x1024", + "idiom": "ios-marketing", + "filename": "Icon1024.png" + } + ], + "properties": {}, + "info": { + "version": 1, + "author": "xcode" + } +} \ No newline at end of file diff --git a/src/iOSApp/Assets.xcassets/AppIcon.appiconset/Icon1024.png b/src/iOSApp/Assets.xcassets/AppIcon.appiconset/Icon1024.png new file mode 100644 index 00000000..9174c989 Binary files /dev/null and b/src/iOSApp/Assets.xcassets/AppIcon.appiconset/Icon1024.png differ diff --git a/src/iOSApp/Assets.xcassets/AppIcon.appiconset/Icon120.png b/src/iOSApp/Assets.xcassets/AppIcon.appiconset/Icon120.png new file mode 100644 index 00000000..9c60a176 Binary files /dev/null and b/src/iOSApp/Assets.xcassets/AppIcon.appiconset/Icon120.png differ diff --git a/src/iOSApp/Assets.xcassets/AppIcon.appiconset/Icon152.png b/src/iOSApp/Assets.xcassets/AppIcon.appiconset/Icon152.png new file mode 100644 index 00000000..448d6efb Binary files /dev/null and b/src/iOSApp/Assets.xcassets/AppIcon.appiconset/Icon152.png differ diff --git a/src/iOSApp/Assets.xcassets/AppIcon.appiconset/Icon167.png b/src/iOSApp/Assets.xcassets/AppIcon.appiconset/Icon167.png new file mode 100644 index 00000000..8524768f Binary files /dev/null and b/src/iOSApp/Assets.xcassets/AppIcon.appiconset/Icon167.png differ diff --git a/src/iOSApp/Assets.xcassets/AppIcon.appiconset/Icon180.png b/src/iOSApp/Assets.xcassets/AppIcon.appiconset/Icon180.png new file mode 100644 index 00000000..60a64703 Binary files /dev/null and b/src/iOSApp/Assets.xcassets/AppIcon.appiconset/Icon180.png differ diff --git a/src/iOSApp/Assets.xcassets/AppIcon.appiconset/Icon20.png b/src/iOSApp/Assets.xcassets/AppIcon.appiconset/Icon20.png new file mode 100644 index 00000000..45268a64 Binary files /dev/null and b/src/iOSApp/Assets.xcassets/AppIcon.appiconset/Icon20.png differ diff --git a/src/iOSApp/Assets.xcassets/AppIcon.appiconset/Icon29.png b/src/iOSApp/Assets.xcassets/AppIcon.appiconset/Icon29.png new file mode 100644 index 00000000..6a6c77a8 Binary files /dev/null and b/src/iOSApp/Assets.xcassets/AppIcon.appiconset/Icon29.png differ diff --git a/src/iOSApp/Assets.xcassets/AppIcon.appiconset/Icon40.png b/src/iOSApp/Assets.xcassets/AppIcon.appiconset/Icon40.png new file mode 100644 index 00000000..cc7edcf5 Binary files /dev/null and b/src/iOSApp/Assets.xcassets/AppIcon.appiconset/Icon40.png differ diff --git a/src/iOSApp/Assets.xcassets/AppIcon.appiconset/Icon58.png b/src/iOSApp/Assets.xcassets/AppIcon.appiconset/Icon58.png new file mode 100644 index 00000000..1ad04f00 Binary files /dev/null and b/src/iOSApp/Assets.xcassets/AppIcon.appiconset/Icon58.png differ diff --git a/src/iOSApp/Assets.xcassets/AppIcon.appiconset/Icon60.png b/src/iOSApp/Assets.xcassets/AppIcon.appiconset/Icon60.png new file mode 100644 index 00000000..2dd52620 Binary files /dev/null and b/src/iOSApp/Assets.xcassets/AppIcon.appiconset/Icon60.png differ diff --git a/src/iOSApp/Assets.xcassets/AppIcon.appiconset/Icon76.png b/src/iOSApp/Assets.xcassets/AppIcon.appiconset/Icon76.png new file mode 100644 index 00000000..b058cae2 Binary files /dev/null and b/src/iOSApp/Assets.xcassets/AppIcon.appiconset/Icon76.png differ diff --git a/src/iOSApp/Assets.xcassets/AppIcon.appiconset/Icon80.png b/src/iOSApp/Assets.xcassets/AppIcon.appiconset/Icon80.png new file mode 100644 index 00000000..02e47a26 Binary files /dev/null and b/src/iOSApp/Assets.xcassets/AppIcon.appiconset/Icon80.png differ diff --git a/src/iOSApp/Assets.xcassets/AppIcon.appiconset/Icon87.png b/src/iOSApp/Assets.xcassets/AppIcon.appiconset/Icon87.png new file mode 100644 index 00000000..4954a4bd Binary files /dev/null and b/src/iOSApp/Assets.xcassets/AppIcon.appiconset/Icon87.png differ diff --git a/src/iOSApp/Entitlements.plist b/src/iOSApp/Entitlements.plist new file mode 100644 index 00000000..36a87067 --- /dev/null +++ b/src/iOSApp/Entitlements.plist @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/iOSApp/Info.plist b/src/iOSApp/Info.plist new file mode 100644 index 00000000..176e00d5 --- /dev/null +++ b/src/iOSApp/Info.plist @@ -0,0 +1,67 @@ + + + + + CFBundleDisplayName + iOSApp + CFBundleIdentifier + com.companyname.iOSApp + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + SceneDelegate + UISceneStoryboardFile + Main + + + + + MinimumOSVersion + 13.0 + UIDeviceFamily + + 1 + 2 + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIMainStoryboardFile~ipad + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + XSAppIconAssets + Assets.xcassets/AppIcon.appiconset + + diff --git a/src/iOSApp/LaunchScreen.storyboard b/src/iOSApp/LaunchScreen.storyboard new file mode 100644 index 00000000..5d2e905a --- /dev/null +++ b/src/iOSApp/LaunchScreen.storyboard @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/iOSApp/Main.cs b/src/iOSApp/Main.cs new file mode 100644 index 00000000..655d4880 --- /dev/null +++ b/src/iOSApp/Main.cs @@ -0,0 +1,15 @@ +using UIKit; + +namespace iOSApp +{ + public class Application + { + // This is the main entry point of the application. + static void Main(string[] args) + { + // if you want to use a different Application Delegate class from "AppDelegate" + // you can specify it here. + UIApplication.Main(args, null, "AppDelegate"); + } + } +} \ No newline at end of file diff --git a/src/iOSApp/Main.storyboard b/src/iOSApp/Main.storyboard new file mode 100644 index 00000000..00fac46d --- /dev/null +++ b/src/iOSApp/Main.storyboard @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/iOSApp/Properties/AssemblyInfo.cs b/src/iOSApp/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..00dbd8af --- /dev/null +++ b/src/iOSApp/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("iOSApp")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("iOSApp")] +[assembly: AssemblyCopyright("Copyright © 2017")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("50c7b8c9-e664-45af-b88e-0c9b8b9c1be1")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/iOSApp/Resources/LaunchScreen.xib b/src/iOSApp/Resources/LaunchScreen.xib new file mode 100644 index 00000000..3c3c2b19 --- /dev/null +++ b/src/iOSApp/Resources/LaunchScreen.xib @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/iOSApp/SceneDelegate.cs b/src/iOSApp/SceneDelegate.cs new file mode 100644 index 00000000..4d78c710 --- /dev/null +++ b/src/iOSApp/SceneDelegate.cs @@ -0,0 +1,58 @@ +using System; +using Foundation; +using UIKit; + +namespace NewSingleViewTemplate { + [Register ("SceneDelegate")] + public class SceneDelegate : UIResponder, IUIWindowSceneDelegate { + + [Export ("window")] + public UIWindow Window { get; set; } + + [Export ("scene:willConnectToSession:options:")] + public void WillConnect (UIScene scene, UISceneSession session, UISceneConnectionOptions connectionOptions) + { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see UIApplicationDelegate `GetConfiguration` instead). + } + + [Export ("sceneDidDisconnect:")] + public void DidDisconnect (UIScene scene) + { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not neccessarily discarded (see UIApplicationDelegate `DidDiscardSceneSessions` instead). + } + + [Export ("sceneDidBecomeActive:")] + public void DidBecomeActive (UIScene scene) + { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. + } + + [Export ("sceneWillResignActive:")] + public void WillResignActive (UIScene scene) + { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). + } + + [Export ("sceneWillEnterForeground:")] + public void WillEnterForeground (UIScene scene) + { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. + } + + [Export ("sceneDidEnterBackground:")] + public void DidEnterBackground (UIScene scene) + { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. + } + } +} diff --git a/src/iOSApp/ViewController.cs b/src/iOSApp/ViewController.cs new file mode 100644 index 00000000..c60aa688 --- /dev/null +++ b/src/iOSApp/ViewController.cs @@ -0,0 +1,34 @@ +using CoreGraphics; +using System; +using UIKit; + +namespace iOSApp +{ + public partial class ViewController : UIViewController + { + UITextField input; + UITextView clipboardContent; + + public ViewController (IntPtr handle) : base (handle) + { + } + + public override void ViewDidLoad () + { + base.ViewDidLoad (); + + clipboardContent = new UITextView(View.Bounds.Inset(5, 40)) { Text = "Type something" }; + input = new UITextField(View.Bounds.Inset(10, 40)) { Placeholder = "Write clipboard content here" }; + input.EditingChanged += Input_EditingChanged; + + Add(clipboardContent); + Add(input); + } + + private void Input_EditingChanged(object sender, EventArgs e) + { + TextCopy.Clipboard.SetText(input.Text); + clipboardContent.Text = TextCopy.Clipboard.GetText(); + } + } +} \ No newline at end of file diff --git a/src/iOSApp/ViewController.designer.cs b/src/iOSApp/ViewController.designer.cs new file mode 100644 index 00000000..42020843 --- /dev/null +++ b/src/iOSApp/ViewController.designer.cs @@ -0,0 +1,18 @@ +// WARNING +// +// This file has been generated automatically by Visual Studio from the outlets and +// actions declared in your storyboard file. +// Manual changes to this file will not be maintained. +// +using Foundation; +using System; +using System.CodeDom.Compiler; +using UIKit; + +namespace iOSApp +{ + [Register ("ViewController")] + partial class ViewController + { + } +} \ No newline at end of file diff --git a/src/iOSApp/iOSApp.csproj b/src/iOSApp/iOSApp.csproj new file mode 100644 index 00000000..70d77078 --- /dev/null +++ b/src/iOSApp/iOSApp.csproj @@ -0,0 +1,144 @@ + + + + Debug + iPhoneSimulator + {EAB4EF13-D4DE-4544-92B6-C1467683FA0B} + {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + {edc1b0fa-90cd-4038-8fad-98fe74adb368} + Exe + iOSApp + iOSApp + Resources + true + NSUrlSessionHandler + PackageReference + automatic + + + true + full + false + bin\iPhoneSimulator\Debug + DEBUG + prompt + 4 + x86_64 + None + true + + + none + true + bin\iPhoneSimulator\Release + prompt + 4 + None + x86_64 + + + true + full + false + bin\iPhone\Debug + DEBUG + prompt + 4 + ARM64 + Entitlements.plist + iPhone Developer + true + + + none + true + bin\iPhone\Release + prompt + 4 + Entitlements.plist + ARM64 + iPhone Developer + + + + + + + + + + + + + + + false + + + false + + + false + + + false + + + false + + + false + + + false + + + false + + + false + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + + + + + + ViewController.cs + + + + + {92e64f4e-6a8e-43c2-9c8d-694e0327bef0} + TextCopy + + + + \ No newline at end of file