Hi,
I have a form on an iPad App I'm developing and the form have text field at its bottom when tapping on it the keyboard cover those text fields how to solve this issue leave a hug gap at bottom of the form so text field jump to top when keyboard shows ?
Kind Regards
Explore the various UI frameworks available for building app interfaces. Discuss the use cases for different frameworks, share best practices, and get help with specific framework-related questions.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I'm getting the following error Error Domain=com.google.GIDSignIn Code=-4. How do I find out what I'm missing with my setup of Google Cloud?
Topic:
UI Frameworks
SubTopic:
SwiftUI
1.APPStore Arraignment passed. Not yet released. The diagnostic link configuration is not available.
Firstly,We filled in the configuration of the corresponding domain name, and the verification was successful.
My AASA file is configured correctly (general deep links work with it, as well as some app clip URLs) and is also configured for app clips.
"applinks": {
"apps": [],
"details": [
{
"appID": "xxx.com.xx.easyshare",
"paths": [
"*"
]
},
{
"appID": "xxx.com.xx.easyshareExport",
"paths": [
"*"
]
}
]
},
"appclips": {
"apps": [
"xxx.com.xx.easyshare.Clip"
]
}
}
Well,I used https://es.xx.com/send or https://es.xx.com to get diagnostic information is wrong
My TestFight config is ok
Another problem is that using NFT jumps directly to Safire.
I'm upgrading my app from minVersion iOS 11 to iOS 12. My compiler says that UIDocumentMenuViewController with UIDocumentPickerViewController is deprecated, they recommend to use directly the last one. So I change the code.
fileprivate func openDocumentPicker() {
let documentPicker = UIDocumentPickerViewController(
documentTypes: [
"com.adobe.pdf",
"org.openxmlformats.wordprocessingml.document", // DOCX
"com.microsoft.word.doc" // DOC
],
in: .import
)
documentPicker.delegate = self
view.window?.rootViewController?.present(documentPicker, animated: true, completion: nil)
}
When I open the picker in iOS 17.2 simulator and under it is well shown, like a page sheet. But in iOS 18.0 and up at first it opens like a page sheet with no content but then it is displayed as a transparent window with no content. Is there any issue with this component and iOS 18? If I open the picker through UIDocumentMenuViewControllerDelegate in an iphone with iOS 18.2 it is well shown.
Image in iOS 18.2 with the snippet
The same snippet in iOS 17.2 (and expected in older ones)
I'm adding Admob ads to my app, and Admob needs to know the width of the view, so I'm using GeometryReader for that. To prevent GeometryReader from grabbing screen space, I've wrapped the main view in GeometryReader { }. I then use geometry.size.width in my call to the adView.
This all works fine. I have two main screens where I show ads, and they both work, until I rotate the device. Then the app crashes!
If I comment out the GeometryReader code and pass a fixed value to the ad view, I can rotate the device with no fear of a crash.
My question is: Do I have to accept that GeometryReader will crash the app when it's rotated, or is there another, stable way to get view dimensions?
One of my clients is interested in developing a system similar to BrowserStack for internal team usage. Could you please guide me on how to approach the development of this system?
Specifically, the project requires:
Full iPhone screen recording.
Capturing and executing click events on the iPhone.
Do I need to obtain permission from Apple for these functionalities?
As can be seen in the screenshot attached, I can not see the options in this window. A prompt window before this also did not show any buttons in the visible space. However, I made a guess and could get to this window by clicking on what I think was "Ok" or something similar.
But on this I could not do any action and had to force quit the app.
Hello everyone,
I've been having a bit of trouble with the .symbolRenderingMode(_:) modifier.
When trying to apply it to a single button in a toolbar, it does not work at all. The symbol is always rendered as monochrome.
However, I've realised that with this little hack I can achieve the expected results, but this is not ideal.
.toolbar {
HStack {
Button("", action: {}) // The hack
Button("Button", systemImage: "line.3.horizontal.decrease.circle.fill", action: {})
.symbolRenderingMode(.hierarchical)
.foregroundStyle(.blue)
}
}
I've submitted a bug report (FB16129223) but in the meantime, is this my only solution ?
Side note: the foregroundStyle(_:) modifier is ignored as well.
I am working on a SwiftUI TabView with the .page style (indexDisplayMode: .never). I want to track the minX property of each tab's view using GeometryReader. However, I noticed inconsistent behavior when scrolling between pages.
Here's the simplified code:
import SwiftUI
struct ContactScreenView: View {
let text: String
var body: some View {
ZStack {
Color.red.opacity(0.4).ignoresSafeArea()
VStack {
Image(systemName: "globe")
.imageScale(.large)
.foregroundStyle(.tint)
Text(text)
}
.padding()
}
}
}
struct DemoView: View {
@State private var selectedTab: Int = 0
var body: some View {
VStack {
TabView(selection: $selectedTab) {
ContactScreenView(text: "followers")
.background(
GeometryReader(content: { geometry -> Color in
let minX = geometry.frame(in: .global).minX
print(minX)
return Color.clear
})
)
.tag(0)
ContactScreenView(text: "following")
.tag(1)
ContactScreenView(text: "blocked")
.tag(2)
ContactScreenView(text: "Shared")
.tag(3)
}
.tabViewStyle(.page(indexDisplayMode: .never))
}
}
}
#Preview {
DemoView()
}
Observed Behavior:
When I scroll to the second page (index 1), the minX value updates correctly to screenWidth * 1, as expected.
When I scroll to the third page (index 2), the minX value doesn't update at all.
The ideal behavior would be for minX to update to screenWidth * 2 for the third page and so on, for subsequent pages.
Expected Behavior:
The minX value should correctly reflect the global position of each page as I scroll through the TabView. For example:
Page 0: minX = 0
Page 1: minX = screenWidth * 1
Page 2: minX = screenWidth * 2
And so on.
Topic:
UI Frameworks
SubTopic:
SwiftUI
In TextKit 1, I can override drawBackground(forGlyphRange:at:) in NSLayoutManager to do custom background drawing. However, I'm not too sure what the designated way of doing background drawing is in TextKit 2.
One thing I've tried is to do custom drawing in my own CALayer that's used in the configureRenderingSurface delegate callback, but I'm unsure if we are suppose to use this API and steal the textViewportLayoutController.delegate away from _UITextLayoutcanvasView?
When my iOS app runs on macOS in "designed for iPad" mode, the system foreground colour RGBA values seem strange.
Looking at [UIColor labelColor], [UIColor secondaryLabelColor] etc. on iOS, I see values like these: (Light Mode)
// R G B A
fg0 = 0 0 0 255
fg1 = 10 10 13 153
fg2 = 10 10 13 76
fg3 = 10 10 13 45
Note in particular that fg0, aka labelColor, is solid black.
When I run it on my Mac, the values I see are:
// R G B A
fg0 = 0 0 0 216
fg1 = 0 0 0 127
fg2 = 0 0 0 66
fg3 = 0 0 0 25
Here, fg0 has alpha = 216.
The result is that it looks like a dark grey, on a white background.
Of course it's reasonable for macOS to have a different colour palette than iOS - but native macOS apps seem to have solid 100% black as their foreground colour.
Do others see this? What should I be doing?
Note that I'm getting colour values using UIColor's getRed: blue: green: alpha: method and then using these colour values for some custom GPU drawing. Previously I was using solid black and white, but at some point I updated it to use UIColor in order to respond to light/dark-mode changes.
I want to use Objective C language to implement a button, click the button to achieve the function of Menu Bar - Full Screen Tile - Left of Screen. What should I do? I couldn't find the relevant API.
Topic:
UI Frameworks
SubTopic:
AppKit
Our MacOS app has for some time been able to create so-called "add-on" services, which are dynamically written to individual bundles in ~/Library/Services/ (as opposed to being statically defined in the app's Info.plist). These worked fine for a long time until recently. They still appear in other app Services menus, but do not get as far as calling the specified instance method in our app. Does anyone know if add-on services are no longer supported? Perhaps due to some new security constraint? The documentation on app services in general seems to be out of date.
I did try copying the add-on service definition from the add-on plist into the app's Info.plist. That seemed to work, so the basic specification doesn't seem to have changed.
Topic:
UI Frameworks
SubTopic:
AppKit
I'm encountering an issue displaying a large HTML string (over 11470 characters) in a UILabel. Specifically, the Arabic text within the string is rendering left-to-right instead of the correct right-to-left direction. I've provided a truncated version of the HTML string and the relevant code snippet below. I've tried setting the UILabel's text alignment to right, but this didn't resolve the issue. Could you please advise on how to resolve this bidirectional text rendering problem?
The results of the correct and incorrect approaches are shown in the image below.
Here's the relevant Swift code:
let labelView: UILabel = {
let label = UILabel()
label.textAlignment = .right
label.translatesAutoresizingMaskIntoConstraints = false
label.numberOfLines = 0
label.semanticContentAttribute = .forceRightToLeft
label.backgroundColor = .white
label.lineBreakMode = .byWordWrapping
return label
}()
//Important!!
//It must exceed 11470 characters.
let htmlString = """
<p style=\"text-align: center;\"><strong>İSTİÂZE</strong></p> <p>Nahl sûresindeki:</p>
<p dir="rtl" lang="ar"> فَاِذَا قَرَاْتَ الْقُرْاٰنَ فَاسْتَعِذْ بِاللّٰهِ مِنَ الشَّيْطَانِ الرَّج۪يمِ </p>
<p><strong>“</strong><strong>Kur’an okuyacağın zaman kovulmuş şeytandan hemen Allah’a sığın!</strong><strong>”</strong> (Nahl 16/98) emri gereğince Kur’ân-ı Kerîm okumaya başlarken:</p> <p dir="rtl" lang="ar">اَعُوذُ بِاللّٰهِ مِنَ الشَّيْطَانِ الرَّج۪يمِ</p> <p><em>“Kovulmuş şeytandan Allah’a sığınırım” </em>deriz. Bu sözü söylemeye “istiâze<em>” denilir. “Eûzü”</em>, sığınırım, emân dilerim, yardım taleb ederim, gibi anlamlara gelir. It must exceed 11470 characters.</p>
“””
if let data = htmlString.data(using: .utf8) {
let options: [NSAttributedString.DocumentReadingOptionKey: Any] = [
.documentType: NSAttributedString.DocumentType.html,
.characterEncoding: String.Encoding.utf8.rawValue
]
do {
let attributedString = try NSAttributedString(data: data, options: options, documentAttributes: nil)
labelView.attributedText = attributedString
} catch {
print("HTML string işlenirken hata oluştu: \(error)")
}
}
I'm using iOS 18.2 and Swift 6. Any suggestions on how to correct the bidirectional text rendering?
I have an app that acts as an agent (no dock/app, just menu bar icon). When the icon is clicked, I show a popover with a small user interface.
This works great, however, there is an issue. When a certain app is in full-screen and then my menu bar icon is clicked, the user interface shows just fine, until the mouse is moved outside the menu bar - then the user interface stays but the menu bar dismisses and closes.
Is there a way to keep the menu bar open, like when clicking on Control Center, in full-screen apps?
This is how I open my popover:
if let button = statusItem.button {
if popover.isShown {
self.popover.performClose(sender)
} else {
popover.show(relativeTo: button.bounds, of: button, preferredEdge: .minY)
popover.contentViewController?.view.window?.makeKey()
}
}
}
My app uses UIDocumentPickerViewController to display image files that are saved on iCloud Drive.
In previous versions of iOS the user could long press on an image file and an option to Delete was shown. This no longer seems to be the case in iOS 18.
Is there a way to allow users to delete files when using a UIDocumentPickerViewController?
I set the isHidden property of a view in traitCollectionDidChange and found that sometime it does not take effect after being set(value of isHidden actually not changed either). It looks like the setting does not take effect when triggered an even number of times, but it is normal when triggered an odd number of times.
When setting isHidden, what actually goes into is [UIView (Rendering) setHidden:], which internally calls [UIView _ bitFlagValueAfterIncrementingHiddenManagement CountForKey: withIncrement: bitFlagValue:] to handle the relevant logic of "_UIViewPendingHiddenCount". Is this issue related to this part of the processing? returning 0 after calling seems normal
This view is a UIStackView, and it is uncertain whether it is related to the type of view
I'm trying to make the side bar menu on my tvOS app have the same behavior of Apple's tvOS App. I would like to have the side menu collapsed at the cold start of the app. I'm trying to achieve this by using the defaultFocus view modifier, which should make the button inside the TabView focused at the start of the app. But no matter what I do, the side bar always steels the focus from the inside button.
struct ContentView: View {
enum Tabs {
case viewA
case viewB
}
enum ScreenElements {
case button
case tab
}
@FocusState private var focusedElement: ScreenElements?
@State private var selectedTab: Tabs? = nil
var body: some View {
Group {
TabView(selection: $selectedTab) {
Tab("View A", image: "square", value: .viewA) {
Button("View A Button", action: {})
.frame(maxWidth: .infinity, alignment: .center)
.focused($focusedElement, equals: .button)
}
}
.tabViewStyle(.sidebarAdaptable)
.focused($focusedElement, equals: .tab)
}
.defaultFocus($focusedElement, .button, priority: .userInitiated)
}
}
Is there a way to start the side bar menu collapsed at the start up of the app?
Does anyone have a problem with buttons not clickable in the lists of elements? If I have a list of 30 elements, some of them are clickable and some not. The button is a basic button that prints something in the console. After refresh, click ability is changed but still some clickable and some not. It appears always when compiling with Swift 6. My colleague has the "old" Xcode 15.4 with Swift 5 and when he installs exactly the same code -> buttons and lists work just fine.
I noticed some similar issues with onTapGesture on StackOverflow but my problem is a button. However, I have the same problem with onTapGesture (where I use it) in some of my View components and changing it with highPriorityGesture will not solve the problem since I can't click on the child elements of those Views anymore...
I'm using Xcode 16.2 and iOS 18.2.
Does anyone have an idea how to solve this?
Topic:
UI Frameworks
SubTopic:
SwiftUI
As a starter for iOS programming, I want to get the touch’ x-y position on a SwiftUI view , what is the fastest way/api or the highest refresh rate to get the position . UItouch in UIkit ?or other api?
Topic:
UI Frameworks
SubTopic:
General