Refactoring 12
Refactoring 12
1. We need good test case for No course found error , like BDD as well
2. If we are improving the url session with completion handler using Result we need to address is
Downloading flag
3. We need to use ios 12 for all the tenants as we have bumped up the min. support version
4. Build setttings for ios 12, clat tenant, setting compilation mode to incremental instead of whole
5. init(encodedOffset:)' is deprecated: encodedOffset has been deprecated as most common usage is
incorrect. Use String.Index(utf16Offset:in:) to achieve the same behavior.
6. scanHexInt32' was deprecated in iOS 13.0
7. The app icon set "AppIcon" has an unassigned child
8. Pods updating to ios 12 deployment target
9. Linting can applied using swift lint
10. Unused core-data models can be removed from the file folder
Update Header
func updateHeader() {
struct Counter { static var counter = 0 }
if let header = Bundle.main.loadNibNamed("CourseListTableViewHeader", owner: nil, op-
tions: nil)?.first as? CourseListTableViewHeader,
courseList.count > 0 {
Counter.counter += 1
let slug = Utils.getLastCourseSlug()?.cleanedSlug
if let course = fetchedResultsControler.fetchedObjects?.filter({ $0.contentPackage?.
slug == slug }).first {
header.course = course
} else {
header.course = nil
header.courseNameLabel.text = "NONE"
}
header.delegate = self
header.frame.size = CGSize(width: 0, height: 250)
tableView.tableHeaderView = header
}else if courseList.count == 0 && !hasDownloaded {
Counter.counter += 1
}
else if hasDownloaded {
Counter.counter += 1
tableView.tableHeaderView = self.noCoursesAvailableHeaderView
if(Counter.counter >= 10) {
self.noCoursesFoundLabel.isHidden = false
self.noCoursesFoundLabel.text = Constants.No_Course_Found
self.noCoursesFoundLabel.numberOfLines = 0
self.noCoursesAvailableLabel.isHidden = false
}
}
What can we do to
make it better?
We can do this from Xcode and most of the tenant have got the higher version or 12.0
init(encodedOffset:)' is deprecated: encodedOffset has been deprecated as most common usage is in-
correct. Use String.Index(utf16Offset:in:) to achieve the same behavior.
12. scanHexInt32' was deprecated in iOS 13.0