I'm developing a Multiplatform app that uses CloudKit to sync the CoreData between the user's devices. At this time they don't share data between users. I have a single password field on a single Entity and was wondering if there was a simple way to encrypt just this field. I see in CoreData there's a checkbox labelled "Allows Cloud Encryption"... does checking that off magically encrypt it. I checked it off and nothing seemed to change so I unchecked it for now... is there something else I needed to do? And, most importantly, will it work with CloudKit?
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hi,
First year receiving revenue through Storekit subscriptions. I live in the United States and know I need to pay taxes within the U.S. for my revenue. I'm curious if I have to handle anything (taxes, etc) in each country I sold a subscription in or does Apple handle all that for me? If it's a per-country basis is there a list somewhere so I can use it to choose where I should offer my app in the future?
Thanks everyone!
I've added a package to my Mutliplatform project (Shout) that is now causing an error. When I attempt to build my program on my MacOS Ventura I get a warning "Could not find or use auto-linked library zlib" and six errors about undefined symbols from the zlib library: _deflate, _deflateEnd, _deflateInit_, _inflate, _inflateEnd, and _inflateInit_
I've added paths to my target's Build Settings under Library Search Paths and it doesn't seem to help.
Has any one seen anything like this and can help me build the project?
It was working with the previous version of my app on the previous stable version. I am running the beta Ventura with the new Xcode version and started a new app to move my code over in parts.
I'm looking to test my Xcode project using the default file set up XCTestCase... but I need to test it against a service that will need to be started before the test and stopped after the test. I was hoping to start and end it within the setUpWithError and tearDownWithError methods but I don't know how. Is there a way I could run commands from the testing environment?
Basically I want to figure out where it's executing from ls one time, move my files over, and then I can go through starting the service setUpWithError, running the tests, and then ending the service tearDownWithError.
Specifically the service runs a Docker image and I use a Makefile to make it a simple command. I just want to start and end it from the test environment.
Thanks
I'm setting up tests for my Xcode Multiplatform App. To create a test environment I created a docker image that I want to run an XCTestCase against. I understand I'd have to make sure Docker is running before running the test. That said I have a permission denied when trying to connect to the docker daemon socket.
Background: I'm using a makefile to store the commands and planned to run the docker build and docker run commands in the setUpWithError while running the docker kill command in tearDownWithError. To run the commands I used Process to execute the shell commands. I'm currently doing this is a test function to get it up and going.
Issue: When I try to run the docker command Xcode tells me that it doesn't give me the permission to run it:
docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/create?name=remarkable": dial unix /var/run/docker.sock: connect: operation not permitted.
See 'docker run --help'.
I only want to use Docker to run this specific XCTestCase. Is there anyway to run it from here JUST for the test? Or do I need to manually run docker and kill it before/after I run these tests?
Thanks for any help.
Hi,
I'm looking through the Backyard Birds app and trying to wrap my head around StoreKit 2 and make it work with my app.
Currently my app is three tabs that, for example, call access1, access2, and profile. I want to make users pay for access to the first two tabs and, by default, profile is visible on download for unsubscribed members. In the Backyard Birds app they have three levels that are clear cut and then they figure out access for family sharing by the highest level the user has.
I currently have six subscriptions listed under my group:
level1:
all access annual
all access monthly
level2:
access1 only annual
access1 only monthly
access2 only annual
access2 only monthly
My thought with this (not set up yet) is if the user subscribes to all access they have access to all three tabs. If they subscribe to access1 only they have access to the first and third(profile) tabs. If they subscribe to access2 then they have access to the second and third tabs.
I guess my main problem is I don't know how to implement func status(for statuses: [Product.SubscriptionInfo.Status], ids: PassIdentifiers) -> PassStatus as if there's a family member with access1 and another family member with access2 then the current person should essentially have all access (all three tab access).
Before I stumbled along further I wanted to check with all of you and see if there's a better way to set up or continue with the Backyard Pass example with different logic in status.
Thanks everyone.
I'm currently hooking up StoreKit2 to my app. I worked my way through an older example that listened to products and added/removed ids as they came up. This example fell short using the StoreKit config file as all subscriptions don't have a revocation date set so my list of purchased ids just grew longer (as they weren't removed).
My app is only using a single subscription group and thus will only have one subscription live at once. I'm currently grabbing the current subscription using for await result in Transaction.currentEntitlements and am showing the subscriptions with StoreView(ids: arrayIds) and SubscriptionStoreView(groupID: subscriptionGroupID) depending where they user is. Currently when those views disappear I grab the current subscription again (thus updating it if it was changed). That seems cumbersome especially if it doesn't need to be updated and I'm not getting the following error: Making a purchase without listening for transaction updates risks missing successful purchases. Create a Task to iterate Transaction.updates at launch..
I'm wondering if there's a way to just listen to the StoreKit Subscription ID in my main App entry point thus making the final error disappear and maybe, if I could update the type of subscription, removing my onDisappear subscription fetches throughout the rest of the app.
All the examples I come across seem to be either tied up with SwiftData (WWDC 2023) or older and maybe not applicable anymore. Everything seems to be embedded in StoreKit and it would be lovely if I could listen in one simple spot for in app and outside app subscription changes.
Thanks :)
I like how the TabView control looks on the mac and ipad and decided to see if my current code can show the tabs in my multi-platform app just to realize that whenever I click on one of those tabs my macOS app currently crashes every time I press any other tab with the error: Thread 1: "NSToolbar 0x600003de33c0 already contains an item with the identifier com.apple.SwiftUI.navigationSplitView.toggleSidebar. Duplicate items of this type are not allowed."
While trying to troubleshoot I noticed several other people have had a similar issue with differing reasons (toolbars and searchers mentioned) all in macOS since upgrading to 15.0: https://forums.developer.apple.com/forums/thread/763829
Minimal Viable Project: to show the issue
I commented out most of my code calls hoping to create a project that worked so I could bring my code back in and see if it broke. I still had this issue so I next created a minimal viable example.
Here it is:
import SwiftUI
import SwiftData
@Model
class Issue {
var name: String
init(name: String) {
self.name = name
}
}
@main
struct TestMultiplatformApp: App {
var sharedModelContainer: ModelContainer = {
let schema = Schema([
Issue.self,
])
let modelConfiguration = ModelConfiguration(schema: schema, isStoredInMemoryOnly: false)
do {
return try ModelContainer(for: schema, configurations: [modelConfiguration])
} catch {
fatalError("Could not create ModelContainer: \(error)")
}
}()
var body: some Scene {
WindowGroup {
ContentView()
}
.modelContainer(sharedModelContainer)
}
}
struct ContentView: View {
@State var isCompact: Bool = true
var body: some View {
VStack {
if isCompact {
EntryTab()
} else {
EntrySidebar()
}
Toggle(isOn: $isCompact, label: {
Text(isCompact ? "TabView" : "Sidebar")
})
.padding(.horizontal, 20)
.padding(.bottom, 20)
}
}
}
public struct tabControl: Identifiable, Hashable, Sendable {
public static func == (lhs: tabControl, rhs: tabControl) -> Bool {
lhs.id < rhs.id
}
public var id: Int // Tab Number
public var displayName: String
public init(id: Int, displayName: String) {
self.id = id
self.displayName = displayName
}
}
struct EntryTab: View {
let entryTabs = [
tabControl(id: 0, displayName: "row 0"),
tabControl(id: 1, displayName: "row 1"),
tabControl(id: 2, displayName: "row 2"),
tabControl(id: 3, displayName: "row 3")
]
@State private var selectedTab: Int = 0
var body: some View {
TabView(selection: $selectedTab) {
ForEach(entryTabs) { tabCtrl in
NavigationSplitView {
Text("Selected tab is \(selectedTab)")
} detail: {
Text("Choose item from sidebar... in future this would be content")
}
.tabItem {
Text(tabCtrl.displayName)
}
.tag(tabCtrl.id)
}
}
}
}
struct EntrySidebar: View {
@State private var selectedTabID: Int?
let entryTabs = [
tabControl(id: 0, displayName: "row 0"),
tabControl(id: 1, displayName: "row 1"),
tabControl(id: 2, displayName: "row 2"),
tabControl(id: 3, displayName: "row 3")
]
var body: some View {
NavigationSplitView(sidebar: {
List(entryTabs, id:\.id, selection: $selectedTabID) { thisItem in
Text(thisItem.displayName)
}
}, content: {
Text("Hi selected tab: \(String(describing: selectedTabID))")
}, detail: {
Text("Choose item from sidebar... in future this would be content")
})
.onAppear() {
// Set the selected tab
selectedTabID = 1
}
}
}