Posts

Post not yet marked as solved
1 Replies
519 Views
In my Mac OSX app, I am giving option to change application language(localisation), to user, for which I have changed bundle programatically when user change the language. Now the issue is, when choosing Arabic, the texts get converted to arabic text from English but the app still appears in Left to Right instead of Right to Left. I want my app to change from LTR to RTL, without user changing their system language to Arabic. I have also used NSForceRightToLeftWritingDirection, but I need to relaunch my app twice to see the change in app. [[NSUserDefaults standardUserDefaults] setObject:@"YES" forKey:@"AppleTextDirection"]; [[NSUserDefaults standardUserDefaults] setObject:@"YES" forKey:@"NSForceRightToLeftWritingDirection"]; How can I change app appearance from LTR to RTL, without changing system language and without relaunching app twice? Is there any other way I could use instead of using NSForceRightToLeftWritingDirection?
Posted Last updated
.
Post not yet marked as solved
2 Replies
332 Views
How to show app accroding activity like sleepmindfulness ? I used this code but my didn't show in wind down that category let playSoundIntent = INPlayMediaIntent.init(mediaItems: nil, mediaContainer: mediaItem, playShuffled: false,playbackRepeatMode: .none,resumePlayback: false) if #available(iOS 14.0, *) {             playSoundIntent.shortcutAvailability = .sleepMindfulness         } else {                     }         playSoundIntent.suggestedInvocationPhrase = "Play Calm Exercise" if let shortcut = INShortcut(intent: playSoundIntent){          INVoiceShortcutCenter.shared.setShortcutSuggestions([shortcut])         }
Posted Last updated
.
Post not yet marked as solved
0 Replies
512 Views
Hello Guys,I want to set multi line text in my watch app using WKInterfaceLabel but i don't want to cut down my word so i want to give it a lineBreakMode to wordWrap but WKInterfaceLabel doesn't have that kind of property.Even i did try it with NSAttributedText as well but didn't work.Here is my code that i tried : let font = UIFont.systemFont(ofSize: 15); let style = NSMutableParagraphStyle(); style.lineBreakMode = .byWordWrapping; let attributes: [NSAttributedString.Key: Any] = [ .font: font, .paragraphStyle: style, ]; let attributedString = NSAttributedString(string: getPromptText(), attributes: attributes) lblDisplayText.setAttributedText(attributedString);
Posted Last updated
.