WWDC | WWDC session videos | Frontend Framework library
kandi X-RAY | WWDC Summary
kandi X-RAY | WWDC Summary
Presenters: Example Guy, Another Person.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of WWDC
WWDC Key Features
WWDC Examples and Code Snippets
Community Discussions
Trending Discussions on WWDC
QUESTION
I have a record type that is in both the Public database configuration schema and the private database configuration schema.
when I write a record type using the PersistentStore.shared.context it writes the record to both the private database and the public database. When I query the record type using @FetchRequest, it returns the records from both the public and private database.
How do I write or read to just the public or just the private database?
My PersistentStore Stack is basically a copy paste from apples WWDC code:
...ANSWER
Answered 2022-Mar-24 at 07:42You can use assign to choose what store to save the new object to
https://developer.apple.com/documentation/coredata/nsmanagedobjectcontext/1506436-assign
For requests from/to a certain store you can use affectedStores
https://developer.apple.com/documentation/coredata/nsfetchrequest/1506518-affectedstores
Note you might have better luck creating 2 configurations in your model editor for public and private and assigning a different entity to each. Then it automatically saves and fetches from the entity’s corresponding store.
QUESTION
Xcode 13.2 Beta release notes features a promise for Swift Concurrency support for iOS 13.
You can now use Swift Concurrency in applications that deploy to macOS 10.15, iOS 13, tvOS 13, and watchOS 6 or newer. This support includes async/await, actors, global actors, structured concurrency, and the task APIs. (70738378)
However, back in Summer 2021 when it first appeared at WWDC it was hard constrained to be run on iOS 15+ only.
My question is: what changed? How did they achieve backwards compatibility? Does it run in any way that is drastically different from the way it would run in iOS 15?
...ANSWER
Answered 2021-Oct-28 at 14:06Back-deploying concurrency to older OS versions bundles a concurrency runtime library along with your app with the support required for this feature, much like Swift used to do with the standard library prior to ABI stability in Swift 5, when Swift could be shipped with the OS.
This bundles parts of the Concurrency portions of the standard library (stable link) along with some additional support and stubs for functionality (stable link).
This bundling isn't necessary when deploying to OS versions new enough to contain these runtime features as part of the OS.
Since the feature on iOS 15+ (and associated OS releases) was stated to require kernel changes (for the new cooperative threading model) which themselves cannot be backported, the implementation of certain features includes shims based on existing functionality which does exist on those OSes, but which might perform a little bit differently, or less efficiently.
You can see this in a few places in Doug Gregor's PR for backporting concurrency — in a few places, checks for SWIFT_CONCURRENCY_BACK_DEPLOYMENT
change the implementation where some assumptions no longer hold, or functionality isn't present. For example, the GlobalExecutor
can't make assumptions about dispatch_get_global_queue
being cooperative (because that threading model doesn't exist on older OSes), so when backporting, it has to create its own queue for use as the global cooperative queue. @objc
-based actors also need to have their superclass swizzled, which doesn't need to happen on non-backdeployed runtimes. (Symbols also have to be injected in some places into the backdeploy libs, and certain behaviors have to be stubbed out, but that's a bit less interesting.)
Overall, there isn't comprehensive documentation on the exact differences between backdeploying and not (short of reading all of the code), but it should be safe to assume that the effective behavior of the backdeployed lib will be the same, though potentially at the cost of performance.
QUESTION
I am following Stanfords' CS193p Developing Apps for iOS online course.
It is using the Grand Central Dispatch (GCD) API for a demo of multithreading. But they noted, that
"GCD has been mostly replaced by Swift's new built-in async API as of WWDC 2021".
So I wanted to learn how the code from the Lecture would look like after updating it to use this new API.
After watching Apple's WWDC videos, it seems to me like
DispatchQueue.global(qos: .userInitiated).async { }
is replaced in this new async API with Task { }
or Task(priority: .userInitiated) {}
, but I'm not sure, what has DispatchQueue.main.async { }
been replaced with?
So, my questions are:
- Am I correctly assuming, that
DispatchQueue.global(qos: .userInitiated).async { }
has been replaced withTask(priority: .userInitiated) {}
- What has
DispatchQueue.main.async { }
been replaced with?
Please help, I want to learn this new async-await API.
Here's the code from the Lecture, using old GCD API:
...ANSWER
Answered 2022-Feb-24 at 15:54If you really are going to do something slow and synchronous, Task.detached
is a closer analog to GCD’s dispatching to a global queue. If you just use Task(priority: ...) { ... }
you are leaving it to the discretion of the concurrency system to decide which thread to run it on. (And just because you specify a lower priority
does not guarantee that it might not run on the main thread.)
For example:
QUESTION
In WWDC 2021 video, Protect mutable state with Swift actors, they provide the following code snippet:
...ANSWER
Answered 2022-Jan-05 at 00:30The key is to keep a reference to the Task
, and if found, await
its value
.
Perhaps:
QUESTION
there I am new to auto-renewable subscriptions. I have implemented the subscription. My problem is if the user buys the subscription for the first time app will go premium. but in any case, his second payment is not happened because of any reason. how did I know that the payment was not successful and or successful? I followed the WWDC tutorial for in-app purchases. implemented with storekit 2.
...ANSWER
Answered 2022-Jan-03 at 10:41In IAP's apple generate a receipt against each transaction containing a lot of information like a digital signature to validate the purchase, history of transactions including successful and unsuccessful transaction, the current status of the subscription, expiry date, and much more.
You have to validate the receipt by fetching from the Apple server to get all this information. you can check this to know how to fetch receipt data.
for validation, we can go with 2 techniques
- On-device validation(validation on the device locally if you're not using server in your app)
- Server-side validation(Recommended)
you can read more about choosing receipt validation technique here.
When you fetch receipt it will give you a receiptData and you will convert it to base64EncodedString and hit API for receipt.
For SandBox use https://sandbox.itunes.apple.com/verifyReceipt and for production use https://buy.itunes.apple.com/verifyReceipt. pass it two parameters Receipt base64String and App-Specific Shared Secret you can find App-Specific Shared Secret on App store on the top right corner of your in-app purchases list.
You will receive a response containing all information about the subscription.
Check this video of title Engineering Subscriptions from WWDC 2018. This video is really helpful in understanding subscriptions.
QUESTION
I've watched this WWDC session as well as its sample project: https://developer.apple.com/documentation/pencilkit/inspecting_modifying_and_constructing_pencilkit_drawings
However, when I try to plot CGPoints on my drawing canvas, nothing shows up.
Here's my setup:
...ANSWER
Answered 2021-Dec-08 at 11:35I figured that the problem was on the size of my stroke. This will work:
QUESTION
document-based
app in iOS.
I followed Apple's official example (https://developer.apple.com/documentation/uikit/view_controllers/building_a_document_browser-based_app#overview) and tried to revise it to display a PDF viewer.
I modified the original sample code to create the following code. It works totally fine with any simulators on my Macbook Pro (2020). However, when I tested with iPads (i.e., iPad Mini & iPad Pro: new generations), I cannot open PDF files.
I identified that the following code is not working:
let doc = PDFDocument(url: documentURL)
.
The URL seems to be appropriately obtained. doc
remains to be nil
when testing with iPads, while appropriately obtained when testing with simulators.
I would really appreciate it if you could let me know what is wrong with my code.
DocumentBrowserController.swift ...ANSWER
Answered 2021-Oct-31 at 11:49Hi I think this might be because:
QUESTION
iOS 14, Swift 5.x
I watched this excellent WWDC from 2018
https://developer.apple.com/videos/play/wwdc2018/223/
And I wrote a shapes editor... and have been trying to use partition as Dave in the video says you should. I got the first three to work, but the last one I had to use a loop- cannot for the life of me figure out how to get it to work with partition.
Can someone see how I might do this?
The first method moves the selected object to the end of the list, works perfectly.
...ANSWER
Answered 2021-Oct-22 at 20:01Looking at the WWDC video, it appears that what you are calling sendBackEA
is what WWDC calls bringForward
, and what you are calling bringForwardEA
is what WWDC calls sendBack
.
Just like how you move the first selected element forward one index (index decreases) in sendBackEA
, then move all the other selected elements to immediately after that first selected element. bringForwardEA
should do the reverse: move the last selected element backward one index (index increases), then move all the other selected elements to immediately before the last selected element. (See circa 19:10 in the video)
You seem to have confused yourself by trying to increase the indices of all the selected index by 1. This obviously cannot be done with a partition in general.
Also note that partition(by:)
already modifies the collection, you don't need to get each partition, then recombine.
Your 4 methods can be written like this:
QUESTION
We are trying to create shortcut actions with Catalyst.
Our app is already available on Mac, and we previously integrated the intents framework on iOS. So according to the WWDC21 "Meet Shortcuts on macOS" presentation, "it's likely that [we] have compiled out [our] Intents integration in the process of coming to Mac". So, it's no surprise that we cannot create shortcut actions for Mac in our app with Catalyst.
The WWDC presentation suggests to "make sure to audit your code to re-enable this functionality when running on macOS Monterey." We do not understand what we need to do based on this suggestion.
What we tried so far :
- we managed to create shortcut actions for mac with Catalyst, in the app available at https://github.com/mralexhay/ShortcutsExample. So, the problem does come from our app.
- we managed to create shortcut actions for iOS in our app
- we tried to create a fresh intent extension in our app, but the shortcut actions are still available only on iOS, not on Mac.
Has anyone found a solution in a similar situation ?
...ANSWER
Answered 2021-Aug-03 at 16:57When creating a shortcut action, Shortcuts get mixed up with app identifiers. You therefore need to delete all the compiled versions of your app.
QUESTION
Now i’m watching WWDC, Understanding Swift performance session
In that session one picture makes me confusing
I know that array cannot determine it’s size at compile time, so they store item instance in heap, and store that item’s reference in stack like above (d[0]
, d[1]
)
but what is refCount
in that array(next to d[0]
)?
Isdrawables
variable pointer for array instance?
ANSWER
Answered 2021-Sep-03 at 12:51Arrays are a struct
, therefore a value type. However, there are some copy-on-write optimizations, which may be the reason for this refCount
.
In the documentation for Array, it states:
Arrays, like all variable-size collections in the standard library, use copy-on-write optimization. Multiple copies of an array share the same storage until you modify one of the copies. When that happens, the array being modified replaces its storage with a uniquely owned copy of itself, which is then modified in place. Optimizations are sometimes applied that can reduce the amount of copying.
It also gives an example:
In the example below, a numbers array is created along with two copies that share the same storage. When the original numbers array is modified, it makes a unique copy of its storage before making the modification. Further modifications to numbers are made in place, while the two copies continue to share the original storage.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install WWDC
Presenters: Example Guy, Another Person.
Presenters: Example Guy, Another Person.
Presenters: Example Guy, Another Person.
Presenters: Example Guy, Another Person.
Presenters: Example Guy, Another Person.
Presenters: Eric Dudiac, David Duncan.
UISlider and UIProgressView: More consistent across platforms now
UIActivityIndicatorView: New simpler design, Use color API and modern styles, Updates "pull-to-refresh"
UIPickerView: Updated styling
UIPageControl New interactions (scrubbing, scrolling) Unlimited pages Optional custom indicator icons: .preferredIndicatorImage(UIImage()) to set all or .setIndicatorImage(UIImage(), forPage: 0) for a specific image Multiple styles: .backgroundStyle = .prominent to highlight the background
UIColorPickerViewController New view controller for picking colors Eyedropper, Favorites, Hex specification
UIDatePicker New compact style to select date and time In-line style on iOS - great for iPad or if date picking is primary UI (matches modal presentation) Useful when you have space constraints Full modal calendar when selecting dates Keyboard for selecting times New macOS style (10.15.4) Compact, modal calendar presentation Supported in Catalyst apps
Menus Provided on UIControl Directly supported by UIButton and UIBarButtonItem by button.menu = UIMenu(...) Triggered via long-press by default Show the menu by a simple tap by setting button.showsMenuAsPrimaryAction = true and don't provide a primary action Back buttons implement menus to quickly jump back in navigation stack Take action when the menu action is recognized, register for UIControl.Event.menuActionTriggered UIDeferredMenuElement to async provide menu items UIContextMenuInteraction to modify or replace provided menu updateVisibleMenu(_ block menu: (UIMenu) -> UIMenu) Use UIContextMenuInteraction.rich to display previews and .compact to only show a menu New UIBarButtonItem initializers init(systemItem:primaryAction:menu:), init(title:image:primaryAction:menu:) New UIBarButtonItem .fixedSpace() and .flexibleSpace UIButton can finally be initialized using an UIAction: init(type:primaryAction:) -> native block based API UISegmentedControls can now finally be initialized using UIActions -> native block based API
Presenters: Example Guy, Another Person.
Presenters: Example Guy, Another Person.
Presenters: Example Guy, Another Person.
Presenters: Example Guy, Another Person.
Presenters: Example Guy, Another Person.
Presenters: Example Guy, Another Person.
Presenters: Example Guy, Another Person.
Presenters: Example Guy, Another Person.
Presenters: Example Guy, Another Person.
Presenters: Example Guy, Another Person.
Presenters: Example Guy, Another Person.
Presenters: Example Guy, Another Person.
Presenters: Example Guy, Another Person.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page