Reputation: 155
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
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