Post not yet marked as solved
Hello,
I am trying to make a func in a Photowidget of indent configuration that can select photo from the user library as a timeline entry.
But, it is showing error for doing that.
Here, I am attaching the screenshot for that code.
Please can you guys help me for to solve that issue.
Thanks,
Jayesh Patel.
struct ReInventingMemoriesView : View
{
@State var Photo: UIImage?
let configuration: ReInventingMemoriesIntent
var iCloudPhotosEnabled:Bool
var entry: Provider.Entry
let intent = ReInventingMemoriesIntent()
let kind: String = "ReInventingMemories"
var body: some View {
func SelectPhoto() {
if (Photo != nil || iCloudPhotosEnabled = .true) {
ForEach(Photo.PHPhotoLibrary, id:\.self) { Photo in
INSearchForPhotosIntentIdentifier.random(count(1))
}
}
.clipShape(RoundedRectangle(cornerRadius: 20))
.scaleEffect(WidgetSize.scaleFactor)
.stroke(lineWidth: 2)
.shadow(radius: 5)
.overlay {
if true {
Image(systemName: "My Memories")
}
}
}
}
}
Post not yet marked as solved
Please Change It Because The New Arabic Font Of iOS15 Is Very Annoying And Restore The iOS 11 Font
Post not yet marked as solved
To speed up the review of my application, please administrator bother with thanks
Post not yet marked as solved
Hi Folks,
I am building a SwiftUI based WatchOS app primarily focused on updating a complication using data from a REST API call.
I am trying to reproduce the approach to updating complications in the background as described in "Keeping your complications up to date".
The trouble I have is that the func handle(_ backgroundTasks: Set<WKRefreshBackgroundTask>) method on the ExtensionDelegate is never called for the WKURLSessionRefreshBackgroundTask task type. The handle method is invoked for other task types such as WKSnapshotRefreshBackgroundTask.
After some refactoring, I have deviated from the approach in the video and I now reshedule the background task in the func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) method of the URLSessionDownloadDelegate.
This works fine, and the tasks are being resheduled in the background, but my concern is that there maybe a WKURLSessionRefreshBackgroundTask object lurking in the background for which I haven't called setTaskCompletedWithSnapshot.
My session is configured as follows:
private lazy var backgroundURLSession: URLSession = {
let appBundleName = Bundle.main.bundleURL.lastPathComponent.lowercased().replacingOccurrences(of: " ", with: ".")
let sessionIdentifier = "com.gjam.liffeywatch.\(appBundleName)"
let config = URLSessionConfiguration .background(withIdentifier: sessionIdentifier)
config.isDiscretionary = false
config.sessionSendsLaunchEvents = true
config.requestCachePolicy = .reloadIgnoringLocalCacheData
config.urlCache = nil
return URLSession (configuration: config, delegate: self , delegateQueue: nil )
}()
and the scheduling code is a follows:
func schedule(_ first: Bool) {
print("Scheduling background URL session")
let bgTask = backgroundURLSession.downloadTask(with: LiffyDataProvider.url)
#if DEBUG
bgTask.earliestBeginDate = Date().addingTimeInterval(first ? 10 : 60 * 2)
#else
bgTask.earliestBeginDate = Date().addingTimeInterval(first ? 30 : 60 * 60 * 2)
#endif
bgTask.countOfBytesClientExpectsToSend = 200
bgTask.countOfBytesClientExpectsToReceive = 1024
bgTask.resume()
print("Task started")
backgroundTask = bgTask
}
Does anyone have any idea's why the handle method is not invoked with WKURLSessionRefreshBackgroundTask tasks?
Cheers,
Gareth.
Post not yet marked as solved
Hi there,
I'm working on the development of iOS widgets and I'm looking to understand more about their limitations when it comes to controlling a product directly from the widget through a 3rd party app.
My goal is to have a widget on the Today view and Homescreen that the user can use to control a digital product without entering the related App.
I've seen some examples of widgets that do this in the Today view. But so far I haven't seen any in the Homescreen.
Is this possible and what are the restrictions when it comes to building a widget?
Thanks,
Lewis.
Post not yet marked as solved
Rosetta and Rosetta 2 do not appear to be available. All attempts to execute the Intel code failed with the "zsh: bad CPU type in executable" message. Since I wasn't prompted to install Rosetta or Rosetta 2, I executed the following,
% softwareupdate --install-rosetta
which responded with
I have read and agree to the terms of the software license agreement. A list of Apple SLAs may be found here: http://www.apple.com/legal/sla/ Type A and press return to agree:
So, I typed the A and the return. The result was
2021-10-03 04:31:49.497 softwareupdate[1775:240889] Package Authoring Error: 071-97390: Package reference com.apple.pkg.RosettaUpdateAuto is missing install KBytes attribute Install of Rosetta 2 finished successfully
Although the message ended with "finished successfully", note the error disclosed. Furthermore, the behavior of my M1 Mac running Big Sur 11.6 did not change, i.e. my Intel-based Mac executables still failed to execute.
So, what can be done?
Post not yet marked as solved
Do I need to check Intent is eligible for Siri Suggestions before donate it with INInteraction? But I only want to donate this intent so Siri can add my widget to Smart Stack, not in Lock Screen or other places.
Intent Definition:
Intent is eligible for widgets
Intent is user-configurable in the Shortcuts app and Add to Siri
Intent is eligible for Siri Suggestions
Donate Intent:
let widgetIntent = MyWidgetConfigurationIntent()
widgetIntent.range = .weekly // Configure my intent
let interaction = INInteraction(intent: intent, response: nil)
interaction.donate { error in
if let error = error {
// Error: Code=1901 "Cannot donate interaction with intent that has no valid shortcut types"
}
}
Post not yet marked as solved
Hi,
on Monterey:
when a Bluetooth mouse is present, I can disable the trackpad.
But when I unplugged the Bluetooth mouse, the trackpad is off.
How to solve it? Thanks.
Post not yet marked as solved
We are looking to test whether the widgets in our app are inserting into the smart stack when the widget suggestion was enabled.
We have enabled the "Intent is eligible for widgets" and "Intent is eligible for Siri Suggestions" in the widget's Intent definition file as suggested and donated the intents to the system(tried both INInteraction and INRelevantShortcut).
Also, we have enabled the "WidgetKit Development Mode" in the device Developer settings. But still, the widget is not inserted into the stack.
Note: We have tried this in Xcode 13 beta 3 (with iOS 15.0 beta 3).
Post not yet marked as solved
Hi,
My macbook pro mid 2014 is freezing again and again. Sometimes on login screen and sometime after logging in.
I tried booting in safe mode, no freezing happens.
I tried running diagnostics, ressetted the SMC, resetted PRAM/NVRAM.
Nothing seems to work.
Please help.