Adds name to monster detail view.
Passes the selected monster from the search view to the monster detail view.
This commit is contained in:
@@ -47,16 +47,6 @@
|
|||||||
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="43I-Fg-55Z">
|
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="43I-Fg-55Z">
|
||||||
<rect key="frame" x="0.0" y="88" width="414" height="725"/>
|
<rect key="frame" x="0.0" y="88" width="414" height="725"/>
|
||||||
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
|
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
|
||||||
<prototypes>
|
|
||||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="OvK-M9-fq5">
|
|
||||||
<rect key="frame" x="0.0" y="28" width="414" height="44"/>
|
|
||||||
<autoresizingMask key="autoresizingMask"/>
|
|
||||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="OvK-M9-fq5" id="Xss-ca-pCw">
|
|
||||||
<rect key="frame" x="0.0" y="0.0" width="414" height="44"/>
|
|
||||||
<autoresizingMask key="autoresizingMask"/>
|
|
||||||
</tableViewCellContentView>
|
|
||||||
</tableViewCell>
|
|
||||||
</prototypes>
|
|
||||||
<sections/>
|
<sections/>
|
||||||
<connections>
|
<connections>
|
||||||
<outlet property="dataSource" destination="IwG-ax-Esn" id="3Ya-Rh-Hn4"/>
|
<outlet property="dataSource" destination="IwG-ax-Esn" id="3Ya-Rh-Hn4"/>
|
||||||
@@ -104,7 +94,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<tabBarItem key="tabBarItem" title="Dashboard" image="rectangle.3.offgrid.fill" catalog="system" id="wgb-7v-3jq"/>
|
<tabBarItem key="tabBarItem" title="Dashboard" image="rectangle.3.offgrid.fill" catalog="system" id="wgb-7v-3jq"/>
|
||||||
<connections>
|
<connections>
|
||||||
<segue destination="qLX-b5-SkZ" kind="presentation" id="sr3-CG-0gP"/>
|
<segue destination="qLX-b5-SkZ" kind="presentation" identifier="ShowMonsterDetail" id="sr3-CG-0gP"/>
|
||||||
</connections>
|
</connections>
|
||||||
</viewController>
|
</viewController>
|
||||||
<placeholder placeholderIdentifier="IBFirstResponder" id="onm-5g-reZ" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
|
<placeholder placeholderIdentifier="IBFirstResponder" id="onm-5g-reZ" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
|
||||||
@@ -123,7 +113,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<tabBarItem key="tabBarItem" title="Collections" image="tray.full.fill" catalog="system" id="7og-Zf-zGt"/>
|
<tabBarItem key="tabBarItem" title="Collections" image="tray.full.fill" catalog="system" id="7og-Zf-zGt"/>
|
||||||
<connections>
|
<connections>
|
||||||
<segue destination="qLX-b5-SkZ" kind="presentation" id="1Lj-e3-q3z"/>
|
<segue destination="qLX-b5-SkZ" kind="presentation" identifier="ShowMonsterDetail" id="1Lj-e3-q3z"/>
|
||||||
</connections>
|
</connections>
|
||||||
</viewController>
|
</viewController>
|
||||||
<placeholder placeholderIdentifier="IBFirstResponder" id="gar-xb-BMe" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
|
<placeholder placeholderIdentifier="IBFirstResponder" id="gar-xb-BMe" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
|
||||||
@@ -142,7 +132,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<tabBarItem key="tabBarItem" title="Library" image="book.fill" catalog="system" id="Kz3-Xe-dOi"/>
|
<tabBarItem key="tabBarItem" title="Library" image="book.fill" catalog="system" id="Kz3-Xe-dOi"/>
|
||||||
<connections>
|
<connections>
|
||||||
<segue destination="qLX-b5-SkZ" kind="presentation" id="aWg-AZ-vgo"/>
|
<segue destination="qLX-b5-SkZ" kind="presentation" identifier="ShowMonsterDetail" id="aWg-AZ-vgo"/>
|
||||||
</connections>
|
</connections>
|
||||||
</viewController>
|
</viewController>
|
||||||
<placeholder placeholderIdentifier="IBFirstResponder" id="1FB-l6-6nb" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
|
<placeholder placeholderIdentifier="IBFirstResponder" id="1FB-l6-6nb" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
|
||||||
@@ -154,12 +144,28 @@
|
|||||||
<objects>
|
<objects>
|
||||||
<viewController id="qLX-b5-SkZ" customClass="MonsterViewController" sceneMemberID="viewController">
|
<viewController id="qLX-b5-SkZ" customClass="MonsterViewController" sceneMemberID="viewController">
|
||||||
<view key="view" contentMode="scaleToFill" id="aUl-2i-Cv3">
|
<view key="view" contentMode="scaleToFill" id="aUl-2i-Cv3">
|
||||||
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
|
<rect key="frame" x="0.0" y="0.0" width="414" height="842"/>
|
||||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||||
|
<subviews>
|
||||||
|
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="QhW-Jl-IGd">
|
||||||
|
<rect key="frame" x="8" y="8" width="398" height="41"/>
|
||||||
|
<fontDescription key="fontDescription" type="boldSystem" pointSize="34"/>
|
||||||
|
<nil key="textColor"/>
|
||||||
|
<nil key="highlightedColor"/>
|
||||||
|
</label>
|
||||||
|
</subviews>
|
||||||
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
|
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
|
||||||
|
<constraints>
|
||||||
|
<constraint firstItem="QhW-Jl-IGd" firstAttribute="top" secondItem="94T-3G-yzn" secondAttribute="top" constant="8" id="4ru-QH-fKb"/>
|
||||||
|
<constraint firstItem="94T-3G-yzn" firstAttribute="trailing" secondItem="QhW-Jl-IGd" secondAttribute="trailing" constant="8" id="Kzk-jM-vEb"/>
|
||||||
|
<constraint firstItem="QhW-Jl-IGd" firstAttribute="leading" secondItem="94T-3G-yzn" secondAttribute="leading" constant="8" id="Qfx-iO-frj"/>
|
||||||
|
</constraints>
|
||||||
<viewLayoutGuide key="safeArea" id="94T-3G-yzn"/>
|
<viewLayoutGuide key="safeArea" id="94T-3G-yzn"/>
|
||||||
</view>
|
</view>
|
||||||
<navigationItem key="navigationItem" id="4KB-rX-Umj"/>
|
<navigationItem key="navigationItem" id="4KB-rX-Umj"/>
|
||||||
|
<connections>
|
||||||
|
<outlet property="monsterName" destination="QhW-Jl-IGd" id="1kI-Si-k4X"/>
|
||||||
|
</connections>
|
||||||
</viewController>
|
</viewController>
|
||||||
<placeholder placeholderIdentifier="IBFirstResponder" id="scT-cb-C2S" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
|
<placeholder placeholderIdentifier="IBFirstResponder" id="scT-cb-C2S" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
|
||||||
</objects>
|
</objects>
|
||||||
@@ -167,7 +173,7 @@
|
|||||||
</scene>
|
</scene>
|
||||||
</scenes>
|
</scenes>
|
||||||
<inferredMetricsTieBreakers>
|
<inferredMetricsTieBreakers>
|
||||||
<segue reference="kbb-pI-zWM"/>
|
<segue reference="sr3-CG-0gP"/>
|
||||||
</inferredMetricsTieBreakers>
|
</inferredMetricsTieBreakers>
|
||||||
<resources>
|
<resources>
|
||||||
<image name="book.fill" catalog="system" width="128" height="100"/>
|
<image name="book.fill" catalog="system" width="128" height="100"/>
|
||||||
|
|||||||
@@ -7,11 +7,16 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import <UIKit/UIKit.h>
|
#import <UIKit/UIKit.h>
|
||||||
|
#import "Monster.h"
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@interface MonsterViewController : UIViewController
|
@interface MonsterViewController : UIViewController
|
||||||
|
|
||||||
|
@property (weak, nonatomic) IBOutlet UILabel *monsterName;
|
||||||
|
|
||||||
|
@property Monster* monster;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
- (void)viewDidLoad {
|
- (void)viewDidLoad {
|
||||||
[super viewDidLoad];
|
[super viewDidLoad];
|
||||||
|
self.monsterName.text = _monster.name;
|
||||||
// Do any additional setup after loading the view.
|
// Do any additional setup after loading the view.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,15 +33,18 @@
|
|||||||
// Do any additional setup after loading the view.
|
// Do any additional setup after loading the view.
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
#pragma mark - Navigation
|
#pragma mark - Navigation
|
||||||
|
|
||||||
// In a storyboard-based application, you will often want to do a little preparation before navigation
|
// In a storyboard-based application, you will often want to do a little preparation before navigation
|
||||||
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
|
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
|
||||||
// Get the new view controller using [segue destinationViewController].
|
// Get the new view controller using [segue destinationViewController].
|
||||||
// Pass the selected object to the new view controller.
|
// Pass the selected object to the new view controller.
|
||||||
|
if ([@"ShowMonsterDetail" isEqualToString:segue.identifier]) {
|
||||||
|
NSIndexPath *indexPath = [self.searchResults indexPathForSelectedRow];
|
||||||
|
MonsterViewController *vc = (MonsterViewController*)segue.destinationViewController;
|
||||||
|
vc.monster = [_monsters objectAtIndex:indexPath.row];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
#pragma mark - UITableViewDataSource
|
#pragma mark - UITableViewDataSource
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user