Skip to content

Commit

Permalink
Set scene for custom window
Browse files Browse the repository at this point in the history
  • Loading branch information
bbirman committed Dec 23, 2024
1 parent f7316ea commit e131627
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ - (SFSDKWindowContainer *)windowWithName:(NSString *)name {
- (SFSDKWindowContainer *)windowWithName:(NSString *)name scene:(nullable UIScene *)scene {
scene = [self nonnullScene:scene];
SFSDKWindowContainer *container = [[self.namedWindows objectForKey:scene.session.persistentIdentifier] objectForKey:name];
[self setWindowScene:container scene:nil];
[self setWindowScene:container scene:scene];
return container;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,16 @@ - (void)testSnapshotWindow {
XCTAssertEqual(snapshowWindowScene.window.windowLevel, SFWindowLevelSnapshotOffset);
}

- (void)testCustomWindow {
NSString *windowName = @"test";
SFSDKWindowContainer *createdWindow = [[SFSDKWindowManager sharedManager] createNewNamedWindow:windowName];
XCTAssert(createdWindow.window != nil);
XCTAssert(createdWindow.windowType == SFSDKWindowTypeOther);

SFSDKWindowContainer *retrievedWindow = [[SFSDKWindowManager sharedManager] windowWithName:windowName];
XCTAssertEqualObjects(createdWindow, retrievedWindow);
}

- (void)testEnable {
SFSDKWindowContainer *screenLockWindow = [SFSDKWindowManager sharedManager].screenLockWindow;
[screenLockWindow presentWindow];
Expand Down

0 comments on commit e131627

Please sign in to comment.