Skip to content

Commit

Permalink
Ignore UIKeyboardWillShowNotification on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
c99koder committed Dec 20, 2021
1 parent a94bd8a commit e0cfb45
Show file tree
Hide file tree
Showing 4 changed files with 113 additions and 78 deletions.
105 changes: 54 additions & 51 deletions IRCCloud/Classes/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -999,62 +999,65 @@ -(void)closeWindow:(UIWindow *)window {
- (void)buildMenuWithBuilder:(id<UIMenuBuilder>)builder {
[super buildMenuWithBuilder:builder];

NSArray *formatting = @[
[builder commandForAction:@selector(toggleBoldface:) propertyList:nil],
[builder commandForAction:@selector(toggleItalics:) propertyList:nil],
[builder commandForAction:@selector(toggleUnderline:) propertyList:nil],
[UICommand commandWithTitle:@"Text Color" image:nil action:@selector(chooseFGColor) propertyList:nil],
[UICommand commandWithTitle:@"Background Color" image:nil action:@selector(chooseBGColor) propertyList:nil],
[UICommand commandWithTitle:@"Reset Colors" image:nil action:@selector(resetColors) propertyList:nil],
];

[builder replaceMenuForIdentifier:UIMenuFont withMenu:[[builder menuForIdentifier:UIMenuFont] menuByReplacingChildren:formatting]];

if(builder.system == UIMenuSystem.mainSystem) {
[builder removeMenuForIdentifier:UIMenuServices];
[builder removeMenuForIdentifier:UIMenuToolbar];

[builder replaceMenuForIdentifier:UIMenuPreferences withMenu:[[builder menuForIdentifier:UIMenuPreferences] menuByReplacingChildren:@[
[UIKeyCommand commandWithTitle:@"Preferences…" image:nil action:@selector(showSettings) input:@"," modifierFlags:UIKeyModifierCommand propertyList:nil],
]]];
if (@available(iOS 14.0, *)) {
if([NSProcessInfo processInfo].isiOSAppOnMac || [NSProcessInfo processInfo].isMacCatalystApp) {
NSArray *formatting = @[
[builder commandForAction:@selector(toggleBoldface:) propertyList:nil],
[builder commandForAction:@selector(toggleItalics:) propertyList:nil],
[builder commandForAction:@selector(toggleUnderline:) propertyList:nil],
[UICommand commandWithTitle:@"Text Color" image:nil action:@selector(chooseFGColor) propertyList:nil],
[UICommand commandWithTitle:@"Background Color" image:nil action:@selector(chooseBGColor) propertyList:nil],
[UICommand commandWithTitle:@"Reset Colors" image:nil action:@selector(resetColors) propertyList:nil],
];

[builder replaceMenuForIdentifier:UIMenuFont withMenu:[[builder menuForIdentifier:UIMenuFont] menuByReplacingChildren:formatting]];

if(builder.system == UIMenuSystem.mainSystem) {
[builder removeMenuForIdentifier:UIMenuServices];
[builder removeMenuForIdentifier:UIMenuToolbar];

[builder replaceMenuForIdentifier:UIMenuPreferences withMenu:[[builder menuForIdentifier:UIMenuPreferences] menuByReplacingChildren:@[
[UIKeyCommand commandWithTitle:@"Preferences…" image:nil action:@selector(showSettings) input:@"," modifierFlags:UIKeyModifierCommand propertyList:nil],
]]];

[builder replaceMenuForIdentifier:UIMenuFormat withMenu:[[builder menuForIdentifier:UIMenuFormat] menuByReplacingChildren:formatting]];
[builder replaceMenuForIdentifier:UIMenuFormat withMenu:[[builder menuForIdentifier:UIMenuFormat] menuByReplacingChildren:formatting]];

[builder replaceMenuForIdentifier:UIMenuFile withMenu:[[builder menuForIdentifier:UIMenuFile] menuByReplacingChildren:@[
[UIMenu menuWithTitle:@"" image:nil identifier:nil options:UIMenuOptionsDisplayInline children:@[
[UICommand commandWithTitle:@"Upload a File…" image:nil action:@selector(chooseFile) propertyList:nil],
[UICommand commandWithTitle:@"New Text Snippet…" image:nil action:@selector(startPastebin) propertyList:nil]
]],
[UIMenu menuWithTitle:@"" image:nil identifier:nil options:UIMenuOptionsDisplayInline children:@[
[UICommand commandWithTitle:@"Add a Network…" image:nil action:@selector(addNetwork) propertyList:nil],
[UICommand commandWithTitle:@"Edit Connection…" image:nil action:@selector(editConnection) propertyList:nil]
]],
[UIMenu menuWithTitle:@"" image:nil identifier:nil options:UIMenuOptionsDisplayInline children:@[
[UIKeyCommand commandWithTitle:@"Select Next in List" image:nil action:@selector(selectNext) input:UIKeyInputDownArrow modifierFlags:UIKeyModifierCommand propertyList:nil],
[UIKeyCommand commandWithTitle:@"Select Previous in List" image:nil action:@selector(selectPrevious) input:UIKeyInputUpArrow modifierFlags:UIKeyModifierCommand propertyList:nil],
[UIKeyCommand commandWithTitle:@"Select Next Unread in List" image:nil action:@selector(selectNextUnread) input:UIKeyInputDownArrow modifierFlags:UIKeyModifierCommand|UIKeyModifierShift propertyList:nil],
[UIKeyCommand commandWithTitle:@"Select Previous Unread in List" image:nil action:@selector(selectPreviousUnread) input:UIKeyInputUpArrow modifierFlags:UIKeyModifierCommand|UIKeyModifierShift propertyList:nil],
]],
[UIMenu menuWithTitle:@"" image:nil identifier:nil options:UIMenuOptionsDisplayInline children:@[
[UIKeyCommand commandWithTitle:@"Mark Current As Read" image:nil action:@selector(markAsRead) input:@"r" modifierFlags:UIKeyModifierCommand propertyList:nil],
[UIKeyCommand commandWithTitle:@"Mark All As Read" image:nil action:@selector(markAllAsRead) input:@"r" modifierFlags:UIKeyModifierCommand|UIKeyModifierShift propertyList:nil],
]],
[UIMenu menuWithTitle:@"" image:nil identifier:nil options:UIMenuOptionsDisplayInline children:@[
[UICommand commandWithTitle:@"Download Logs…" image:nil action:@selector(downloadLogs) propertyList:nil],
]],
[builder menuForIdentifier:UIMenuClose],
[UIMenu menuWithTitle:@"" image:nil identifier:nil options:UIMenuOptionsDisplayInline children:@[
[UICommand commandWithTitle:@"Logout" image:nil action:@selector(logout) propertyList:nil]
]],
]]];
[builder replaceMenuForIdentifier:UIMenuFile withMenu:[[builder menuForIdentifier:UIMenuFile] menuByReplacingChildren:@[
[UIMenu menuWithTitle:@"" image:nil identifier:nil options:UIMenuOptionsDisplayInline children:@[
[UICommand commandWithTitle:@"Upload a File…" image:nil action:@selector(chooseFile) propertyList:nil],
[UICommand commandWithTitle:@"New Text Snippet…" image:nil action:@selector(startPastebin) propertyList:nil]
]],
[UIMenu menuWithTitle:@"" image:nil identifier:nil options:UIMenuOptionsDisplayInline children:@[
[UICommand commandWithTitle:@"Add a Network…" image:nil action:@selector(addNetwork) propertyList:nil],
[UICommand commandWithTitle:@"Edit Connection…" image:nil action:@selector(editConnection) propertyList:nil]
]],
[UIMenu menuWithTitle:@"" image:nil identifier:nil options:UIMenuOptionsDisplayInline children:@[
[UIKeyCommand commandWithTitle:@"Select Next in List" image:nil action:@selector(selectNext) input:UIKeyInputDownArrow modifierFlags:UIKeyModifierCommand propertyList:nil],
[UIKeyCommand commandWithTitle:@"Select Previous in List" image:nil action:@selector(selectPrevious) input:UIKeyInputUpArrow modifierFlags:UIKeyModifierCommand propertyList:nil],
[UIKeyCommand commandWithTitle:@"Select Next Unread in List" image:nil action:@selector(selectNextUnread) input:UIKeyInputDownArrow modifierFlags:UIKeyModifierCommand|UIKeyModifierShift propertyList:nil],
[UIKeyCommand commandWithTitle:@"Select Previous Unread in List" image:nil action:@selector(selectPreviousUnread) input:UIKeyInputUpArrow modifierFlags:UIKeyModifierCommand|UIKeyModifierShift propertyList:nil],
]],
[UIMenu menuWithTitle:@"" image:nil identifier:nil options:UIMenuOptionsDisplayInline children:@[
[UIKeyCommand commandWithTitle:@"Mark Current As Read" image:nil action:@selector(markAsRead) input:@"r" modifierFlags:UIKeyModifierCommand propertyList:nil],
[UIKeyCommand commandWithTitle:@"Mark All As Read" image:nil action:@selector(markAllAsRead) input:@"r" modifierFlags:UIKeyModifierCommand|UIKeyModifierShift propertyList:nil],
]],
[UIMenu menuWithTitle:@"" image:nil identifier:nil options:UIMenuOptionsDisplayInline children:@[
[UICommand commandWithTitle:@"Download Logs…" image:nil action:@selector(downloadLogs) propertyList:nil],
]],
[builder menuForIdentifier:UIMenuClose],
[UIMenu menuWithTitle:@"" image:nil identifier:nil options:UIMenuOptionsDisplayInline children:@[
[UICommand commandWithTitle:@"Logout" image:nil action:@selector(logout) propertyList:nil]
]],
]]];

[builder insertSiblingMenu:[UIMenu menuWithTitle:@"Go" children:@[
[UICommand commandWithTitle:@"File Uploads" image:nil action:@selector(showUploads) propertyList:nil],
[UICommand commandWithTitle:@"Text Snippets" image:nil action:@selector(showPastebins) propertyList:nil]
]] afterMenuForIdentifier:UIMenuView];
[builder insertSiblingMenu:[UIMenu menuWithTitle:@"Go" children:@[
[UICommand commandWithTitle:@"File Uploads" image:nil action:@selector(showUploads) propertyList:nil],
[UICommand commandWithTitle:@"Text Snippets" image:nil action:@selector(showPastebins) propertyList:nil]
]] afterMenuForIdentifier:UIMenuView];
}
}
}
}

@end

@implementation SceneDelegate
Expand Down
8 changes: 8 additions & 0 deletions IRCCloud/Classes/MainViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -1789,6 +1789,14 @@ -(void)backlogCompleted:(NSNotification *)notification {
}

-(void)keyboardWillShow:(NSNotification*)notification {
if (@available(iOS 14.0, *)) {
if([NSProcessInfo processInfo].isiOSAppOnMac) {
self->_kbSize = CGSizeMake(0,0);
return;
}
} else {
// Fallback on earlier versions
}
if(self->_eventsView.topUnreadView.observationInfo) {
@try {
[self->_eventsView.tableView.layer removeObserver:self forKeyPath:@"bounds"];
Expand Down
2 changes: 1 addition & 1 deletion build-scripts/BUILD
Original file line number Diff line number Diff line change
@@ -1 +1 @@
186
188
76 changes: 50 additions & 26 deletions fastlane/README.md
Original file line number Diff line number Diff line change
@@ -1,64 +1,88 @@
fastlane documentation
================
----

# Installation

Make sure you have the latest version of the Xcode command line tools installed:

```
```sh
xcode-select --install
```

Install _fastlane_ using
```
[sudo] gem install fastlane -NV
```
or alternatively using `brew install fastlane`
For _fastlane_ installation instructions, see [Installing _fastlane_](https://docs.fastlane.tools/#installing-fastlane)

# Available Actions

## iOS

### ios certs

```sh
[bundle exec] fastlane ios certs
```
fastlane ios certs
```

Check all certs and provisioning profiles from github

### ios apn

```sh
[bundle exec] fastlane ios apn
```
fastlane ios apn
```

Generate new push certs

### ios upload_symbols

```sh
[bundle exec] fastlane ios upload_symbols
```
fastlane ios upload_symbols
```

Upload symbols to FirebaseCrashlytics

### ios push

```sh
[bundle exec] fastlane ios push
```
fastlane ios push
```

Build and push to iTunes Connect

### ios vers

```sh
[bundle exec] fastlane ios vers
```
fastlane ios vers
```

Print version

### ios screenshots

```sh
[bundle exec] fastlane ios screenshots
```
fastlane ios screenshots
```

Take screenshots

### ios metadata

```sh
[bundle exec] fastlane ios metadata
```
fastlane ios metadata
```

Upload metadata

### ios updateadhoc

```sh
[bundle exec] fastlane ios updateadhoc
```
fastlane ios updateadhoc
```

Make sure all devices are added to the ad-hoc profile

----

This README.md is auto-generated and will be re-generated every time [fastlane](https://fastlane.tools) is run.
More information about fastlane can be found on [fastlane.tools](https://fastlane.tools).
The documentation of fastlane can be found on [docs.fastlane.tools](https://docs.fastlane.tools).
This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run.

More information about _fastlane_ can be found on [fastlane.tools](https://fastlane.tools).

The documentation of _fastlane_ can be found on [docs.fastlane.tools](https://docs.fastlane.tools).

0 comments on commit e0cfb45

Please sign in to comment.