Post not yet marked as solved
I wanted to show count down timer in live activity. Since we can't use Timer in extensions, I used Text.init(timerInterval:pauseTime:countsDown:showsHours:) to show timer. But I need to show different text when the timer ends. How to achieve this behaviour?
Post not yet marked as solved
I attempted to utilize the Background Assets feature for an iOS app. While debugging, I employed the following command to trigger the installation event:
xcrun backgroundassets-debug -b <bundleID> -s --app-install -d <Device ID>
This command worked flawlessly on an iPhone.
However, when I attempted to trigger the installation event on a Mac, I encountered the following error message:
The requested device to send simulation events to is not available.
Verify that the device is connected to this Mac.
Please note that the xcrun backgroundassets-debug -l command only displays a list of connected devices.Mac is not listed in that list.
Post not yet marked as solved
I tried to add iOS 17 version check inside WidgetBundle but the widget extension keep on crashing .
Getting Thread 1: Swift runtime failure: Unexpectedly found nil while unwrapping an Optional value. After removing the iOS 17 check it works fine.
Is there any way to provide version check inside widgetBundle?
Post not yet marked as solved
Is it possible to get enabled status of app's live activity through areActivitiesEnabled inside other targets (other than main target)? seems it always returns true.
Post not yet marked as solved
I tried to implement interaction to live activity.Since we don't have force update like in widget, how to update the UI (like remove or add View) After performing the intent action.
Post not yet marked as solved
Hi I tried to use compositional layout, while using stage manager rare the app getting crashed. Please refer below error message
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid absolute dimension: inf. The dimension must be a finite value.'
let itemSize = NSCollectionLayoutSize(widthDimension: .absolute(cellWidth),heightDimension: .absolute(cellHeight))
let item = NSCollectionLayoutItem(layoutSize: itemSize)
let groupSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1), heightDimension: .absolute(cellHeight))
let group = NSCollectionLayoutGroup.horizontal(layoutSize: groupSize, subitems: [item])
group.interItemSpacing = NSCollectionLayoutSpacing.fixed(cellSpacing)
let section = NSCollectionLayoutSection(group: group)
section.contentInsets = NSDirectionalEdgeInsets(top: 10,leading: inset, bottom: 0,trailing:inset)
section.interGroupSpacing = lineSpacing
Why am I getting this error after providing exact height and width?
Post not yet marked as solved
Hi , i tried to download image using background assets framework. I tried to use install and update events to test the extension. But the extension always delegate to backgroundDownload(_ :failedWithError :) function with following error
Error Domain=BAErrorDomain Code=202 "The requested URL is not permitted to be downloaded until the application is launched." UserInfo={NSLocalizedFailureReason=The requested URL is not permitted to be downloaded until the application is launched.}
I used the following url to download the image https://w0.peakpx.com/wallpaper/934/165/HD-wallpaper-avatar-aang-aang-airbender-aire-appa-avatar-legend-leyenda.jpg
Why am i getting this error and how to resolve this?
Post not yet marked as solved
Hi folks,
I tried to use apple's text recognition feature by using UIAction.captureTextFromCamera(responder:identifier:). It works fine in iPhone and iPad 3rd Gen. But in iPad 4th Gen the action is not get triggered. Kindly provide assistance .
if #available(iOS 15.0, *), self.canPerformAction(#selector(captureTextFromCamera(_:)), withSender: self) {
let cameraAction = UIAction.captureTextFromCamera(responder: self, identifier: nil)
let cameraButton = UIButton(type: .custom)
cameraButton.addAction(cameraAction, for: .touchUpInside)
cameraButton.setTitle("Scan-Text", for: .normal)
view.addSubview(cameraButton)
// Then set constraints
}
_Note: The button to trigger the action is visible only the action is not get triggered.
_
Device specs:
Name: iPad Air 4th Gen
Os : iOS 16
Post not yet marked as solved
Hi, i'm new to ios development. Can someone give some example to how to use the Metacharacters in RegularExpression pattern?
var regex = try! NSRegularExpression(pattern: "[\D]", options:[])
this shows invalid escape sequence in literal error