Post

Replies

Boosts

Views

Activity

Reply to AppIdentifierPrefix is different in main app and extension
FWIW, I just added a keychain sharing entitlement using Xcode 12.5, and it added the entitlements file with $(AppIdentifierPrefix)groupname (groupname is what I put in the entitlements UI). I don't know what value it's actually putting in there, as I can't find AppIdentifierPrefix anywhere else in the project. Update: It's really hard to know what the string in my code should be to match what Xcode is generating for the entitlement.
Topic: Privacy & Security SubTopic: General Tags:
May ’21
Reply to Coalescing @Published changes?
Well, I can't show all the code, but I can show a bit more: swift class ChatStream { @Published var messages = OrderedSetMessage() func add(messages inMsgs: [IncomingMessage]) { for msg in inMsgs { let msg = Message(fromIncoming: msg, user: user) self.messages.append(msg) } self.messages.sort() } } ... struct ChatView: View { @ObservedObject public var stream : ChatStream var body: some View { ScrollViewReader { scrollView in ScrollView { LazyVStack(alignment: .leading, spacing: 0.0) { ForEach(self.stream.messages) { inMsg in ChatMessageCell(message: inMsg) } .onChange(of: self.stream.messages, perform: { inMessages in --- called multiple times for each update below. if inMessages.count 1 { return } withAnimation(.linear(duration: 0.25)) { scrollView.scrollTo(inMessages.last!.id, anchor: .bottom) } }) } } } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’21
Reply to SwiftUI macOS: tracking the mouse in a view?
Unfortunately that only works while the mouse button is held down. I found an amazing solution, though, but the forum won't let me include a link to it. It's the SwiftUI-Lab (dot com) website, article The Power of the Hosting+Representable Combo.” It's unfortunate that Apple seems to have completely omitted mouse tracking in views.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’21