-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: main
Are you sure you want to change the base?
Conversation
|
||
|
||
|
||
func clearFirestoreData() { |
There was a problem hiding this comment.
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
Assignment1/Assignment1/Controller/SuggestionViewController.swift
Outdated
Show resolved
Hide resolved
Assignment1/Assignment1/Controller/SuggestionViewController.swift
Outdated
Show resolved
Hide resolved
let dbComponents = DataBaseComponents.singletonDataBaseComponents | ||
dbComponents.clearFirestoreData() | ||
|
||
do{ |
There was a problem hiding this comment.
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? { |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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"]!)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove forced unwrapping
|
||
|
||
|
||
// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the commented code
No description provided.