Pastor J.G Seigle
Pastor J.G Seigle

Reputation: 155

Mac-catalyst set Window max and minimum size in objective-c

I have Mac-catalyst app. I would like to know options to set the max or minimum size of a window in objective-c.

Here is an example in swift

UIApplication.shared.connectedScenes.compactMap { $0 as? UIWindowScene }.forEach { windowScene in
    windowScene.sizeRestrictions?.minimumSize = CGSize(width: 480, height: 640)
}

Could someone help provide example in objective-c

Upvotes: 1

Views: 208

Answers (1)

Adrenalinevictim
Adrenalinevictim

Reputation: 81

for (UIScene* scene in UIApplication.sharedApplication.connectedScenes) {
    if ([scene isKindOfClass:[UIWindowScene class]]) {
        UIWindowScene* windowScene = (UIWindowScene*) scene;
        windowScene.sizeRestrictions.minimumSize = CGSizeMake(480, 640);
    }
}

Upvotes: 1

Related Questions