Using Swift/IOS/iPad Xcode. How to change button text programmatically post app start.
If the button text is X change it to Y.
Posts under iPad tag
125 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
Is there a way to acces the hostfile in iPhone/iPad?
if Yes, How can we edit a host file in iphone device?
I want to use the AirPrint API, which is a standard OS printing function, programmatically on an iOS application to print directly to a printer by specifying single-sided printing instead of double-sided printing for the first print after the OS is initialised.
〇Verification environment
・Device: iPad 9 generation
・OS:OS16.6
・Printer model: EPSON PX-S730 / Brother MFC-J7300CDW / Canon G5030 / EPSON PX-M791FT
※All printers used for verification support AirPrint and are capable of duplex printing.
〇Issue
The duplex printing option can be specified from the program using the AirPrint API property "duplex",
However, when printing is executed from the program, the specified print option "duplex printing" is not reflected in the AirPrint API.
〇Verification results
Installed the developed print verification app on the device in factory default state, and executed the print process from the app to the printer.
(1st time) Set the property "duplex printing" = duplex or single-sided in the AirPrint API of iOS → In both cases, printing was performed on both sides.
(2nd and subsequent times) Set the property "duplex printing" = duplex or single-sided in the AirPrint API of iOS → In both cases, printing is done on one side.
〇Source Code
The print verification application we developed uses the UIPrintInteractionController class in Swift to specify the printing options for duplex printing.
We believe we can specify this by setting "info.duplex = UIPrintInfo.Duplex.none" in the following source code and adding it to printInfo.
func buttonClick(_ sender: Any) {
let printController = UIPrintInteractionController.shared
let printInfo = UIPrintInfo(dictionary: nil)
printInfo.jobName = "PrintJob from PrintTestApp"
// color
printInfo.outputType = UIPrintInfo.OutputType.general
// duplex mode for the print
printInfo.duplex = UIPrintInfo.Duplex.none // set the single side option
printController.printInfo = printInfo
// PDF printing in project folder
printController.printingItem = Bundle.main.url(forResource: "sample", withExtension: "pdf")!
// printer settings
let printer = UIPrinter(url: URL(string: "ipps://XXXXXXX/ipp/print")!)
// direct printing
printController.print(to: printer, completionHandler: {
controller, completed, error in
guard error == nil else {
return
}
})
}
How to change button attributes in iOS swift programmatically after app starts.
I'm developing an app that connects and uses a USB device.
Is there a way to build and debug in Xcode with a USB device connected to an iPad or iPhone?
I tried connecting a USB hub to ipad, but Xcode didn't recognize it.
Using Devices
PC:mac mini M1
Soft:Xcode
ipad:ipad air(5th)
USB Device:MOTU M4(Audio Interface)
I did an automatic upgrade, plugged into Imac, and wifi active.
Now im stuck on "Press hom to upgrade".
After I press home, it asks for password and it does not accept any of my passwords.
Force restart does nothing.
Any ideas?
Oh and when I plug the iPad into the Imac, it tells me that new software is needed, but then it says no relevant software is available on the app store.
The 10th-Gen iPad differs from its predecessors by having a camera that's located at the top of its landscape orientation. This is a headache for me since my app needs to know the rough camera location given the device's orientation for AR purposes.
I can find out whether the device is a tablet or not, but I can't find out whether it's an iPad 10. Are there any direct or indirect ways for me to find out whether a camera is placed for portrait or landscape use?
my app was rejected by this reason:
While we appreciate that your app is intended primarily for use on iPhone, in order to bring your app into compliance with App Store guidelines, all apps designed for use on iPhone must still be formatted correctly and behave properly when run on iPad.
How can I solve this problem without adding iPad as a destination in Xcode.
I am creating a barcode reader using the AVfoundation framework for iOS and IPadOS. The read result goes into payloadstringvalue, but I want to check the control characters contained in the symbol, so I am using the raw data of the description, which is a property of NSObjectProtocol inherited by VNBarcodeObservation. However, I noticed that if the length set in the raw data exceeds 26, some of the raw data in the description is omitted. So my question is, is it possible to set it so that all the raw data in the description is written out without omitting any raw data? If so, could you please tell me how to set this up? Also, if you know of any other way to extract the raw barcode data, I would appreciate it if you could let me know.
Thank you.
I'm working on an .html file. On Safari iOS/iPad, when testing on my local web server I get correct values for window.innerHeight. However when uploading to a dev/prod environment innerHeight is incorrect (so the elements in the page do not fit the screen).
Testing on ipad air 3rd gen, IpadOS 16.5.1 I get these values for window.innerHeight :
local server, navigation bar only (landscape): 764 => correct
local server, navigation bar and tab bar (landscape): 731=> correct
dev/prod environment, navigation bar only (landscape): 795 => incorrect
dev/prod environment, navigation bar and tab bar (landscape): 795 => incorrect
I have a similar issue when testing on portrait. InnerHeight is bigger than it should be and doesn't change when the tab bar is open. QA team also tested on Iphones and gets the same issue.
Tried alternatives (visualViewport.height, 100vh, documentElement.clientHeight...they all are incorrect on a real environment)
Hi everyone,
I have an old iPad 2 which I want to reset but it has the "find my iPad" turned on; the problem is that if I try to insert the id apple password, it gives me a connection error. The device is connected to the internet, I tried the browser and it works.
I even tried to reset the iPad using the Mac, but it requires the iCloud password on the device... I turned off "find my iPad" on the iCloud website, but in order to be effective, the ipad needs to logging in on iCloud and I can't do it.
Are there other ways to achieve the reset?
Thank you so much
I have an iPhone VR app, but on the appstore page it says "Compatible with iPad". The full VR effect was only with the iPhone, but it's not showing that, nor is there any apparent way to set that in the metadata. So I am assuming that's automated. Any ideas how to fix it?
Hi, i develop and publish an application that is compatible only for iPhone, but the App Review test the application also on iPad, and then reject the application, then how is possible?
Hello,
When I try to install the iPadOS 17 public beta, my 32GB iPad says that it needs 13GB free to install the update! Is there a way to update to the beta without freeing up so much space? This is my main iPad so I don't want to reset it, but can I do it using Finder etc?
Bye!
Hi, I'd like to inquire about the LiDAR sensor specifications for the iPhone Pro and iPad Pro. We are currently developing a 3D scanner app for construction sites and need to ensure that LiDAR does not cause any damage to electrical or telecommunication devices.
I understand that LiDAR is a class 1 laser and considered safe for eye exposure. However, I'm concerned about its potential impact on electronics, such as noise or interference. For instance, could the LiDAR interfere with a fire alarm that uses a photon diode sensor, potentially leading to false alarms? I assume that fire alarms should have some form of shielding, but I am uncertain about this.
In my research, I came across some information about LiDAR specifications in this discussion thread: https://developer.apple.com/forums/thread/131013. Additionally, there were some relevant blogs discussing the type of sensor it uses: https://www.techinsights.com/ja/node/33570.
I also reached out to other manufacturers, as I believe ToF sensors might have similarities, but unfortunately, I haven't received a definitive answer yet.
Any assistance on this matter would be highly appreciated. Thank you.
How come keyboard shortcuts associated to toolbar items do not show up when you hold down the command key?
import SwiftUI
struct ContentView: View {
var body: some View {
NavigationStack {
VStack {
Image(systemName: "globe")
.imageScale(.large)
.foregroundStyle(.tint)
Text("Hello, world!")
Button {
} label: {
Text("Tap Me!")
}
.keyboardShortcut("o", modifiers: .command)
}
.padding()
.toolbar {
ToolbarItem {
Button {
} label: {
Image(systemName: "bolt")
}
.keyboardShortcut("k", modifiers: .command)
}
}
}
}
}
See screenshot. The shortcut for "Tap Me!" is being shown but not the one for the toolbar item. Am I doing something wrong or this is just not supported yet in SwiftUI? If that's the case, that seems to be a significant omission.
I am looking for a comparison chart between these three devices regarding what hardware each device support, showing every model of the devices.
We created iPhone app for portrait mode only. App is running fine in iPhone. but when we run the same app in iPad some time we are getting rotation button along with scale button. Rotation button is rotating app in landscape and our app is not support so UI is look bad. We want to disable rotation button forever. We search for setting which can be used enable/disable this rotation button but did not found. Check attached screen shot for reference.
Hey all!
Im trying to use my Ipad with my Xcode but its not working. Its saying "Failed to prepare device for development".Ive seen on sites where folks have said to reboot devices but thats not working for me. Also there is no 16.5 simulator that I can use for testing as well.
Does anyone have any suggestions, trying to correct an issue within my code so I can send it for review.
Blessings
hey! i have an ipad pro 11’ 2018, and everything was working fine until one day i wasn’t able to connect my apple pencil 2 to my ipad. the pencil itself gets detected it just won’t connect with my ipad. i already tried restarting, unpairing (even since i wasn’t able to pair it) and even restoring my ipad. does anyone have a solution for this?