Hello,
I have an app in AppStore "Counter Widget". https://apps.apple.com/app/id1522170621
It allows you to add a widget to your homescreen/lockscreen to count anything.
Everything works fine except for one scenario. iOS 18+
I create 2 or more widgets for one counter. For example, medium and small widgets.
I click on the widget button to increase or decrease the value.
The button in the widget uses Button(intent: AppIntent) to update the value and calls WidgetCenter.shared.reloadAllTimelines() to update the second widget for the same counter.
For iOS 18 in this particular scenario, you don't even have to call the WidgetCenter.shared.reloadAllTimelines(). iOS already knows that there is a widget with the same INIntent settings and will update it itself.
Both widgets are updated and show the new value. Everything is correct.
Now on the homescreen I open the widget configuration for one of the widgets to change the INIntent for the widget. For example, i change the background to wallpaper. This is just a skin for the widget, and the widget is associated with the same counter value as before.
As in (2), I click the widget button to increase or decrease the value.
But now only one widget is updated. iOS ignores my call to WidgetCenter.shared.reloadAllTimelines() and does not update the second widget connected to the same counter.
As I found, iOS, when I call WidgetCenter.shared.reloadAllTimelines() from the widget itself, updates other widgets only if INIntent is absolutely equal for them.
Overriding isEqual for them did not help. That is, I cannot specify which fields from my INIntent can be ignored during such an update and consider that widgets are equal and need to be updated. Obviously iOS make this compare outside my code.
The main problem is that when the user adds a widget to the lock screen and increases and decreases the value there. After that, he opens the home screen and the widget there is not synchronized with the value from the widget on the lock screen.
How to solve this problem?
Posts under iOS tag
200 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
I updated to iOS 18.2 beta 2, and with it, I am able to see behind the early access requested by just swiping down, but when I do swipe down, the app closes. Does this mean I'm close to getting access?
Hi Apple Engineers,
I am encountering an issue where the memory usage reported by the Xcode memory report and the Xcode Instruments memory profiler are not aligned. Specifically:
Xcode Memory Report:
After implementing autoreleasepool, URLSession reading a zip file, and moving the task inside DispatchQueue.global().async, the memory usage goes down from 900MB to 450MB, indicating a potential memory leak.
Xcode Instruments Memory Profiler:
The memory usage goes down from 900MB to 100MB, suggesting that the memory has been properly released and there is no significant memory leak.
Could you please help me understand the discrepancy between these two tools and provide guidance on the appropriate way to interpret the memory usage in my application? Which result I should rely on it?
I would greatly appreciate your insights and expertise on this matter. Thank you in advance for your assistance.
Hello, Apple developers. I have joined the MFi certification program. My Accessory to use USB HID IAP2 communication protocol and IOS devices connected, but in the first step, the Accessory to send the following data (0 XFF, 0 x55, 0 x02, 0 x00 to 0 xee, 0 x10) for IOS devices, but the IOS devices have no response, this is probably the reason why?
I have this code to make ARVR Stereo View To Be Used in VR Box Or Google Cardboard, it uses iOS 18 New RealityView but it is not Act as an AR but rather Static VR on a Camera background so as I move the iPhone the cube move with it and that's not suppose to happen if its Anchored in a plane or to world coordinate.
import SwiftUI
import RealityKit
struct ContentView : View {
let anchor1 = AnchorEntity(.camera)
let anchor2 = AnchorEntity(.camera)
var body: some View {
HStack (spacing: 0){
MainView(anchor: anchor1)
MainView(anchor: anchor2)
}
.background(.black)
}
}
struct MainView : View {
@State var anchor = AnchorEntity()
var body: some View {
RealityView { content in
content.camera = .spatialTracking
let item = ModelEntity(mesh: .generateBox(size: 0.25), materials: [SimpleMaterial()])
anchor.addChild(item)
content.add(anchor)
anchor.position.z = -1.0
anchor.orientation = .init(angle: .pi/4, axis:[0,1,1])
}
}
}
the thing is if I remove .camera like this
let anchor1 = AnchorEntity()
let anchor2 = AnchorEntity()
It would work as AR Anchored to world coordinates but on the other hand is does not work but on the left view only not both views
Meanwhile this was so easy before RealityView and SwiftUI by cloning the view like in ARSCNView Example :
import UIKit
import ARKit
class ViewController: UIViewController, ARSCNViewDelegate, ARSessionDelegate {
//create Any Two ARSCNView's in Story board
// and link each to the next (dont mind dimensions)
@IBOutlet var sceneView: ARSCNView!
@IBOutlet var sceneView2: ARSCNView!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
sceneView.delegate = self
sceneView.session.delegate = self
// Create SceneKit box
let box = SCNBox(width: 0.1, height: 0.1, length: 0.1, chamferRadius: 0.01)
let item = SCNNode(geometry: box)
item.geometry?.materials.first?.diffuse.contents = UIColor.green
item.position = SCNVector3(0.0, 0.0, -1.0)
item.orientation = SCNVector4(0, 1, 1, .pi/4.0)
// retrieve the ship node
sceneView.scene.rootNode.addChildNode(item)
}
override func viewDidLayoutSubviews() // To Do Add the 4 Buttons
{
// Stop Screen Dimming or Closing While The App Is Running
UIApplication.shared.isIdleTimerDisabled = true
let screen: CGRect = UIScreen.main.bounds
let topPadding: CGFloat = self.view.safeAreaInsets.top
let bottomPadding: CGFloat = self.view.safeAreaInsets.bottom
let leftPadding: CGFloat = self.view.safeAreaInsets.left
let rightPadding: CGFloat = self.view.safeAreaInsets.right
let safeArea: CGRect = CGRect(x: leftPadding, y: topPadding, width: screen.size.width - leftPadding - rightPadding, height: screen.size.height - topPadding - bottomPadding)
DispatchQueue.main.async
{
if self.sceneView != nil
{
self.sceneView.frame = CGRect(x: safeArea.size.width * 0 + safeArea.origin.x, y: safeArea.size.height * 0 + safeArea.origin.y, width: safeArea.size.width * 0.5, height: safeArea.size.height * 1)
}
if self.sceneView2 != nil
{
self.sceneView2.frame = CGRect(x: safeArea.size.width * 0.5 + safeArea.origin.x, y: safeArea.size.height * 0 + safeArea.origin.y, width: safeArea.size.width * 0.5, height: safeArea.size.height * 1)
}
}
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
let configuration = ARWorldTrackingConfiguration()
sceneView.session.run(configuration)
sceneView2.scene = sceneView.scene
sceneView2.session = sceneView.session
}
}
And here is the video for it
I'll describe my crash with an example, looking for some insights into the reason why this is happening.
@objc public protocol LauncherContainer {
var launcher: Launcher { get }
}
@objc public protocol Launcher: UIViewControllerTransitioningDelegate {
func initiateLaunch(url: URL, launchingHotInstance: Bool)
}
@objc final class LauncherContainer: NSObject, LauncherContainer, TabsContentCellTapHandler {
...
init(
...
) {
...
super.init()
}
...
//
// ContentCellTapHandler
//
public func tabContentCellItemDidTap(
tabId: String
) {
...
launcher.initiateNewTabNavigation(
tabId: tabId // Crash happens here
)
}
public class Launcher: NSObject, Launcher, FooterPillTapHandler {
public func initiateNewTabNavigation(tabId: String) {
...
}
}
public protocol TabsContentCellTapHandler: NSObject {
func tabContentCellItemDidTap(
tabId: String,
}
Crash stack last 2 lines are- libswiftCore.dylib swift_unknownObjectRetain libswiftCore.dylib String._bridgeToObjectiveCImpl()
String._bridgeToObjectiveCImpl() gets called when the caller and implementation is in Swift file
I believe due to @objc class LauncherContainer there'd be bridging header generated. Does that mean tabId passed to tabContentCellItemDidTap is a String but the one passed to initiateNewTabNavigation is NSString?
TabId is UUID().uuidString if that helps. Wondering if UUID().uuidString has something to do with this.
Thanks a ton for helping. Please find attached screenshot of the stack trace.
Our app experience the strange crash,causing the app to not launch.This crash suddenly began to happen on October 25. At present, all the Hardware Model of mobile phones that occurred were on iPhone17,1 and the iOS system version was iOS18.0.1. This crash was all from users on the appstore, and was collected via Xcode - Organizer - > Crashes. I've attached the crash report.Thanks
Distributor ID: com.apple.AppStore
Hardware Model: iPhone17,1
Process: XxxxxxXXX [31230]
Path: /private/var/containers/Bundle/Application/6E9E07EA-B7A4-4D57-B419-743DDCF7C3A6/XxxxxxXXX.app/XxxxxxXXX
Identifier: com.XxxxxxXXX.XxxxxxXXX
Version: 8.1.10 (811001)
AppStoreTools: 16A242d
AppVariant: 1:iPhone17,1:18
Code Type: ARM-64 (Native)
Role: unknown
Parent Process: launchd [1]
Coalition: com.XxxxxxXXX.XxxxxxXXX [8069]
Date/Time: 2024-10-31 03:30:38.7437 +0800
Launch Time: 2024-10-31 03:30:38.7415 +0800
OS Version: iPhone OS 18.0.1 (22A3370)
Release Type: User
Baseband Version: 1.00.00
Report Version: 104
Exception Type: EXC_CRASH (SIGKILL)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Termination Reason: GUARD 5
Triggered by Thread: 0
Thread 0 Crashed:
0 dyld 0x00000001b2da32b0 lsl::PreallocatedAllocatorLayout<278528ull>::init(char const**, char const**, void*) + 436 (Allocator.h:537)
1 dyld 0x00000001b2d9ca38 start + 1960 (dyldMain.cpp:1289)
Thread 0 crashed with ARM Thread State (64-bit):
x0: 0x2010003030100000 x1: 0x0000000fffffc0d0 x2: 0x0000000000000002 x3: 0x00000001b2d717ab
x4: 0x0000000000000000 x5: 0x0000000000000000 x6: 0x0000000000000000 x7: 0x0000000000000000
x8: 0x2010003030100000 x9: 0x2010003030100000 x10: 0x000000016d1dbdfb x11: 0x00000001b2dddf30
x12: 0x0000000000000050 x13: 0x0000000000000044 x14: 0x0000000000052010 x15: 0x0000000000000000
x16: 0x0000000000000000 x17: 0x0000000000000000 x18: 0x0000000000000000 x19: 0x000000018a7e0000
x20: 0x000000016d1dbb30 x21: 0x000000016d1dbad0 x22: 0x00000001f0794050 x23: 0x000000016d1db7b8
x24: 0x0000000fffffc10c x25: 0x0000000000000000 x26: 0x0000000000000000 x27: 0x0000000000000000
x28: 0x0000000000000000 fp: 0x000000016d1db850 lr: 0x00380001b2da3130
sp: 0x000000016d1db7b0 pc: 0x00000001b2da32b0 cpsr: 0x60000000
esr: 0x92000047 (Data Abort) byte write Translation fault
Binary Images:
0x102c24000 - 0x1056d3fff main_executable_path_missing arm64 <086a82c13b863f4485895baddc3144ba> /main_executable_path_missing
0x1b2d69000 - 0x1b2dec693 dyld arm64e <5db839882ee63756bd07b8d67b1133a5> /usr/lib/dyld
EOF
2024-10-26_17-41-58.4222_+0800-841f6bdf4b2d436606ce55595ffc94d64e9af744.crash
2024-10-26_19-44-40.1115_+0800-7d4d654c76a10108b431acc612d6063b1edb1c3e.crash
2024-10-27_17-12-02.4926_+0800-6a4b6ec4cff928cf746162b9371a3176c3667c21.crash
2024-10-28_21-42-02.6780_+0800-c66c71c13414e7ff14ba783c883730c1361523b5.crash
2024-10-29_05-47-00.3943_+0800-ac7c1f5b6caf9aa97d71744a8f980c32d47eab80.crash
2024-10-31_03-30-38.7437_+0800-e1c54dc8879f97932cbb1520a04210bea6d7aaf4.crash
2024-11-03_07-57-18.8892_+0800-c7704569afc79ce50ac10b66e185de87425b1969.crash
2024-11-03_08-27-19.0514_+0800-c069e2f8dfa6767b8e301513aff3c3a7ea331e2c.crash
I created an intent for a configurable widget that lets users choose an option for a parameter called "domain."
I've successfully loaded the selectable items for this parameter using the following code:
import Intents
class IntentHandler: INExtension, ConfigChartIntentHandling {
func provideDomainOptionsCollection(for intent: ConfigChartIntent) async throws -> INObjectCollection<Domain> {
let prefs = UserDefaults(suiteName: "group.name")
let domains = prefs?.stringArray(forKey: "domains")
if let domains {
let optionsCollection = domains.map { Domain(identifier: $0, display: $0) }
return INObjectCollection(items: optionsCollection)
} else {
// If no options, provide an empty list or a default option
return INObjectCollection(items: [])
}
}
}
The issue occurs when I select a value for the "domain" parameter. Each time I select a value and then reopen the configuration modal, the field reverts back to "Choose." Here's a screenshot illustrating the behavior:
Additionally, the widget doesn’t refresh after I change the "domain" value. However, another parameter using an enum ("Stats Type") works as expected.
Is there something I might be missing?
My Environment:
MacOS Sonoma
XCode 15.4
If I have an XCode project that generates a framework when built, then I've noticed that its possible to add new additional targets to the project of type app extension.
However if I add some source code to an app extension and regenerate the framework, then that source code is not accessable from the resulting framework (i.e. if the framework is included into an app, then the app code doesn't have visibility of the code that was added to the extension in the framework).
Is this something which is possible to achieve? Ideally I would like to package the main source code that constitutes the framework content, along with the source code for a few extensions into a single framework, so that the app(s) that use the framework can include the framework into their main app target and also include it in the app extension target.
I noticed that if the scheme of the framework is changed to the extension before building, then the result is not a .framework file but a .appex file.
For client apps of the framework, can they directly include/use that .appex file?
If so how can that be achieved? Does
I've got a few years old app which was created using an Xcode template type of app.
I'd like to split the model part of the code (model as in model-view-controller) out into a framework.
Removed the view/controller source files to leave the model code is quick and easy, however the model code is large and complex with a couple of hundred of source files.
Rather than create a new Xcode template type of framework and move the source files into there, is it possible to simply just change the template type of the existing project from app to framework?
Hello, Team.
We used WKWebView for our project. We loaded the HTML file into the webview and added the following configuration.
weak var webView: WKWebView!
func configWebView() {
let webViewConfig = WKWebViewConfiguration()
let controller = WKUserContentController()
controller.add(self, name: "sometest")
webViewConfig.userContentController = controller
webViewConfig.processPool = WKProcessPool()
webViewConfig.setValue(true, forKey: "allowUniversalAccessFromFileURLs")
webViewConfig.mediaTypesRequiringUserActionForPlayback = []
let webpagePreferences = WKWebpagePreferences()
webpagePreferences.allowsContentJavaScript = true
webViewConfig.defaultWebpagePreferences = webpagePreferences
webViewConfig.websiteDataStore = WKWebsiteDataStore.default()
webView = WKWebView(frame: .zero, configuration: webViewConfig)
webView.navigationDelegate = self
webView.uiDelegate = self
webView.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(webView)
NSLayoutConstraint.activate([
webView.topAnchor.constraint(equalTo: view.topAnchor),
webView.bottomAnchor.constraint(equalTo: view.bottomAnchor),
webView.leadingAnchor.constraint(equalTo: view.leadingAnchor),
webView.trailingAnchor.constraint(equalTo: view.trailingAnchor)
])
loadWebView()
}
func loadWebView() {
guard let documentsDirectoryURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first else {
return
}
let contentFolderURL = documentsDirectoryURL.appendingPathComponent("content")
let assetFolderURL = contentFolderURL.appendingPathComponent(interactiveGUID)
if FileManager.default.fileExists(atPath: assetFolderURL.path) {
let documentsPath = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first!
let documentsURL = URL(fileURLWithPath: documentsPath)
let fileToLoadPath = (documentsPath as NSString).appendingPathComponent("content/index_p.html")
let fileURL = URL(fileURLWithPath: fileToLoadPath)
autoreleasepool {
DispatchQueue.main.async { [weak self] in
guard let self = self else { return }
self.webView.loadFileURL(fileURL, allowingReadAccessTo: documentsURL)
}
}
}
We are experiencing webview crashes when loading an HTML file. What happened when I loaded the video file? It automatically looped. Webview frequently crashes when the HTM/JS file is loaded.
When a webview crashes, the delegate method usually calls webViewWebContentProcessDidTerminate. This method calls webview.reload().
Also we are clear and cache/ deallocate eveything when i initialized those configuration mentioned as the above.
Can you suggest a solution to this? Why is webview crashing?
Thank you.
Dear Apple Support Team,
I hope this message finds you well.
I am writing to report an issue I have encountered with Wi-Fi connectivity on my iPhone 16 series running iOS 18.0. The problem occurs as follows:
When attempting to connect my iPhone 16 series (iOS 18.0) to a Wi-Fi network, the connection always fails.
After this failed attempt, any other iPhone (not from the 16 series) running iOS 18.0 also fails to connect to the same Wi-Fi network.
However, if I restart the Wi-Fi router, the non-iPhone 16 series devices can successfully connect to the Wi-Fi network.
To further investigate, I used Wireshark to monitor the network traffic. I observed that the iPhone sends a DHCP Discover message, but the Wi-Fi router does not respond with a DHCP Offer message.
Based on these observations, it appears that the issue is triggered by the iPhone 16 series running iOS 18.0, which causes the Wi-Fi router to malfunction and prevents other devices from connecting.
Additionally, I have tried all the steps listed on the following site, but the issue persists: https://support.apple.com/en-us/111786
Could you please investigate this issue and provide guidance on how to resolve it? If this is a known bug, is there a planned update to address it?
Thank you for your assistance. I look forward to your prompt response.
Best regards,
WJohn
I am working in Carrier app i want to check sim change event in my iOS app. please guide me how i can get sim change event. Thanks
I'm unable to pair my Apple Watch Ultra (watch os 11.1 GA) onto Ios 18.2 beta 2 (had same issue with beta 1). I get a Phone out of date Error and was wondering if someone had a workaround.
I tried backing up my phone, restoring on a 18.1 GA phone and tried to pair there (in hopes of later restoring backup on 18.2 b2) but I got the same error on 18.1 after the restore; I'm guessing somewhere in the backup it incorrectly restores the iOS version. I am able to pair watch on a non restored 18.1.
HELP!
I’ve had the beta and been signed up since October 23rd. Still sitting on early access requested. It’s a 16PM. My son has my old 15PM he downloaded the 18.2 beta 4 days ago and requested access and he already has it. So is it a lottery system or only certain phone models at a given time? Anyone else have the same issue?
Thanks in advance,
Jeremy
Since iOS 18.1.0 I have the problem that a sheet is automatically dismissed when the system alert for the location permission is displayed. Can anyone help me?
I want to expose few elements for accessibility alone and other for automation alone. But I can only accessibility elements in Accessibility Inspector but can't see Automation Elements
self.view.accessibilityElements = [loginButton as Any,
registerButton as Any,
closeButton as Any]
self.view.automationElements = [claimLabel as Any,
loginButton as Any,
registerButton as Any,
intoductionImage as Any,
closeButton as Any])
When I try to delete an iPhone 16 Pro iOS 18.1 Simulator in XCode 16.1, I get an error message "“data” couldn’t be moved because you don’t have permission to access “Deleting-8366D3CC-37EC-49C0-8674-0599BCE1DA12”.". I had that same issue with iOS 18.0 Simulator but never with previous versions (17.5).
Note that I'm stuck using the iOS 18.1 Simulator because iCloud synchronization is paused (potentially due to low data mode).
And I cannot use iOS 18.0 Simulator as well because unit tests run hangs for some other mysterious reason.
The fallback to iOS 17.5 Simulator is not satisfactory.
I have been working on a mobile app that I would like to upload on Apple console - pre order. The criteria for this is pretty much unclear. My team wants to use this pre order link for marketing, now I would like to know if I can publish a unfinished app on pre order to use it as marketing and then upload the completed app once we want to go live.
Please explain what should be the criteria, also can the app be uploaded it we only have the completed front-end
Hi Team,
We have noticed a behavioral change in iOS 18 related to SCEP profile downloads from the browser.
In current flow, we are using Cisco ISE as SCEP server.
While testing in iOS 18, we have observed that before communicating to SCEP server iOS is asking to download the SCEP server certificate.
This differs from iOS 17.4, where the communication happens seamlessly without any new prompts.
Could you please confirm if this certificate download popup behavior is expected in iOS 18?
Additionally, we would appreciate any guidance on whether this change in likely to persist in future updates, as it impacts our user flow.
Please let us know where we can attach video recordings of previous and current processes.
Thanks