Post not yet marked as solved
I create a tool XLLoger, that can redirect stdout to the textView, It works well on iOS14 and below, but on iOS15, when the app running on Xcode connecting the device or simulator, the code can get the logs, if disconnected xcode, the app can't get print log, the NSLog can be get. I changed a variety of methods to redirect logs, all of which are the same phenomenon. Anything wrong with my code?
Post not yet marked as solved
I am trying to use the new API provided by WWDC21 to create Core Data databases that can be shared.
When I do the sharing for an NSManageObject, I tried to experiment with 2 methods.
1: Using UICloudSharingController's
UICloudSharingController(preparationHandler: (UICloudSharingController, @escaping (CKShare?, CKContainer?, Error?) -> Void) -> Void)
method.
Currently this method works and the participants can get all the data after accepting the invitation.
2:Use NSPersistentContainer's
share(_ managedObjects: [NSManagedObject], to share: CKShare?) async throws -> (Set<NSManagedObjectID>, CKShare, CKContainer)
method.
First get ckshare, then call
UICloudSharingController(share:, container: )
With this approach, after accepting the invitation, the participant only gets the data generated after the creation of the ckshare, and the data before the ckshare is never fetched
I'm not sure if it's an error in the token generated by the share method of the NSPersistentContainer or something else. Has anyone encountered a similar situation?
I was trying to have a secondary collection view with circle images above (y axis) the functioning collection view but its crashing and throwing this error
Error code:
could not dequeue a view of kind: UICollectionElementKindCell with identifier CircleCollectionViewCell - must register a nib or a class for the identifier or connect a prototype cell in a storyboard
ViewController code:
//
// ViewController.swift
// Main_app
//
// Created by Kushagr Agarwal on 23/08/21.
//
import UIKit
class ViewController: UIViewController {
@IBOutlet var collectionView: UICollectionView!
@IBOutlet var topCollectionView: UICollectionView!
@IBOutlet weak var Leading: NSLayoutConstraint!
@IBOutlet weak var Trailing: NSLayoutConstraint!
@IBOutlet private weak var Menubutton: UIButton!
var menuOut = false
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
//self.navigationItem.titleView = UIImageView(image: UIImage(named: "Logo"))
collectionView.register(MiddleCollectionViewCell.nib(), forCellWithReuseIdentifier: MiddleCollectionViewCell.identifier)
collectionView.delegate=self
collectionView.dataSource=self
topCollectionView.register(CircleCollectionViewCell.self, forCellWithReuseIdentifier: CircleCollectionViewCell.identifier)
topCollectionView.delegate=self
topCollectionView.dataSource=self
// Menu
// start
let destructiveAction = UIAction(title: "Delete",image: UIImage(systemName: "nosign") , attributes: .destructive) { (_) in
print("Delete")
}
let menu = UIMenu(title: "", children: [
UIAction (title: "Add New", image: UIImage(systemName: "plus.circle"), handler: { _ in }),
UIAction (title: "Manage", image: UIImage(systemName: "hammer"), handler: { _ in }),
destructiveAction
])
self.Menubutton.menu = menu
// Menu end
}
// Menu animation
@IBAction func MenuTap(_ sender: Any) {
if menuOut == false {
Leading.constant = -150
Trailing.constant = 150
menuOut = true
}
else{
Leading.constant = 0
Trailing.constant = 0
menuOut = false
}
UIView.animate(withDuration: 0.2, delay: 0.0 , options: .curveEaseIn,animations: {
self.view.layoutIfNeeded()
}){(animationComplete) in
print("Animation Completed")
}
}
// Menu animation ends
}
// used for upper collection view
extension ViewController: UICollectionViewDelegate {
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
collectionView.deselectItem(at: indexPath, animated: true )
print("btn tapped")
}
}
extension ViewController: UICollectionViewDataSource {
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return 12
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: MiddleCollectionViewCell.identifier, for: indexPath) as! MiddleCollectionViewCell
let topcell = collectionView.dequeueReusableCell(withReuseIdentifier: CircleCollectionViewCell.identifier, for: indexPath) as! CircleCollectionViewCell
topcell.configure(with: "")
cell.configure(with: UIImage(named: "four")!)
return cell; topcell
}
}
//extension ViewController: UICollectionViewDelegateFlowLayout {
//
//}
Post not yet marked as solved
In the WWDC2021 talk on building apps that share data through CloudKit and Core Data there seems to be a lack of examples that use SwiftUI. Is there any place o find such examples or even a tutorial?
Post not yet marked as solved
mailto break line %0D%0A show
Post not yet marked as solved
We will soon be launching a gambling/gaming beta test in Virginia that will be IOS friendly. Although we do not yet have a license, we wont be integrating real money in the beta test. The currency in the beta test will only be play money that we will be using to prove the concept of our platform. Subsequently when that concept is proven, we will then get a license to incorporate real money and have third party payment processors. Judging from this synopsis, will we have any trouble getting approved by the apple app store?
Post not yet marked as solved
I have been waiting for this for many years. Thank you. Is there demo code that accompanies this video?
Post not yet marked as solved
When I add a picture in a shared item from a device other than the owner I am getting an error in the console as follows: CoreData: Unable to provide a default CKRecordZoneID for database scope: Shared. Please note that I am using the sample project from the WWDC video titled Build apps that share data through CloudKit and Core Data. How might I be able to fix this error and what might be causing it?
Post not yet marked as solved
container.acceptShareInvitations(from: [cloudKitShareMetadata], into: NSPersistentStore)
how to get NSPersistentStore?