[ios] Refactored place page.

This commit is contained in:
VladiMihaylenko 2016-02-17 14:44:49 +03:00 committed by Sergey Yershov
parent 0df079d542
commit 38a3386969
7 changed files with 180 additions and 171 deletions

View file

@ -18,13 +18,42 @@ extern NSString * const kMWMCuisineSeparator;
namespace
{
CGFloat const kLeftOffset = 16.;
CGFloat const kDefaultHeaderHeight = 16.;
CGFloat const kLabelsPadding = kLeftOffset * 2;
CGFloat const kDirectionArrowSide = 20.;
CGFloat const kOffsetFromTitleToDistance = 8.;
CGFloat const kOffsetFromDistanceToArrow = 5.;
CGFloat const kMaximumWidth = 360.;
MWMPlacePageCellTypeValueMap const gCellType2ReuseIdentifier{
enum class PlacePageSection
{
Bookmark,
Metadata,
Editing
};
vector<MWMPlacePageCellType> const kSectionBookmarkCellTypes {
MWMPlacePageCellTypeBookmark
};
vector<MWMPlacePageCellType> const kSectionMetadataCellTypes {
MWMPlacePageCellTypePostcode, MWMPlacePageCellTypePhoneNumber, MWMPlacePageCellTypeWebsite, MWMPlacePageCellTypeURL,
MWMPlacePageCellTypeEmail, MWMPlacePageCellTypeOpenHours, MWMPlacePageCellTypeWiFi, MWMPlacePageCellTypeCoordinate
};
vector<MWMPlacePageCellType> const kSectionEditingCellTypes {
MWMPlacePageCellTypeEditButton
};
using TCellTypesSectionMap = pair<vector<MWMPlacePageCellType>, PlacePageSection>;
vector<TCellTypesSectionMap> const kCellTypesSectionMap {
{kSectionBookmarkCellTypes, PlacePageSection::Bookmark},
{kSectionMetadataCellTypes, PlacePageSection::Metadata},
{kSectionEditingCellTypes, PlacePageSection::Editing}
};
MWMPlacePageCellTypeValueMap const kCellType2ReuseIdentifier{
{MWMPlacePageCellTypeWiFi, "PlacePageInfoCell"},
{MWMPlacePageCellTypeCoordinate, "PlacePageInfoCell"},
{MWMPlacePageCellTypePostcode, "PlacePageInfoCell"},
@ -38,8 +67,8 @@ MWMPlacePageCellTypeValueMap const gCellType2ReuseIdentifier{
NSString * reuseIdentifier(MWMPlacePageCellType cellType)
{
auto const it = gCellType2ReuseIdentifier.find(cellType);
BOOL const haveCell = (it != gCellType2ReuseIdentifier.end());
auto const it = kCellType2ReuseIdentifier.find(cellType);
BOOL const haveCell = (it != kCellType2ReuseIdentifier.end());
ASSERT(haveCell, ());
return haveCell ? @(it->second.c_str()) : @"";
}
@ -59,6 +88,10 @@ enum class AttributePosition
} // namespace
@interface MWMBasePlacePageView () <MWMPlacePageOpeningHoursCellProtocol>
{
vector<PlacePageSection> m_sections;
map<PlacePageSection, vector<MWMPlacePageCellType>> m_cells;
}
@property (weak, nonatomic) MWMPlacePageEntity * entity;
@property (weak, nonatomic) IBOutlet MWMPlacePage * ownerPlacePage;
@ -80,7 +113,7 @@ enum class AttributePosition
self.featureTable.delegate = self;
self.featureTable.dataSource = self;
self.featureTable.separatorColor = [UIColor blackDividers];
for (auto const & type : gCellType2ReuseIdentifier)
for (auto const & type : kCellType2ReuseIdentifier)
{
NSString * identifier = @(type.second.c_str());
[self.featureTable registerNib:[UINib nibWithNibName:identifier bundle:nil]
@ -92,9 +125,29 @@ enum class AttributePosition
- (void)configureWithEntity:(MWMPlacePageEntity *)entity
{
self.entity = entity;
[self configTable];
[self configure];
}
- (void)configTable
{
m_sections.clear();
m_cells.clear();
for (auto const cellSection : kCellTypesSectionMap)
{
for (auto const cellType : cellSection.first)
{
if (![self.entity getCellValue:cellType])
continue;
m_sections.push_back(cellSection.second);
m_cells[cellSection.second].push_back(cellType);
}
}
sort(m_sections.begin(), m_sections.end());
m_sections.erase(unique(m_sections.begin(), m_sections.end()), m_sections.end());
}
- (void)configure
{
MWMPlacePageEntity * entity = self.entity;
@ -110,7 +163,7 @@ enum class AttributePosition
self.titleLabel.text = entity.title;
NSString * typeString = entity.category.capitalizedString;
NSRange const range = [typeString rangeOfString:kMWMCuisineSeparator];
if (range.location != NSNotFound)
if (range.location != NSNotFound && typeString.length > 0)
{
NSMutableAttributedString * str = [[NSMutableAttributedString alloc] initWithString:typeString];
[str addAttributes:@{NSForegroundColorAttributeName : [UIColor blackHintText]} range:range];
@ -277,7 +330,11 @@ enum class AttributePosition
[self.typeDescriptionView removeFromSuperview];
self.typeDescriptionView = nil;
[self.typeLabel sizeToFit];
[self.entity addBookmarkField];
m_sections.push_back(PlacePageSection::Bookmark);
m_cells[PlacePageSection::Bookmark].push_back(MWMPlacePageCellTypeBookmark);
sort(m_sections.begin(), m_sections.end());
[self configure];
}
@ -286,7 +343,14 @@ enum class AttributePosition
[[Statistics instance] logEvent:kStatEventName(kStatPlacePage, kStatToggleBookmark)
withParameters:@{kStatValue : kStatRemove}];
self.entity.type = MWMPlacePageEntityTypeRegular;
[self.entity removeBookmarkField];
auto const it = find(m_sections.begin(), m_sections.end(), PlacePageSection::Bookmark);
if (it != m_sections.end())
{
m_sections.erase(it);
m_cells.erase(PlacePageSection::Bookmark);
}
[self configure];
}
@ -366,8 +430,7 @@ enum class AttributePosition
- (MWMPlacePageCellType)cellTypeForIndexPath:(NSIndexPath *)indexPath
{
MWMPlacePageCellType const cellType = [self.entity getCellType:indexPath.row];
return cellType;
return [self cellsForSection:indexPath.section][indexPath.row];
}
- (NSString *)cellIdentifierForIndexPath:(NSIndexPath *)indexPath
@ -433,7 +496,12 @@ enum class AttributePosition
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return [self.entity getCellsCount];
return [self cellsForSection:section].size();
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return m_sections.size();
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
@ -442,4 +510,33 @@ enum class AttributePosition
return [tableView dequeueReusableCellWithIdentifier:reuseIdentifier];
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
return section == m_sections.size() - 1 ? kDefaultHeaderHeight : 0.;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
return kDefaultHeaderHeight;
}
- (vector<MWMPlacePageCellType>)cellsForSection:(NSInteger)section
{
switch (m_sections.size())
{
case 1:
return m_cells[PlacePageSection::Metadata];
case 2:
if (self.entity.canEditObject)
return section == 0 ? m_cells[PlacePageSection::Metadata] : m_cells[PlacePageSection::Editing];
else
return section == 0 ? m_cells[PlacePageSection::Bookmark] : m_cells[PlacePageSection::Metadata];
case 3:
return m_cells[static_cast<PlacePageSection>(section)];
default:
NSAssert(false, @"Invalid m_sections size");
return {};
}
}
@end

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9531" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9531" systemVersion="15A284" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
@ -11,10 +11,10 @@
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
<rect key="frame" x="0.0" y="0.0" width="320" height="43.5"/>
<rect key="frame" x="0.0" y="0.0" width="320" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="jmU-dJ-aRH">
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="jmU-dJ-aRH">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<constraints>
<constraint firstAttribute="height" priority="999" constant="44" id="gfO-mi-8yS"/>
@ -34,21 +34,9 @@
<action selector="editPlaceButtonTouchUpIndide" destination="KGk-i7-Jjw" eventType="touchUpInside" id="ZyS-5r-oKK"/>
</connections>
</button>
<imageView userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ic_arrow_gray" translatesAutoresizingMaskIntoConstraints="NO" id="nmV-hA-8Mm" userLabel="Gray Arrow">
<rect key="frame" x="284" y="8" width="28" height="28"/>
<constraints>
<constraint firstAttribute="height" constant="28" id="MiH-Ce-WSz"/>
<constraint firstAttribute="width" constant="28" id="WBw-9f-vKj"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="coloring" value="MWMGray"/>
</userDefinedRuntimeAttributes>
</imageView>
</subviews>
<constraints>
<constraint firstItem="nmV-hA-8Mm" firstAttribute="centerY" secondItem="jmU-dJ-aRH" secondAttribute="centerY" id="8XG-2F-zJl"/>
<constraint firstItem="jmU-dJ-aRH" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="NxH-y9-BLI"/>
<constraint firstItem="nmV-hA-8Mm" firstAttribute="trailing" secondItem="jmU-dJ-aRH" secondAttribute="trailing" constant="-8" id="Yxd-aQ-HkW"/>
<constraint firstAttribute="trailing" secondItem="jmU-dJ-aRH" secondAttribute="trailing" id="bcE-yn-K3v"/>
<constraint firstAttribute="bottom" secondItem="jmU-dJ-aRH" secondAttribute="bottom" id="sc3-KG-vSR"/>
<constraint firstItem="jmU-dJ-aRH" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="yES-81-JAM"/>
@ -62,7 +50,4 @@
</userDefinedRuntimeAttributes>
</tableViewCell>
</objects>
<resources>
<image name="ic_arrow_gray" width="28" height="28"/>
</resources>
</document>

View file

@ -56,6 +56,7 @@ using MWMPlacePageCellTypeValueMap = map<MWMPlacePageCellType, string>;
@property (copy, nonatomic) NSString * bookmarkColor;
@property (copy, nonatomic) NSSet<NSString *> * cuisines;
@property (copy, nonatomic) NSArray<NSString *> * nearbyStreets;
@property (nonatomic, readonly) BOOL canEditObject;
@property (nonatomic) MWMPlacePageEntityType type;
@ -66,16 +67,11 @@ using MWMPlacePageCellTypeValueMap = map<MWMPlacePageCellType, string>;
@property (nonatomic, readonly) ms::LatLon latlon;
- (void)addBookmarkField;
- (void)removeBookmarkField;
- (instancetype)initWithDelegate:(id<MWMPlacePageEntityProtocol>)delegate;
- (void)synchronize;
- (void)toggleCoordinateSystem;
- (NSUInteger)getCellsCount;
- (MWMPlacePageCellType)getCellType:(NSUInteger)index;
- (NSString *)getCellValue:(MWMPlacePageCellType)cellType;
- (BOOL)isCellEditable:(MWMPlacePageCellType)cellType;
- (void)saveEditedCells:(MWMPlacePageCellTypeValueMap const &)cells;

View file

@ -27,18 +27,12 @@ NSString * makeOSMCuisineString(NSSet<NSString *> * cuisines)
return [osmCuisines componentsJoinedByString:kOSMCuisineSeparator];
}
array<MWMPlacePageCellType, 10> const gMetaFieldsMap{
{MWMPlacePageCellTypePostcode, MWMPlacePageCellTypePhoneNumber, MWMPlacePageCellTypeWebsite,
MWMPlacePageCellTypeURL, MWMPlacePageCellTypeEmail, MWMPlacePageCellTypeOpenHours,
MWMPlacePageCellTypeWiFi, MWMPlacePageCellTypeCoordinate, MWMPlacePageCellTypeBookmark,
MWMPlacePageCellTypeEditButton}};
NSUInteger kMetaFieldsMap[MWMPlacePageCellTypeCount] = {};
NSUInteger gMetaFieldsMap[MWMPlacePageCellTypeCount] = {};
void putFields(NSUInteger eTypeValue, NSUInteger ppValue)
{
kMetaFieldsMap[eTypeValue] = ppValue;
kMetaFieldsMap[ppValue] = eTypeValue;
gMetaFieldsMap[eTypeValue] = ppValue;
gMetaFieldsMap[ppValue] = eTypeValue;
}
void initFieldsMap()
@ -52,25 +46,25 @@ void initFieldsMap()
putFields(Metadata::FMD_INTERNET, MWMPlacePageCellTypeWiFi);
putFields(Metadata::FMD_CUISINE, MWMPlacePageCellTypeCuisine);
ASSERT_EQUAL(kMetaFieldsMap[Metadata::FMD_URL], MWMPlacePageCellTypeURL, ());
ASSERT_EQUAL(kMetaFieldsMap[MWMPlacePageCellTypeURL], Metadata::FMD_URL, ());
ASSERT_EQUAL(kMetaFieldsMap[Metadata::FMD_WEBSITE], MWMPlacePageCellTypeWebsite, ());
ASSERT_EQUAL(kMetaFieldsMap[MWMPlacePageCellTypeWebsite], Metadata::FMD_WEBSITE, ());
ASSERT_EQUAL(kMetaFieldsMap[Metadata::FMD_POSTCODE], MWMPlacePageCellTypePostcode, ());
ASSERT_EQUAL(kMetaFieldsMap[MWMPlacePageCellTypePostcode], Metadata::FMD_POSTCODE, ());
ASSERT_EQUAL(kMetaFieldsMap[Metadata::FMD_MAXSPEED], 0, ());
ASSERT_EQUAL(gMetaFieldsMap[Metadata::FMD_URL], MWMPlacePageCellTypeURL, ());
ASSERT_EQUAL(gMetaFieldsMap[MWMPlacePageCellTypeURL], Metadata::FMD_URL, ());
ASSERT_EQUAL(gMetaFieldsMap[Metadata::FMD_WEBSITE], MWMPlacePageCellTypeWebsite, ());
ASSERT_EQUAL(gMetaFieldsMap[MWMPlacePageCellTypeWebsite], Metadata::FMD_WEBSITE, ());
ASSERT_EQUAL(gMetaFieldsMap[Metadata::FMD_POSTCODE], MWMPlacePageCellTypePostcode, ());
ASSERT_EQUAL(gMetaFieldsMap[MWMPlacePageCellTypePostcode], Metadata::FMD_POSTCODE, ());
ASSERT_EQUAL(gMetaFieldsMap[Metadata::FMD_MAXSPEED], 0, ());
}
} // namespace
@interface MWMPlacePageEntity ()
@property (weak, nonatomic) id<MWMPlacePageEntityProtocol> delegate;
@property (nonatomic, readwrite) BOOL canEditObject;
@end
@implementation MWMPlacePageEntity
{
vector<MWMPlacePageCellType> m_fields;
set<MWMPlacePageCellType> m_editableFields;
MWMPlacePageCellTypeValueMap m_values;
}
@ -133,35 +127,6 @@ void initFieldsMap()
break;
}
[self setEditableTypes];
[self sortMetaFields];
}
- (void)sortMetaFields
{
auto const begin = gMetaFieldsMap.begin();
auto const end = gMetaFieldsMap.end();
sort(m_fields.begin(), m_fields.end(), [&](MWMPlacePageCellType a, MWMPlacePageCellType b)
{
return find(begin, end, a) < find(begin, end, b);
});
}
- (void)addMetaField:(NSUInteger)value
{
NSAssert(value >= Metadata::FMD_COUNT, @"Incorrect enum value");
MWMPlacePageCellType const field = static_cast<MWMPlacePageCellType>(value);
if (find(gMetaFieldsMap.begin(), gMetaFieldsMap.end(), field) == gMetaFieldsMap.end())
return;
if (find(m_fields.begin(), m_fields.end(), field) == m_fields.end())
m_fields.emplace_back(field);
}
- (void)removeMetaField:(NSUInteger)value
{
NSAssert(value >= Metadata::FMD_COUNT, @"Incorrect enum value");
auto const it = find(m_fields.begin(), m_fields.end(), value);
if (it != m_fields.end())
m_fields.erase(it);
}
- (void)setMetaField:(NSUInteger)key value:(string const &)value
@ -169,15 +134,9 @@ void initFieldsMap()
NSAssert(key >= Metadata::FMD_COUNT, @"Incorrect enum value");
MWMPlacePageCellType const cellType = static_cast<MWMPlacePageCellType>(key);
if (value.empty())
{
[self removeMetaField:key];
m_values.erase(cellType);
}
else
{
[self addMetaField:key];
m_values[cellType] = value;
}
}
- (void)configureForBookmark:(UserMark const *)bookmark
@ -197,7 +156,6 @@ void initFieldsMap()
self.bookmarkColor = @(data.GetType().c_str());
[self configureWithFeature:bookmark->GetFeature() andCustomName:nil];
[self addBookmarkField];
}
- (void)configureForMyPosition:(MyPositionMarkPoint const *)myPositionMark
@ -205,7 +163,6 @@ void initFieldsMap()
// TODO: There is need to get address info which store feature address.
self.title = L(@"my_position");
self.type = MWMPlacePageEntityTypeMyPosition;
[self addMetaField:MWMPlacePageCellTypeCoordinate];
}
- (void)configureForApi:(ApiMarkPoint const *)apiMark
@ -214,7 +171,6 @@ void initFieldsMap()
self.type = MWMPlacePageEntityTypeAPI;
self.title = @(apiMark->GetName().c_str());
self.category = @(GetFramework().GetApiDataHolder().GetAppTitle().c_str());
[self addMetaField:MWMPlacePageCellTypeCoordinate];
}
- (void)configureWithFeature:(FeatureType *)feature andCustomName:(NSString *)customName
@ -280,10 +236,10 @@ void initFieldsMap()
case Metadata::FMD_OPEN_HOURS:
case Metadata::FMD_EMAIL:
case Metadata::FMD_POSTCODE:
[self setMetaField:kMetaFieldsMap[type] value:metadata.Get(type)];
[self setMetaField:gMetaFieldsMap[type] value:metadata.Get(type)];
break;
case Metadata::FMD_INTERNET:
[self setMetaField:kMetaFieldsMap[type] value:L(@"WiFi_available").UTF8String];
[self setMetaField:gMetaFieldsMap[type] value:L(@"WiFi_available").UTF8String];
break;
default:
break;
@ -292,24 +248,6 @@ void initFieldsMap()
[self processStreets];
}
[self addMetaField:MWMPlacePageCellTypeCoordinate];
}
- (void)addEditField
{
[self addMetaField:MWMPlacePageCellTypeEditButton];
}
- (void)addBookmarkField
{
[self addMetaField:MWMPlacePageCellTypeBookmark];
[self sortMetaFields];
}
- (void)removeBookmarkField
{
[self removeMetaField:MWMPlacePageCellTypeBookmark];
}
- (void)toggleCoordinateSystem
@ -350,8 +288,7 @@ void initFieldsMap()
return;
osm::EditableProperties const editable = osm::Editor::Instance().GetEditableProperties(*feature);
if (editable.IsEditable())
[self addEditField];
self.canEditObject = editable.IsEditable();
if (editable.m_name)
m_editableFields.insert(MWMPlacePageCellTypeName);
if (editable.m_address)
@ -361,8 +298,8 @@ void initFieldsMap()
}
for (feature::Metadata::EType const type : editable.m_metadata)
{
NSAssert(kMetaFieldsMap[type] >= Metadata::FMD_COUNT || kMetaFieldsMap[type] == 0, @"Incorrect enum value");
MWMPlacePageCellType const field = static_cast<MWMPlacePageCellType>(kMetaFieldsMap[type]);
NSAssert(gMetaFieldsMap[type] >= Metadata::FMD_COUNT || gMetaFieldsMap[type] == 0, @"Incorrect enum value");
MWMPlacePageCellType const field = static_cast<MWMPlacePageCellType>(gMetaFieldsMap[type]);
m_editableFields.insert(field);
}
}
@ -394,14 +331,14 @@ void initFieldsMap()
case MWMPlacePageCellTypeEmail:
case MWMPlacePageCellTypeWiFi:
{
Metadata::EType const fmdType = static_cast<Metadata::EType>(kMetaFieldsMap[cell.first]);
Metadata::EType const fmdType = static_cast<Metadata::EType>(gMetaFieldsMap[cell.first]);
NSAssert(fmdType > 0 && fmdType < Metadata::FMD_COUNT, @"Incorrect enum value");
metadata.Set(fmdType, cell.second);
break;
}
case MWMPlacePageCellTypeCuisine:
{
Metadata::EType const fmdType = static_cast<Metadata::EType>(kMetaFieldsMap[cell.first]);
Metadata::EType const fmdType = static_cast<Metadata::EType>(gMetaFieldsMap[cell.first]);
NSAssert(fmdType > 0 && fmdType < Metadata::FMD_COUNT, @"Incorrect enum value");
NSString * osmCuisineStr = makeOSMCuisineString(self.cuisines);
metadata.Set(fmdType, osmCuisineStr.UTF8String);
@ -435,17 +372,6 @@ void initFieldsMap()
#pragma mark - Getters
- (NSUInteger)getCellsCount
{
return m_fields.size();
}
- (MWMPlacePageCellType)getCellType:(NSUInteger)index
{
NSAssert(index < [self getCellsCount], @"Invalid meta index");
return m_fields[index];
}
- (NSString *)getCellValue:(MWMPlacePageCellType)cellType
{
switch (cellType)
@ -454,6 +380,10 @@ void initFieldsMap()
return self.title;
case MWMPlacePageCellTypeCoordinate:
return [self coordinate];
case MWMPlacePageCellTypeBookmark:
return self.type == MWMPlacePageEntityTypeBookmark ? @"haveValue" : nil;
case MWMPlacePageCellTypeEditButton:
return self.canEditObject ? @"haveValue" : nil;
default:
{
auto const it = m_values.find(cellType);

View file

@ -11,6 +11,13 @@
<rect key="frame" x="0.0" y="0.0" width="320" height="48"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="separator_image" id="WPU-f0-gXc">
<rect key="frame" x="0.0" y="0.0" width="320" height="1"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="coloring" value="MWMSeparator"/>
</userDefinedRuntimeAttributes>
</imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="pZD-rg-W4y" userLabel="BackButton" customClass="MWMButton">
<rect key="frame" x="0.0" y="-5" width="80" height="46"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
@ -133,6 +140,13 @@
<rect key="frame" x="0.0" y="0.0" width="320" height="48"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="separator_image" id="Lgi-vx-FHb">
<rect key="frame" x="0.0" y="0.0" width="320" height="1"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="coloring" value="MWMSeparator"/>
</userDefinedRuntimeAttributes>
</imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="yN5-Eq-jO7">
<rect key="frame" x="0.0" y="0.0" width="159" height="48"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
@ -184,5 +198,6 @@
<image name="ic_bookmarks_on" width="28" height="28"/>
<image name="ic_menu_share" width="28" height="28"/>
<image name="ic_route" width="28" height="28"/>
<image name="separator_image" width="1" height="1"/>
</resources>
</document>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9531" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9531" systemVersion="15A284" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
@ -11,7 +11,7 @@
<rect key="frame" x="0.0" y="0.0" width="320" height="223"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="jfp-wb-Z7G" id="kUu-ao-FYN">
<rect key="frame" x="0.0" y="0.0" width="320" height="222.5"/>
<rect key="frame" x="0.0" y="0.0" width="320" height="222"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ic_bookmark" translatesAutoresizingMaskIntoConstraints="NO" id="NJ3-lK-ziZ" userLabel="Bookmark icon">
@ -54,16 +54,15 @@
<action selector="colorPickerButtonTap" destination="jfp-wb-Z7G" eventType="touchUpInside" id="2LS-Ru-Bhb"/>
</connections>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="6e1-wr-Alw" userLabel="Separator #1">
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="separator_image" translatesAutoresizingMaskIntoConstraints="NO" id="6Sw-sF-BAZ">
<rect key="frame" x="60" y="44" width="208" height="1"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.12" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="wKq-as-hJq"/>
<constraint firstAttribute="height" constant="1" id="hnX-4Y-Bbu"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="backgroundColorName" value="blackDividers"/>
<userDefinedRuntimeAttribute type="string" keyPath="coloring" value="MWMSeparator"/>
</userDefinedRuntimeAttributes>
</view>
</imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="jxG-Qv-eKF" userLabel="Category Button">
<rect key="frame" x="60" y="45" width="208" height="44"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
@ -86,16 +85,15 @@
<view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="f8i-PA-TJb" userLabel="Note">
<rect key="frame" x="0.0" y="89" width="320" height="88"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="rwd-Um-zNb" userLabel="Separator #2">
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="separator_image" translatesAutoresizingMaskIntoConstraints="NO" id="PPH-o3-NeV">
<rect key="frame" x="0.0" y="0.0" width="320" height="1"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.12" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="0g9-86-Unw"/>
<constraint firstAttribute="height" constant="1" id="ktm-Nz-rdC"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="backgroundColorName" value="blackDividers"/>
<userDefinedRuntimeAttribute type="string" keyPath="coloring" value="MWMSeparator"/>
</userDefinedRuntimeAttributes>
</view>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Note" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="XF8-Ny-HSu" userLabel="Title">
<rect key="frame" x="16" y="13" width="31" height="17"/>
<fontDescription key="fontDescription" name="HelveticaNeue" family="Helvetica Neue" pointSize="14"/>
@ -131,28 +129,27 @@
<constraint firstItem="1yW-c7-l8L" firstAttribute="top" secondItem="XF8-Ny-HSu" secondAttribute="bottom" constant="8" id="1Dv-8c-J8F"/>
<constraint firstItem="fVU-OV-gcK" firstAttribute="top" secondItem="XF8-Ny-HSu" secondAttribute="bottom" constant="16" id="32Q-yX-6EP"/>
<constraint firstItem="1yW-c7-l8L" firstAttribute="leading" secondItem="f8i-PA-TJb" secondAttribute="leading" constant="16" id="6vP-Tg-Q2p"/>
<constraint firstItem="PPH-o3-NeV" firstAttribute="top" secondItem="f8i-PA-TJb" secondAttribute="top" id="Dpa-YG-Typ"/>
<constraint firstAttribute="bottom" secondItem="1yW-c7-l8L" secondAttribute="bottom" id="EEq-tP-Q3r"/>
<constraint firstAttribute="trailing" secondItem="PPH-o3-NeV" secondAttribute="trailing" id="FAe-rx-XNn"/>
<constraint firstAttribute="trailing" secondItem="fVU-OV-gcK" secondAttribute="trailing" constant="16" id="FOU-f4-TaK"/>
<constraint firstAttribute="trailing" secondItem="1yW-c7-l8L" secondAttribute="trailing" constant="16" id="HCK-RR-QTa"/>
<constraint firstItem="rwd-Um-zNb" firstAttribute="leading" secondItem="f8i-PA-TJb" secondAttribute="leading" id="JAS-Lf-TnG"/>
<constraint firstItem="fVU-OV-gcK" firstAttribute="leading" secondItem="f8i-PA-TJb" secondAttribute="leading" constant="16" id="OH6-73-FCW"/>
<constraint firstAttribute="height" constant="88" id="P0o-9l-5ht"/>
<constraint firstAttribute="trailing" secondItem="rwd-Um-zNb" secondAttribute="trailing" id="eRh-OF-HHJ"/>
<constraint firstItem="XF8-Ny-HSu" firstAttribute="top" secondItem="rwd-Um-zNb" secondAttribute="bottom" constant="12" id="jOZ-xI-bCL"/>
<constraint firstItem="XF8-Ny-HSu" firstAttribute="top" secondItem="PPH-o3-NeV" secondAttribute="bottom" constant="12" id="RpK-qu-swq"/>
<constraint firstItem="PPH-o3-NeV" firstAttribute="leading" secondItem="f8i-PA-TJb" secondAttribute="leading" id="hgq-Hu-5tM"/>
<constraint firstItem="XF8-Ny-HSu" firstAttribute="leading" secondItem="f8i-PA-TJb" secondAttribute="leading" constant="16" id="t8B-yg-VDs"/>
<constraint firstItem="rwd-Um-zNb" firstAttribute="top" secondItem="f8i-PA-TJb" secondAttribute="top" id="u3c-ZQ-FDu"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="4nO-GH-Nv6" userLabel="Separator #3">
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="separator_image" translatesAutoresizingMaskIntoConstraints="NO" id="jQd-Tp-1fN">
<rect key="frame" x="16" y="177" width="304" height="1"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.12" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="oyp-iV-mpJ"/>
<constraint firstAttribute="height" constant="1" id="NW5-jJ-qkf"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="backgroundColorName" value="blackDividers"/>
<userDefinedRuntimeAttribute type="string" keyPath="coloring" value="MWMSeparator"/>
</userDefinedRuntimeAttributes>
</view>
</imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="8KR-m1-j51">
<rect key="frame" x="0.0" y="178" width="320" height="44"/>
<constraints>
@ -182,45 +179,32 @@
<userDefinedRuntimeAttribute type="string" keyPath="coloring" value="MWMGray"/>
</userDefinedRuntimeAttributes>
</imageView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Sx9-cz-Scg" userLabel="Separator #4">
<rect key="frame" x="0.0" y="222" width="320" height="1"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.12" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="PcL-HG-sPH"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="backgroundColorName" value="blackDividers"/>
</userDefinedRuntimeAttributes>
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="8KR-m1-j51" firstAttribute="width" secondItem="f8i-PA-TJb" secondAttribute="width" id="7FM-xU-xDL"/>
<constraint firstItem="Wax-9r-T5y" firstAttribute="leading" secondItem="VLh-WI-T7X" secondAttribute="trailing" constant="12" id="7mj-gk-N51"/>
<constraint firstItem="Sx9-cz-Scg" firstAttribute="top" secondItem="8KR-m1-j51" secondAttribute="bottom" id="9Kr-d5-TnV"/>
<constraint firstItem="8KR-m1-j51" firstAttribute="top" secondItem="4nO-GH-Nv6" secondAttribute="bottom" id="Czz-pd-70n"/>
<constraint firstItem="6e1-wr-Alw" firstAttribute="width" secondItem="VLh-WI-T7X" secondAttribute="width" id="EvW-dl-wiL"/>
<constraint firstAttribute="bottom" secondItem="8KR-m1-j51" secondAttribute="bottom" constant="0.5" id="9NO-0R-Luf"/>
<constraint firstItem="8KR-m1-j51" firstAttribute="centerX" secondItem="f8i-PA-TJb" secondAttribute="centerX" id="Fho-1G-DMQ"/>
<constraint firstItem="jxG-Qv-eKF" firstAttribute="width" secondItem="6e1-wr-Alw" secondAttribute="width" id="HOz-WX-WLt"/>
<constraint firstItem="4nO-GH-Nv6" firstAttribute="leading" secondItem="kUu-ao-FYN" secondAttribute="leading" constant="16" id="KuY-P3-rz8"/>
<constraint firstItem="jxG-Qv-eKF" firstAttribute="top" secondItem="6e1-wr-Alw" secondAttribute="bottom" id="Mmh-Od-405"/>
<constraint firstItem="Sx9-cz-Scg" firstAttribute="centerX" secondItem="8KR-m1-j51" secondAttribute="centerX" id="R2v-D5-fHw"/>
<constraint firstAttribute="bottom" secondItem="Sx9-cz-Scg" secondAttribute="bottom" id="SuF-wy-cAu"/>
<constraint firstItem="6e1-wr-Alw" firstAttribute="centerX" secondItem="VLh-WI-T7X" secondAttribute="centerX" id="UjZ-c7-pSl"/>
<constraint firstItem="6Sw-sF-BAZ" firstAttribute="width" secondItem="jxG-Qv-eKF" secondAttribute="width" id="JSz-z8-INP"/>
<constraint firstAttribute="trailing" secondItem="jQd-Tp-1fN" secondAttribute="trailing" id="RPx-Nz-KRT"/>
<constraint firstItem="6Sw-sF-BAZ" firstAttribute="width" secondItem="VLh-WI-T7X" secondAttribute="width" id="Rw1-ja-32Y"/>
<constraint firstItem="jQd-Tp-1fN" firstAttribute="leading" secondItem="kUu-ao-FYN" secondAttribute="leading" constant="16" id="V9A-XV-GR9"/>
<constraint firstItem="VLh-WI-T7X" firstAttribute="leading" secondItem="kUu-ao-FYN" secondAttribute="leading" constant="60" id="XuD-Lr-D6H"/>
<constraint firstItem="NJ3-lK-ziZ" firstAttribute="leading" secondItem="kUu-ao-FYN" secondAttribute="leading" constant="16" id="Z9y-hZ-0pk"/>
<constraint firstAttribute="trailing" secondItem="4nO-GH-Nv6" secondAttribute="trailing" id="cKX-Iv-5p5"/>
<constraint firstItem="6Sw-sF-BAZ" firstAttribute="centerX" secondItem="jxG-Qv-eKF" secondAttribute="centerX" id="aCl-Fa-gVd"/>
<constraint firstItem="meU-rN-T7y" firstAttribute="trailing" secondItem="8KR-m1-j51" secondAttribute="trailing" constant="-8" id="f7Q-08-8Ix"/>
<constraint firstItem="8KR-m1-j51" firstAttribute="top" secondItem="jQd-Tp-1fN" secondAttribute="bottom" id="gay-5M-3os"/>
<constraint firstItem="f8i-PA-TJb" firstAttribute="top" secondItem="jxG-Qv-eKF" secondAttribute="bottom" id="jP6-dp-yga"/>
<constraint firstItem="VLh-WI-T7X" firstAttribute="top" secondItem="kUu-ao-FYN" secondAttribute="top" id="juQ-wl-6VY"/>
<constraint firstItem="Sx9-cz-Scg" firstAttribute="width" secondItem="8KR-m1-j51" secondAttribute="width" id="mFP-u1-HIX"/>
<constraint firstItem="f8i-PA-TJb" firstAttribute="leading" secondItem="kUu-ao-FYN" secondAttribute="leading" id="oCY-wT-Wsp"/>
<constraint firstItem="jxG-Qv-eKF" firstAttribute="centerX" secondItem="6e1-wr-Alw" secondAttribute="centerX" id="pJb-3Q-i3P"/>
<constraint firstItem="Wax-9r-T5y" firstAttribute="centerY" secondItem="VLh-WI-T7X" secondAttribute="centerY" id="pb4-Hs-7GJ"/>
<constraint firstItem="NJ3-lK-ziZ" firstAttribute="centerY" secondItem="VLh-WI-T7X" secondAttribute="centerY" id="qxx-I2-YpL"/>
<constraint firstItem="jxG-Qv-eKF" firstAttribute="top" secondItem="6Sw-sF-BAZ" secondAttribute="bottom" id="rAw-cP-0GU"/>
<constraint firstItem="6Sw-sF-BAZ" firstAttribute="centerX" secondItem="VLh-WI-T7X" secondAttribute="centerX" id="rH0-9H-b0M"/>
<constraint firstAttribute="trailing" secondItem="f8i-PA-TJb" secondAttribute="trailing" id="ua5-7p-icx"/>
<constraint firstItem="6Sw-sF-BAZ" firstAttribute="top" secondItem="VLh-WI-T7X" secondAttribute="bottom" id="w1u-Yh-IJP"/>
<constraint firstItem="meU-rN-T7y" firstAttribute="centerY" secondItem="8KR-m1-j51" secondAttribute="centerY" id="x5H-j5-32G"/>
<constraint firstItem="6e1-wr-Alw" firstAttribute="top" secondItem="VLh-WI-T7X" secondAttribute="bottom" id="yeD-nY-idE"/>
<constraint firstAttribute="trailing" secondItem="Wax-9r-T5y" secondAttribute="trailing" constant="12" id="zy0-un-D4A"/>
</constraints>
<userDefinedRuntimeAttributes>
@ -248,5 +232,6 @@
<image name="ic_arrow_gray" width="28" height="28"/>
<image name="ic_bookmark" width="28" height="28"/>
<image name="placemark-red-on" width="28" height="28"/>
<image name="separator_image" width="1" height="1"/>
</resources>
</document>

View file

@ -75,16 +75,17 @@
<userDefinedRuntimeAttribute type="string" keyPath="coloring" value="MWMSeparator"/>
</userDefinedRuntimeAttributes>
</imageView>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" allowsSelection="NO" showsSelectionImmediatelyOnTouchBegin="NO" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" id="hZM-Gs-BbS">
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="grouped" separatorStyle="default" allowsSelection="NO" showsSelectionImmediatelyOnTouchBegin="NO" rowHeight="44" sectionHeaderHeight="15" sectionFooterHeight="1" id="hZM-Gs-BbS">
<rect key="frame" x="0.0" y="84" width="320" height="384"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
<inset key="separatorInset" minX="60" minY="0.0" maxX="0.0" maxY="0.0"/>
<color key="sectionIndexBackgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="layer.borderUIColor">
<color key="value" white="0.0" alpha="0.20000000000000001" colorSpace="calibratedWhite"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="string" keyPath="backgroundColorName" value="pressBackground"/>
</userDefinedRuntimeAttributes>
</tableView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="500 mi" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="kGT-CI-UsC">