-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't show error dialog when broadcast stops without error (Obj-C bri…
…dge) (#519) This is an alternative to #517 that uses the same Objective-C bridge as [used in Telegram](https://github.com/TelegramMessenger/Telegram-iOS/blob/9a46522b431782147cc1d95304180d91d398dd82/submodules/BroadcastUploadHelpers/Sources/BroadcastUploadHelpers.m), instead of some selector and IMP casting magic in Swift --------- Co-authored-by: hiroshihorie <[email protected]>
- Loading branch information
1 parent
eab7650
commit 81a80c9
Showing
5 changed files
with
65 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#import "LKObjcHelpers.h" | ||
|
||
@implementation LKObjCHelpers | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
+ (void)finishBroadcastWithoutError:(RPBroadcastSampleHandler *)handler API_AVAILABLE(macos(11.0)) { | ||
// Call finishBroadcastWithError with nil error, which ends the broadcast without an error popup | ||
// This is unsupported/undocumented but appears to work and is preferable to an error dialog with a cryptic default message | ||
// See https://stackoverflow.com/a/63402492 for more discussion | ||
#pragma clang diagnostic push | ||
#pragma clang diagnostic ignored "-Wnonnull" | ||
[handler finishBroadcastWithError:nil]; | ||
#pragma clang diagnostic pop | ||
} | ||
|
||
NS_ASSUME_NONNULL_END | ||
|
||
@end |
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,8 @@ | ||
#import <Foundation/Foundation.h> | ||
#import <ReplayKit/ReplayKit.h> | ||
|
||
@interface LKObjCHelpers : NSObject | ||
|
||
+ (void)finishBroadcastWithoutError:(RPBroadcastSampleHandler *)handler API_AVAILABLE(macos(11.0)); | ||
|
||
@end |
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