Hi I think I found an issue with SwiftUI List on iOS 18.0 and 18.1
Using the ContentView from the code block below: if you try to drag and drop the globe image onto the blue rows, things work fine on both iOS 17 and 18 with either List or VStack.
However if you first drag and drop the image onto the Files app and then drag the newly created PNG file back into our app, it won't work on iOS 18 with the blue row inside the List. Also there's no visual feedback when hovering that blue row (unlike the one inside the VStack).
I've tried various view modifiers but no luck so far. Any help is appreciated.
Thank you.
FB15618535
struct ContentView: View {
var body: some View {
VStack {
Image(systemName: "globe")
.resizable()
.scaledToFit()
.frame(height: 100)
.draggable(Image(systemName: "globe"))
List {
Color.gray
.frame(height: 100)
Color.blue
.frame(height: 100)
.dropDestination(for: Image.self) { _, _ in
print("List dropped")
return true
}
}
VStack {
Color.gray
Color.blue
.dropDestination(for: Image.self) { _, _ in
print("VStack dropped")
return true
}
}
}
.padding()
}
}
Posts under iOS tag
200 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
I add the following info in the build settings of my app.
Then I also add the icon to my asset.
I build the app, it works normally, but I notice that when I changed the icon to 'AppIcon-Defaults', The icon change alert didn't appear. but it succeeds
.
I uploaded the archive to App Store I got:
ITMS-90895: Missing Icon - The Info.plist key CFBundleIcons.CFBundleAlternateIcons contains an entry “AppIcon-Defaults” that references asset “AppIcon-Defaults.” No such asset is present in the asset catalog.
Then I use xcrun --sdk iphoneos assetutil --info Assets.car to check the assets inside the archieved app, It have the asset.
Prior to iOS 18.1, App-prefs:Wallpaper deeplinked to the wallpaper settings. On iOS 18.1, it now deeplinks to the settings app. Is there a new URL to deeplink to the Wallpaper settings?
The following URLs have been tested and do not work on iOS 18.1:
App-prefs:Wallpaper
App-prefs:wallpaper
App-prefs:root=wallpaper
App-prefs:root=Wallpaper
App-prefs:root=WALLPAPER
App-prefs:root=General&path=Wallpaper
prefs:root=Wallpaper
I'm reaching out to see if anyone else is experiencing issues with the Live Caller ID feature on iOS. We recently encountered a problem where the feature stopped working entirely.
Here's a brief overview of the situation:
We were monitoring test traffic on our backend and noticed everything came to a halt around 1:00 AM UTC on November 15th.
After this time, any attempts to reach our backend through calls failed completely.
I tested this across multiple devices running iOS 18.2 and iOS 18.0.
I used both TestFlight builds and development builds via Xcode, which should communicate directly with our backend.
I experienced the problem on our main application as well as a dedicated test app.
To troubleshoot further, I even set up a local server on localhost and tried directing requests there, but the requests did not reach the local server when a call was received.
Further debugging in Console.app revealed the following error:
identity request returned error: Error Domain=com.apple.CipherML Code=400 "Error Domain=com.apple.CipherML Code=401 "Unable to request data by keywords batch: failed to fetch token issuer directory"
However, when I manually tried to hit our server endpoint using curl, the request successfully reached the server:
curl https://our_server/something
hb_method=GET hb_uri=/something [Hummingbird] Request -- log on backend
This suggests that while our backend is responsive, the requests from the iOS client side are simply not being initiated.
Hello. There seems to be a bug specifically in the iOS 18.2 (both Beta 1 and 2) and not seen in the previous versions.
The bug is: when LazyVGrid is nested inside NavigationStack and some elements of the LazyVGrid have animations, navigating into any nested view and then going back to the initial view with the LazyVGrid causes all animations to stop working.
Here is the example code inline:
struct ContentView: View {
@State private var count: Int = 0
var body: some View {
NavigationStack {
LazyVGrid(
columns: Array(
repeating: GridItem(spacing: 0),
count: 1
),
alignment: .center,
spacing: 0
) {
VStack {
Text(String(count))
.font(.system(size: 100, weight: .black))
.contentTransition(.numericText())
.animation(.bouncy(duration: 1), value: count)
Button("Increment") {
count += 1
}
NavigationLink(destination: { Text("Test") }, label: { Text("Navigate") })
}
}
}
.padding()
}
}
Once you run the application on iOS 18.2 Beta (I've tried on a real device only), the steps to reproduce are:
Tap on the "Increment button"
You should see the number change with an animation
Tap on the "Navigate" button
Tap "Back" to go to the initial screen
Tap "Increment" again
The number changes without an animation
I can confirm that this affects not only .contentTransition() animation but any animation within the LazyVGrid, I've tested this in my real app.
Let me know if I can provide more details. Thank you!
Have a rare crash in one of our framework which I am unable to figure out.
Attaching the crash log here. Any idea how to debug this to find the root cause?
Crash.crash
xcode16,iphone16,iOS 自定义navigationItemLeftBar,设置 navigationController?.interactivePopGestureRecognizer?.delegate = self,侧划返回一半,点击屏幕,界面卡死。
18系统之前的手机,或者非iphone16的手机没有问题。
I'm using NSPersistentCloudKitContainer to save, edit, and delete items, but it only works half of the time. When I delete an item and terminate the app and repoen, sometimes the item is still there and sometimes it isn't. The operations are simple enough:
moc.delete(thing)
try? moc.save()
Here is my DataController. I'm happy to provide more info as needed
class DataController: ObservableObject {
let container: NSPersistentCloudKitContainer
@Published var moc: NSManagedObjectContext
init() {
container = NSPersistentCloudKitContainer(name: "AppName")
container.loadPersistentStores { description, error in
if let error = error {
print("Core Data failed to load: \(error.localizedDescription)")
}
}
#if DEBUG
do {
try container.initializeCloudKitSchema(options: [])
} catch {
print("Error initializing CloudKit schema: \(error.localizedDescription)")
}
#endif
moc = container.viewContext
}
}
Hey,
There's like this darkish line on my iPhone and iPad when I open the Photos app. This scared the ding dong out of me the first time I saw it but then I realized in was a software issue when it disappeared as I swiped up to close the app. It's really weird because it's extremely faint but I can't seem to catch it in screenshots. I know for a fact this is a software issue because it doesn't show up in any other apps. It also changes from horizontal to vertical depending on how I turn my iPhone. Can everyone please just check your own iPhone or iPad to make sure I'm not the only one? I'm on the 18.2 developer beta by the way.
Thanks!
Hello
In the past, the documentation and specifically design guidelines were quite clear about the fact that having an exit button was not a good thing, and programmatically exiting the app was prohibited and ground to rejection by the review team.
Looking though the documentation and guidelines nowadays, I cannot find any explicit mention of this. We have a client that want us to add such button on the main menu of an app, and we are looking to hard evidence that this is against standards.
Has Apple stance on this changed ? Or have I missed it in the doc somewhere ?
In below Swift code , is there any possiblities of failure of Unmanaged.passRetain and Unmanaged.takeRetain calls ?
// can below call fail (constructor returns nil due to OS or language error) and do i need to do explicit error handling here?
let str = TWSwiftString(pnew)
// Increasing RC by 1
// can below call fail (assuming str is valid) and do i need to do explicit error handling for the same ?
let ptr:UnsafeMutableRawPointer? = Unmanaged.passRetained(str).toOpaque()
// decrease RC by 1
// can below call fail (assuming ptr is valid) ? and do i need to do explicit error handling
Unmanaged<TWSwiftString>.fromOpaque(pStringptr).release()
We've created a test app to highlight the problem: https://www.dropbox.com/scl/fi/3hl63t772qeguc1bxr9xi/Test.zip?rlkey=pofk3ji2s93ucq3r1l8m39z0u&dl=0
As you can see we have enforced exclusive touch in the init method, a solution which worked until iOS 18 which now doesn't work anymore.
How can we force exclusive touch on SwiftUI in iOS 18+?
Hello everyone,
I’m developing an alarm app in Swift 5, and I’m running into an issue with playing custom alarm sounds. Here’s the setup:
I’m using AVAudioPlayer to play a custom sound when the alarm goes off.
I’m triggering the alarm through a local notification, which works perfectly while the app is in the foreground.
However, when the app is in the background or the screen is locked, the custom alarm sound doesn’t play.
I’ve looked at other apps on the App Store, like Alarmy, which seem to play alarms even when the iPhone is locked or the app is in the background. I’m trying to achieve similar functionality but haven’t been successful.
If anyone has experience with creating alarm apps or has a workaround for playing sounds in the background/lock screen, I’d really appreciate your insights. Are there specific permissions or settings I need to enable, or a different approach to handling sound playback?
Thank you so much in advance for your help!
I have an audio app that can play audio on an AirPlay device.
On non-Apple TV devices, the AirPlay app (on Roku, Samsung, etc.) shows the now playing metadata: title, artist, and album art.
However, on tvOS 18.1, no metadata is shown. The Apple TV device plays the audio, but there is no now playing information shown, nor any other indicators.
Other media apps show the "Now Playing" controls on the upper right of the tvOS home screen.
Can someone point me in the direction of how to solve this issue? I think I am missing something somewhere in regards to the tvOS metadata implementation.
We're seeing sporadic crashes on devices running iOS 18.1 - both beta and release builds (22B83). The stack trace is always identical, a snippet of it below. As you can tell from the trace, it's happening in places we embed SwiftUI into UIKit via UIHostingController.
Anyone else seeing this?
4 libobjc.A.dylib 0xbe2c _objc_fatalv(unsigned long long, unsigned long long, char const*, char*) + 30
5 libobjc.A.dylib 0xb040 weak_register_no_lock + 396
6 libobjc.A.dylib 0xac50 objc_storeWeak + 472
7 libswiftCore.dylib 0x43ac34 swift_unknownObjectWeakAssign + 24
8 SwiftUI 0xeb74c8 _UIHostingView.base.getter + 160
9 SwiftUI 0x92124 _UIHostingView.layoutSubviews() + 112
10 SwiftUI 0x47860 @objc _UIHostingView.layoutSubviews() + 36
When attempting to fix an issue that is only happening on a specific iOS build I noticed that I am not able to install that specific build on my simulator. Is there any way to get specific iOS builds that are not available through Xcode?
Example: The bug I am trying to fix is only happening on 17.6.1 and 17.7.1. These specific builds are not available through Xcode.
Attempted Resolution: I found a iPhone14,5_17.6.1_21G101_Restore.ipsw file but was not able to import it into Xcode for use nor was I able to use it on a physical device.
What happened?
facing issue to upload on ios TestFlight xcode version 16 macOS 15.0
xcrun bitcode_strip -r platforms/ios/YourApp/Plugins/YourFramework.framework/YourFramework -o platforms/ios/YourApp/Plugins/YourFramework.framework/YourFramework
already tried bitcode_strip command but also that didn't work.
The following issues occurred while distributing your application.
Asset validation failed
Invalid Executable. The executable '***** Syndrome.app/Frameworks/OneSignal.framework/ OneSignal' contains bitcode. (ID: fda6a528-a835-4b16-8252-893d8d16acbd)
Steps to reproduce?
create build , upload it on testflight and you'll get error
OneSignal Cordova SDK version
Release 3.3.1
Which platform(s) are affected?
iOS
Hello!
I am trying to remove a photo from my Photos Library using PhotosUI. I run into this error when I attempt to delete it:
"Error returned from daemon: Error Domain=com.apple.accounts Code=7 "(null)""
No photos access scope requirements declared for changes
Failed to log access with error: access= accessor:<> identifier:82068C12-FD10-4DE2-9867-B4406FBFB706 kind:intervalEvent timestampAdjustment:0 visibilityState:0 assetIdentifierCount:0 accessCount:0 tccService:kTCCServicePhotos, error=Error Domain=NSCocoaErrorDomain Code=4097 "connection to service named com.apple.privacyaccountingd" UserInfo={NSDebugDescription=connection to service named com.apple.privacyaccountingd}
Hi,
I'm trying to create a UICollectionView where the cell high is automatic. Cells contains a UILabel with all anchors to the contentView of the cell.
It seems to work but I have a strange behavior with longer text, on reload data and on device rotation: Cells do not display the whole text or they change row, both randomly.
To create my collection view I first create the collection view with a custom flow layout setting the automatic size on viewWillAppear:
let collectionViewFlowLayout = CustomFlowLayout()
collectionViewFlowLayout.estimatedItemSize = UICollectionViewFlowLayout.automaticSize
collectionView = UICollectionView(frame: .zero, collectionViewLayout: collectionViewFlowLayout)
and I have also overridden:
override func willAnimateRotation(to toInterfaceOrientation: UIInterfaceOrientation, duration: TimeInterval) {
collectionView.setNeedsLayout()
self.collectionView.layoutIfNeeded()
self.collectionView.collectionViewLayout.invalidateLayout()
//self.collectionView.reloadData()
}
Then, I created the custom layout as follow:
import UIKit
final class CustomFlowLayout: UICollectionViewFlowLayout {
override func layoutAttributesForElements(in rect: CGRect) -> [UICollectionViewLayoutAttributes]? {
let layoutAttributesObjects = super.layoutAttributesForElements(in: rect)?.map{ $0.copy() } as? [UICollectionViewLayoutAttributes]
layoutAttributesObjects?.forEach({ layoutAttributes in
if layoutAttributes.representedElementCategory == .cell {
if let newFrame = layoutAttributesForItem(at: layoutAttributes.indexPath)?.frame {
layoutAttributes.frame = newFrame
}
}
})
return layoutAttributesObjects
}
override func layoutAttributesForItem(at indexPath: IndexPath) -> UICollectionViewLayoutAttributes? {
guard let collectionView = collectionView else {
fatalError()
}
guard let layoutAttributes = super.layoutAttributesForItem(at: indexPath)?.copy() as? UICollectionViewLayoutAttributes else {
return nil
}
layoutAttributes.frame.origin.x = sectionInset.left
if(indexPath.section == 0){
layoutAttributes.frame.size.width = collectionView.safeAreaLayoutGuide.layoutFrame.width - sectionInset.left - sectionInset.right
} else if (indexPath.section == collectionView.numberOfSections - 1){
let width = ScreenUtility.getCollectionCellWidthForElement(in: collectionView, sectionLeft: sectionInset.left, sectionRight: sectionInset.right, minimumInteritemSpacing: minimumInteritemSpacing, multiplier: 3)
layoutAttributes.frame.origin.x = ScreenUtility.getCollectionCellOriginForElement(in: collectionView, at: indexPath, forElementHavingWidth: width, sectionLeft: sectionInset.left, sectionRight: sectionInset.right, minimumInteritemSpacing: minimumInteritemSpacing, multiplier: 3)
layoutAttributes.frame.size.width = width
} else if (indexPath.section == collectionView.numberOfSections - 3) || (indexPath.section == collectionView.numberOfSections - 4){
let width = ScreenUtility.getCollectionCellWidthForElement(in: collectionView, sectionLeft: sectionInset.left, sectionRight: sectionInset.right, minimumInteritemSpacing: minimumInteritemSpacing)
layoutAttributes.frame.origin.x = ScreenUtility.getCollectionCellOriginForElement(in: collectionView, at: indexPath, forElementHavingWidth: width, sectionLeft: sectionInset.left, sectionRight: sectionInset.right, minimumInteritemSpacing: minimumInteritemSpacing)
layoutAttributes.frame.size.width = width
} else {
let width = ScreenUtility.getCollectionCellSizeForElementFullRow(in: collectionView, sectionLeft: sectionInset.left, sectionRight: sectionInset.right)
layoutAttributes.frame.origin.x = ScreenUtility.getCollectionCellOriginForElementFullRow(in: collectionView, sectionLeft: sectionInset.left, sectionRight: sectionInset.right)
layoutAttributes.frame.size.width = width
}
return layoutAttributes
}
}
And finally on collection view cells:
override func preferredLayoutAttributesFitting(_ layoutAttributes: UICollectionViewLayoutAttributes) -> UICollectionViewLayoutAttributes {
setNeedsLayout()
layoutIfNeeded()
let targetSize = CGSize(width: layoutAttributes.frame.width, height: 0)
layoutAttributes.frame.size = contentView.systemLayoutSizeFitting(targetSize, withHorizontalFittingPriority: .required, verticalFittingPriority: .fittingSizeLevel)
return layoutAttributes
}
override func prepareForReuse() {
self.nameLabel.text = ""
self.idLabel.text = ""
self.contentView.setNeedsLayout()
self.contentView.layoutIfNeeded()
}
Let me show you an example on the iPad that is the worst.
First Time I open the collection view I have cells on wrong rows and not sized properly
Then I rotate the device portrait and the cells are fine
On landscape again it changes behavior:
This is just an example, things happens apparently randomly, and also sometimes cells disappear (I think the height is set to 0).
I really do not understand why, cells width seems to be computed correctly, and cell label is set via setter:
open var step: String = "" {
didSet {
nameLabel.text = step
nameLabel.sizeToFit()
self.contentView.setNeedsLayout()
self.contentView.layoutIfNeeded()
}
}
Hi everyone,
I’m working on an iOS app and I need to implement background fetch to periodically update data even when the app is in the background. I’ve enabled Background Fetch in the capabilities, but I’m not sure how to properly set up the fetch intervals and ensure reliable data updates without draining too much battery.
What’s the best approach to set the frequency of background fetches?
Are there any specific best practices to optimize battery usage while using background fetch?
Is there a way to ensure the fetch runs more frequently for time-sensitive data?
Any advice or code examples would be greatly appreciated!
Thanks in advance for your help.