Post

Replies

Boosts

Views

Activity

Reply to SwiftUI Gauge repeating current value instead of showing image
Is this bug affecting ProgressView also? I can't get the image to appear.     var body: some View {         VStack {             Gauge(value: 2, in: 1...7) {                 Image(systemName: "music.note")             } currentValueLabel: {                 Image(systemName: "music.note")             } minimumValueLabel: {                 Text("1")             } maximumValueLabel: {                 Text("7")             }             .gaugeStyle(CircularGaugeStyle())             ProgressView(value: 0.7) {                 Image(systemName: "music.note")             }             .progressViewStyle(                 CircularProgressViewStyle(tint: .red)             ) 				} 		} The image successfully loads in the Gauge, but not in ProgressView.
Jul ’20
Reply to UIDocumentPickerViewController not working in Catalyst
I've now discovered the issue:My Catalyst app uses a separate .entitlements file to the iOS app, since it could not unavailable entitlements (e.g. HealthKit).However, when editing the entitlements through the Xcode visual editor, it was making changes to the iOS file.In this case, it is kind of an Xcode bug, in that it doesn't detect the separate entitlements files in the visual editor, yet requires separate entitlements file in certain cases.
Jan ’20
Reply to Unable to use custom fonts in Mac Catalyst app
My use case for this was an font that only contained symbols/glyphs, and then I'd use them NSAttributedString.My workaround was to replace these with images in my asset catalog, then use NSTextAttachment to embed that image. let attachment: NSTextAttachment if #available(iOS 13, *) { attachment = NSTextAttachment(image: image.withRenderingMode(.alwaysTemplate)) } else { attachment = NSTextAttachment() attachment.image = image.withRenderingMode(.alwaysTemplate) } let imageString = NSMutableAttributedString(attachment: attachment) imageString.addAttribute(.foregroundColor, value: color, range: NSRange(location: 0, length: imageString.length))NSTextAttachment isn't available on watchOS.To set the colour of the image attachment, use addAttribute afterwards .foregroundColor.
Jan ’20
Reply to Disable NSWindow zoom button
I had the same rejection. I was subsequently able to alter the zoom functionality (or disable the green maximise button, depending on what you want to do).I haven't submitted this yet, so can't vouch for it passing app review, but here is my solution:1. Create a new target for your app. macOS -> Bundle. Use Objective C. Call it something like HelperBundle2. In your main target, go to General tab, add the new bundle under "Frameworks, Libraries and Embedded Contact"3. In your bundle, create a single class, say HelperApp:HelperApp.h:#import <Foundation/Foundation.h> #import <AppKit/AppKit.h> NS_ASSUME_NONNULL_BEGIN @interface HelperApp : NSObject + (void) disableMaximiseButton; @end NS_ASSUME_NONNULL_ENDHelperApp.m:#import "HelperApp.h" @implementation HelperApp + (void) disableMaximiseButton { for (NSWindow *window in [[NSApplication sharedApplication] windows]) { [window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenAuxiliary|NSWindowCollectionBehaviorFullScreenNone|NSWindowCollectionBehaviorFullScreenDisallowsTiling]; NSButton *button = [window standardWindowButton:NSWindowZoomButton]; [button setEnabled: NO]; } } @end4. Now you need to call it from your main app. I made a method something like this. Sorry it’s in Obj-C:#if TARGET_OS_MACCATALYST - (void) catalystDisableMaximiseButton { NSString *bundlePath = [NSBundle.mainBundle.builtInPlugInsPath stringByAppendingString:@"/HelperBundle.bundle"]; NSBundle *bundle = [[NSBundle alloc] initWithPath:bundlePath]; [bundle load]; NSObject *object = (NSObject *) NSClassFromString(@"HelperApp"); [object performSelector:NSSelectorFromString(@"disableMaximiseButton")]; } #endif5. Now I call it. I could only get it working by calling catalystDisableMaximiseButton in the main view controller’s “viewDidAppear” method
Jan ’20