diff --git a/iphone/Maps/Common/Common.swift b/iphone/Maps/Common/Common.swift index 7c04fa4907..9416cc72f1 100644 --- a/iphone/Maps/Common/Common.swift +++ b/iphone/Maps/Common/Common.swift @@ -24,8 +24,9 @@ func toString(_ cls: AnyClass) -> String { } func statusBarHeight() -> CGFloat { - let statusBarSize = UIApplication.shared.statusBarFrame.size - return min(statusBarSize.height, statusBarSize.width) + return UIApplication.shared.connectedScenes + .compactMap { $0 as? UIWindowScene } + .first?.statusBarManager?.statusBarFrame.height ?? 0 } private let enableLoggingInRelease = true diff --git a/iphone/Maps/Tourism/Data/Db/PersistenceControllers/PlacesPersistenceController.swift b/iphone/Maps/Tourism/Data/Db/PersistenceControllers/PlacesPersistenceController.swift index 92465060e8..9bd52145e5 100644 --- a/iphone/Maps/Tourism/Data/Db/PersistenceControllers/PlacesPersistenceController.swift +++ b/iphone/Maps/Tourism/Data/Db/PersistenceControllers/PlacesPersistenceController.swift @@ -167,7 +167,10 @@ class PlacesPersistenceController: NSObject, NSFetchedResultsControllerDelegate func observeTopSights() { let fetchRequest: NSFetchRequest = PlaceEntity.fetchRequest() fetchRequest.predicate = NSPredicate(format: "categoryId == %lld", PlaceCategory.sights.id) - fetchRequest.sortDescriptors = [NSSortDescriptor(key: "rating", ascending: false)] + fetchRequest.sortDescriptors = [ + NSSortDescriptor(key: "rating", ascending: false), + NSSortDescriptor(key: "name", ascending: true) + ] fetchRequest.fetchLimit = 15 topSightsFetchedResultsController = NSFetchedResultsController( @@ -189,7 +192,10 @@ class PlacesPersistenceController: NSObject, NSFetchedResultsControllerDelegate func observeTopRestaurants() { let fetchRequest: NSFetchRequest = PlaceEntity.fetchRequest() fetchRequest.predicate = NSPredicate(format: "categoryId == %lld", PlaceCategory.restaurants.id) - fetchRequest.sortDescriptors = [NSSortDescriptor(key: "rating", ascending: false)] + fetchRequest.sortDescriptors = [ + NSSortDescriptor(key: "rating", ascending: false), + NSSortDescriptor(key: "name", ascending: true) + ] fetchRequest.fetchLimit = 15 topRestaurantsFetchedResultsController = NSFetchedResultsController( diff --git a/iphone/Maps/Tourism/Presentation/Components/LoadImg.swift b/iphone/Maps/Tourism/Presentation/Components/LoadImg.swift index a399f8f9c8..8c8c6c65d8 100644 --- a/iphone/Maps/Tourism/Presentation/Components/LoadImg.swift +++ b/iphone/Maps/Tourism/Presentation/Components/LoadImg.swift @@ -24,6 +24,8 @@ struct LoadImageView: View { .resizable() .indicator(.activity) .scaledToFill() + .frame(maxWidth: UIScreen.main.bounds.width, maxHeight: 150) // Constrain the width and height + .clipped() .transition(.fade(duration: 0.2)) if(isError) { Image(systemName: "exclamationmark.circle") diff --git a/iphone/Maps/Tourism/Presentation/Home/Screens/Profile/PlaceDetails/Components/PlaceTopBar.swift b/iphone/Maps/Tourism/Presentation/Home/Screens/Profile/PlaceDetails/Components/PlaceTopBar.swift index 862c97868b..170509a884 100644 --- a/iphone/Maps/Tourism/Presentation/Home/Screens/Profile/PlaceDetails/Components/PlaceTopBar.swift +++ b/iphone/Maps/Tourism/Presentation/Home/Screens/Profile/PlaceDetails/Components/PlaceTopBar.swift @@ -65,7 +65,7 @@ struct PlaceTopBar: View { } } } - .frame(maxWidth: .infinity, maxHeight: height) + .frame(width: UIScreen.main.bounds.width, height: height) } }