forked from organicmaps/organicmaps
[ios] Sort by name
Signed-off-by: Alexander Borsuk <me@alex.bio>
This commit is contained in:
parent
cd5923ed69
commit
83f67ca040
5 changed files with 17 additions and 1 deletions
|
@ -16,7 +16,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
typedef NS_ENUM(NSInteger, MWMBookmarksSortingType) {
|
||||
MWMBookmarksSortingTypeByType,
|
||||
MWMBookmarksSortingTypeByDistance,
|
||||
MWMBookmarksSortingTypeByTime
|
||||
MWMBookmarksSortingTypeByTime,
|
||||
MWMBookmarksSortingTypeByName
|
||||
} NS_SWIFT_NAME(BookmarksSortingType);
|
||||
|
||||
typedef void (^PingCompletionBlock)(BOOL success);
|
||||
|
|
|
@ -66,6 +66,8 @@ static MWMBookmarksSortingType convertSortingType(BookmarkManager::SortingType c
|
|||
return MWMBookmarksSortingTypeByDistance;
|
||||
case BookmarkManager::SortingType::ByTime:
|
||||
return MWMBookmarksSortingTypeByTime;
|
||||
case BookmarkManager::SortingType::ByName:
|
||||
return MWMBookmarksSortingTypeByName;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -77,6 +79,8 @@ static BookmarkManager::SortingType convertSortingTypeToCore(MWMBookmarksSorting
|
|||
return BookmarkManager::SortingType::ByDistance;
|
||||
case MWMBookmarksSortingTypeByTime:
|
||||
return BookmarkManager::SortingType::ByTime;
|
||||
case MWMBookmarksSortingTypeByName:
|
||||
return BookmarkManager::SortingType::ByName;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -7,6 +7,8 @@ extension BookmarksListSortingType {
|
|||
self = .distance
|
||||
case .byTime:
|
||||
self = .date
|
||||
case .byName:
|
||||
self = .name
|
||||
@unknown default:
|
||||
fatalError()
|
||||
}
|
||||
|
@ -80,6 +82,8 @@ extension BookmarksListInteractor: IBookmarksListInteractor {
|
|||
return BookmarksListSortingType.distance
|
||||
case .byTime:
|
||||
return BookmarksListSortingType.date
|
||||
case .byName:
|
||||
return BookmarksListSortingType.name
|
||||
@unknown default:
|
||||
fatalError()
|
||||
}
|
||||
|
@ -113,6 +117,8 @@ extension BookmarksListInteractor: IBookmarksListInteractor {
|
|||
coreSortingType = .byTime
|
||||
case .type:
|
||||
coreSortingType = .byType
|
||||
case .name:
|
||||
coreSortingType = .byName
|
||||
}
|
||||
|
||||
bookmarksManager.sortBookmarks(markGroupId,
|
||||
|
|
|
@ -80,6 +80,7 @@ enum BookmarksListSortingType {
|
|||
case distance
|
||||
case date
|
||||
case type
|
||||
case name
|
||||
}
|
||||
|
||||
protocol IBookmarksListInteractor {
|
||||
|
|
|
@ -117,6 +117,10 @@ final class BookmarksListPresenter {
|
|||
return BookmarksListMenuItem(title: L("sort_type"), action: { [weak self] in
|
||||
self?.sort(.type)
|
||||
})
|
||||
case .name:
|
||||
return BookmarksListMenuItem(title: L("sort_name"), action: { [weak self] in
|
||||
self?.sort(.name)
|
||||
})
|
||||
}
|
||||
}
|
||||
sortItems.append(BookmarksListMenuItem(title: L("sort_default"), action: { [weak self] in
|
||||
|
|
Loading…
Add table
Reference in a new issue