Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assignment 1,2 added #1

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

Assignment 1,2 added #1

wants to merge 15 commits into from

Conversation

VishalYadav405
Copy link
Owner

No description provided.




func clearFirestoreData() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this function outside didFinishLaunching

let dbComponents = DataBaseComponents.singletonDataBaseComponents
dbComponents.clearFirestoreData()

do{

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove if this is not used

lazy var persistentContainer: NSPersistentContainer = {
let container = NSPersistentContainer(name: "Model")
container.loadPersistentStores(completionHandler: { (storeDescription, error) in
if let error = error as NSError? {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this if needed ?

for doc in snapShotDoc {
self.items.append(doc.data())
DispatchQueue.main.async {
self.tableView.reloadData()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is table reloading for every item ?

if let image = loadImage(productArrayCoreData[indexPath.row].image_url){
cell.itemImage.image = image
}
cell.itemPrice.text = productArrayCoreData[indexPath.row].price

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge the data from both productArrayCoreData and productArray

cell.itemImage.image = image
}

cell.itemPrice.text = "Rs. \(notNilInfoItem["discounted_price"]!)"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove forced unwrapping




//

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the commented code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants