Post

Replies

Boosts

Views

Activity

Lost space with DoubleColumnNavigationViewStyle in DocumentGroup
DoubleColumnNavigationViewStyle, on iPad, left an unusable space at the top. It seems to be a navigation bar's title, but the navigation bar code apply to the main navigation bar. Is there a way to hide, or at least use, the inner navigation bar? The sample code below reveals part of the screen unused by the App. import UniformTypeIdentifiers @main struct RugbyTimeApp: App { @SceneBuilder var body: some Scene { DocumentGroup( newDocument: {() -> ReferenceDocument in ReferenceDocument()}, editor: {_ -> MainView in MainView()} ) } } struct MainView: View { var body: some View { NavigationView { Text("Side View") .frame(maxWidth: .infinity, maxHeight: .infinity) .background(Color.green) Text("Hello world") .frame(maxWidth: .infinity, maxHeight: .infinity) .background(Color.red) } .navigationViewStyle(DoubleColumnNavigationViewStyle()) .navigationTitle("Nav Title") .toolbar { ToolbarItem(placement: .navigation, content: {Button("Next page", action: {})}) } } } class ReferenceDocument: ReferenceFileDocument { static var readableContentTypes = [UTType.plainText] init() {} required init(configuration: ReadConfiguration) throws {} func snapshot(contentType: UTType) throws -> Int {return 0} func fileWrapper(snapshot: Int, configuration: WriteConfiguration) throws -> FileWrapper { let data: Data = try JSONEncoder().encode(snapshot) return FileWrapper(regularFileWithContents: data) } }
0
0
652
Jan ’21
speechSynthesizer delayed by UILongPressGestureRecognizer
I'd have a speech at a begin of a long pressure: class Cell: UITableViewCell { override func awakeFromNib() { ... let willSpeech = UILongPressGestureRecognizer(target: self, action: #selector(longPress(gesture:))) button.addGestureRecognizer(willSpeech) } @objc func longPress(gesture: UILongPressGestureRecognizer) { switch gesture.state { case .began: let utterance = AVSpeechUtterance(string: "hello") let speechSynthesizer = AVSpeechSynthesizer() speechSynthesizer.speak(utterance) ... } } } But the speech start only when the button is released. Is there a way to let the speech start immediately even during a long pressure gesture recogniser?
0
0
756
Mar ’21
distribution certificate not working
The Apple Distribution certificate is present in the login Keychain, as well as the Development one. In Xcode preferences both are visibile and valid. In Xcode target only the development certificate is present and I'm unable to set the distribution one. For this reason my last app has been refused on the Apple Store Connect. How can I set the distribution certificate on the App target?
0
0
642
Aug ’22
Launch screen images is unpleasant
I agree with Apple Human Interface Guidelines that states "Design a launch screen that’s nearly identical to the first screen of your app", but: A SwiftUI App for both macOS and iOS cannot have a storyboard Launch Screen Images can be scaled only at: 2x/3x, Compact/Regular, iPhone/iPad Launch Screen can have central, top (Navigation bar) and bottom (Tab Bar and Toolbar) images Launch screen images are centered in the screen space Launch screen images are stretched to fill the screen space With the rules above, I'm unable to create launch screens for every screen size. If the image in the asset is sized for a small screen, i.e. an iPhone SE, it will be distorted in a 'long' screen, i.e. an iPhone 14, and viceversa. Have I missed some possibility to better define how to define or manage the launch screen images?
0
0
1.1k
Jan ’23