-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
761 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<CancellationToken, Task<string?>> CreateAsyncGet() | ||
{ | ||
return token => Task.FromResult(GetTextiOS()); | ||
} | ||
|
||
static Func<string?> CreateGet() | ||
{ | ||
return GetTextiOS; | ||
} | ||
|
||
static string? GetTextiOS() | ||
{ | ||
return UIPasteboard.General.String; | ||
} | ||
} | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<string, CancellationToken, Task> CreateAsyncSet() | ||
{ | ||
return (text, cancellation) => | ||
{ | ||
SetTextiOS(text); | ||
return Task.CompletedTask; | ||
}; | ||
} | ||
|
||
static Action<string> CreateSet() | ||
{ | ||
return SetTextiOS; | ||
} | ||
|
||
static void SetTextiOS(string text) | ||
{ | ||
UIPasteboard.General.String = text; | ||
} | ||
} | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<UISceneSession> 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. | ||
} | ||
} | ||
} | ||
|
Oops, something went wrong.