I am trying to add an image to the right of text to make the image appear inline.
However when i do this with a HStack the image is to the right of the image for 1 line text but multi line text the image is just to the right of the frame of the view for the text and not Inline as i need eg.
HStack {
Text("Some Long Text")
Image("info.circle")
}
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
1.What is the best way to link/store each User's info to a Post using CloudKit with CoreData?
How can I make it that whenever the user changes their photo and I update the UserInfo record, have all the POST made by this user have the new updated photo?
.xcdataModel file has a Post entity
Post with the following attributes:
caption: String, image: binary Data, postID: String, postText: String, userID: String, username: String
I use the managedobjectContext method in SwiftUI to add Posts to the database like below.
post.username = cloudkitManager.currentUser?.name
post.userID = cloudkitManager.userDefaultsID
post.postText = self.viewModel.serialNumber
post.postID = UUID().uuidString
post.timestamp = Date()
if self.viewModel.imageData() != nil {
post.image = self.viewModel.imageData()
}
do {
if viewContext.hasChanges {
try viewContext.save()
self.viewModel.isLoading = false
self.presentationMode.wrappedValue.dismiss()
}
} catch {
self.viewModel.isLoading = false
let nsError = error as NSError
self.viewModel.errorMessage = error.localizedDescription
self.viewModel.showErrorAlert = true
fatalError("Unresolved error \(nsError), \(nsError.userInfo)")
}
But when saving the UserInfo I use a normal CloudKit container.publicCloudDatabase.save method instead of using the managedObjectContext like above
Any Advise please help :)
Recently iOS 14 added auto scrolling to textfields, or other in focus views in a ScrollView.
How can i disable the recently added Autoscrolling in iOS 14 for SwiftUI
i have a Custom button in SWIFTUI but when I run the accessibility inspector and it focuses on button it only says the title and type.
how can I get it to say whether it is enabled or not
how can I use CloudKit to make a chat messaging section in my app. I want users to be able to have private conversations with another user without it being public to everyone.
I don’t want to use public database cause then everyone would see the 2 users personal convo.
I don’t want to use private database because I want both users to be able to see the messages sent to each other in convo.
I normally would use Firebase with messagekit for this but I want to try with CloudKit .
any help would be appreciated
I am using CoreData with CloudKit but I notice that all my posts are only being saved in the Private database of CloudKit
how can I get them to save in the Public database of CloudKit instead while using CoreData and CloudKit?
I am using CoreData with CloudKit in SwiftUI and am able to save data but its only saving to the Private Database, how can i chose to save some data in different database example: Public Database instead of the Private Database.
Also what is the Shared Database for exactly? (is it for messages between two users in a chat style)