Skip to content

Commit

Permalink
details view
Browse files Browse the repository at this point in the history
  • Loading branch information
chady committed Feb 21, 2013
1 parent 6257fe8 commit 82f259b
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,7 @@

@property (strong, nonatomic) id detailItem;

@property (weak, nonatomic) IBOutlet UILabel *detailDescriptionLabel;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UITextView *phonesView;

@end
14 changes: 13 additions & 1 deletion Example/CKPhoneLibTest/CKPhoneLibTest/CKDetailViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,19 @@ - (void)configureView
// Update the user interface for the detail item.

if (self.detailItem) {
self.detailDescriptionLabel.text = [self.detailItem description];

self.nameLabel.text = [self.detailItem objectForKey:@"name"];

NSString * phones = @"";
NSArray * numbers = [self.detailItem objectForKey:@"numbers"];
for (NSString * phone in numbers) {

phones = [phones stringByAppendingFormat:@"\n%@ -> (%@) (%@)", phone, @"blah", @"foo"];

}

self.phonesView.text = phones;

}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="2.0" toolsVersion="3084" systemVersion="12C60" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="3">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="2.0" toolsVersion="3084" systemVersion="12C60" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" initialViewController="3">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="2083"/>
</dependencies>
Expand Down Expand Up @@ -77,23 +77,27 @@
<rect key="frame" x="0.0" y="64" width="320" height="504"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<label clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" text="Detail view content goes here" textAlignment="center" lineBreakMode="tailTruncation" minimumFontSize="10" translatesAutoresizingMaskIntoConstraints="NO" id="27">
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" size="system"/>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Name" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="mey-Nj-kgh">
<rect key="frame" x="20" y="36" width="280" height="29"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" text="Phones" id="1vN-xi-cm8">
<rect key="frame" x="20" y="73" width="280" height="261"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
</textView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="27" firstAttribute="centerY" secondItem="22" secondAttribute="centerY" type="default" id="7cE-gL-0wv"/>
<constraint firstItem="27" firstAttribute="leading" secondItem="22" secondAttribute="leading" constant="20" symbolic="YES" type="default" id="R0m-z7-TWk"/>
<constraint firstAttribute="trailing" secondItem="27" secondAttribute="trailing" constant="20" symbolic="YES" type="default" id="pRe-qY-58T"/>
</constraints>
</view>
<navigationItem key="navigationItem" title="Detail" id="26"/>
<connections>
<outlet property="detailDescriptionLabel" destination="27" id="28"/>
<outlet property="nameLabel" destination="mey-Nj-kgh" id="3T9-Pi-eM2"/>
<outlet property="phonesView" destination="1vN-xi-cm8" id="7IA-lq-0xq"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="23" sceneMemberID="firstResponder"/>
Expand All @@ -105,7 +109,8 @@
<class className="CKDetailViewController" superclassName="UIViewController">
<source key="sourceIdentifier" type="project" relativePath="./Classes/CKDetailViewController.h"/>
<relationships>
<relationship kind="outlet" name="detailDescriptionLabel" candidateClass="UILabel"/>
<relationship kind="outlet" name="nameLabel" candidateClass="UILabel"/>
<relationship kind="outlet" name="phonesView" candidateClass="UITextView"/>
</relationships>
</class>
<class className="CKMasterViewController" superclassName="UITableViewController">
Expand All @@ -114,9 +119,6 @@
<relationship kind="action" name="loadContacts:"/>
</relationships>
</class>
<class className="NSLayoutConstraint" superclassName="NSObject">
<source key="sourceIdentifier" type="project" relativePath="./Classes/NSLayoutConstraint.h"/>
</class>
</classes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
Expand Down

0 comments on commit 82f259b

Please sign in to comment.