Post

Replies

Boosts

Views

Activity

Clarification on concurrency guarantees for shared data between App and Widget extensions
Hi, I’m looking for clarification on what concurrency and consistency guarantees Apple provides when multiple targets (main app + Widget extensions) access shared storage. Specifically: 1. UserDefaults (App Group / suiteName:) • If multiple processes (app + multiple widget instances) read and write the same shared UserDefaults, what guarantees are provided? • Is access serialized internally to prevent corruption? • Are read–modify–write operations safe across processes, or can lost updates occur? 2. Core Data (shared SQLite store in App Group container) • Is it officially supported for multiple processes to open and write to the same Core Data SQLite store? • Are there recommended configurations (e.g. WAL mode) for safe multi-process access? • Is Apple’s recommendation to have a single writer process? 3. FileManager (shared container files) • If two processes write to the same file in an App Group container, what guarantees are provided by the system? • Is atomic replaceItemAt the recommended pattern for safe cross-process updates? Additionally: • Do multiple widget instances count as separate processes with respect to these guarantees? • Is there official guidance on best practices for shared persistence between app and widget extensions? I want to ensure I’m following the correct architecture and not relying on undefined behavior. Thanks.
1
0
104
2w
MKLocalSearch request limit
Hello, It’s unclear to me if there is a limit of requests when using MKLocalSearch from MapKit. Let’s say I have a very large user base and will use 1000 requests per minute at peak times. Will MapKit support this? But if there is a limit, is it by user or by developer account? Also, if there is a limit, is it per day? Here is an example of the request we use. let searchRequest = MKLocalSearch.Request() searchRequest.naturalLanguageQuery = myQueryStringHere localSearch?.cancel() // cancel the previous call if it exists localSearch = MKLocalSearch(request: searchRequest) localSearch?.start { (response, error) in guard error == nil else { completion(.failure(.myError)) return } let mapSearchLocations = response?.mapItems completion(.success(mapSearchLocations)) } }
1
0
550
Aug ’24
MKLocalSearch request limit
I'm a bit unsure about whether there’s a limit on the number of requests when using MKLocalSearch from MapKit. For example, if I have a large user base and need to make 200 requests per minute at peak times, will MapKit be able to handle this? Will the user be throttled after a number of requests? If there is a limit, is it based on the user or developer account? Additionally, if there is a limit, is it per day? Can you clarify? Just to give you an idea, here is an example of the request we make: let searchRequest = MKLocalSearch.Request() searchRequest.naturalLanguageQuery = myQueryStringHere localSearch?.cancel() // cancel the previous call if it exists localSearch = MKLocalSearch(request: searchRequest) localSearch?.start { (response, error) in guard error == nil else { completion(.failure(.myError)) return } let mapSearchLocations = response?.mapItems completion(.success(mapSearchLocations)) } } I appreciate your help in advance.
1
0
708
Aug ’24
Clarification on concurrency guarantees for shared data between App and Widget extensions
Hi, I’m looking for clarification on what concurrency and consistency guarantees Apple provides when multiple targets (main app + Widget extensions) access shared storage. Specifically: 1. UserDefaults (App Group / suiteName:) • If multiple processes (app + multiple widget instances) read and write the same shared UserDefaults, what guarantees are provided? • Is access serialized internally to prevent corruption? • Are read–modify–write operations safe across processes, or can lost updates occur? 2. Core Data (shared SQLite store in App Group container) • Is it officially supported for multiple processes to open and write to the same Core Data SQLite store? • Are there recommended configurations (e.g. WAL mode) for safe multi-process access? • Is Apple’s recommendation to have a single writer process? 3. FileManager (shared container files) • If two processes write to the same file in an App Group container, what guarantees are provided by the system? • Is atomic replaceItemAt the recommended pattern for safe cross-process updates? Additionally: • Do multiple widget instances count as separate processes with respect to these guarantees? • Is there official guidance on best practices for shared persistence between app and widget extensions? I want to ensure I’m following the correct architecture and not relying on undefined behavior. Thanks.
Replies
1
Boosts
0
Views
104
Activity
2w
MKLocalSearch request limit
Hello, It’s unclear to me if there is a limit of requests when using MKLocalSearch from MapKit. Let’s say I have a very large user base and will use 1000 requests per minute at peak times. Will MapKit support this? But if there is a limit, is it by user or by developer account? Also, if there is a limit, is it per day? Here is an example of the request we use. let searchRequest = MKLocalSearch.Request() searchRequest.naturalLanguageQuery = myQueryStringHere localSearch?.cancel() // cancel the previous call if it exists localSearch = MKLocalSearch(request: searchRequest) localSearch?.start { (response, error) in guard error == nil else { completion(.failure(.myError)) return } let mapSearchLocations = response?.mapItems completion(.success(mapSearchLocations)) } }
Replies
1
Boosts
0
Views
550
Activity
Aug ’24
MKLocalSearch request limit
I'm a bit unsure about whether there’s a limit on the number of requests when using MKLocalSearch from MapKit. For example, if I have a large user base and need to make 200 requests per minute at peak times, will MapKit be able to handle this? Will the user be throttled after a number of requests? If there is a limit, is it based on the user or developer account? Additionally, if there is a limit, is it per day? Can you clarify? Just to give you an idea, here is an example of the request we make: let searchRequest = MKLocalSearch.Request() searchRequest.naturalLanguageQuery = myQueryStringHere localSearch?.cancel() // cancel the previous call if it exists localSearch = MKLocalSearch(request: searchRequest) localSearch?.start { (response, error) in guard error == nil else { completion(.failure(.myError)) return } let mapSearchLocations = response?.mapItems completion(.success(mapSearchLocations)) } } I appreciate your help in advance.
Replies
1
Boosts
0
Views
708
Activity
Aug ’24