Skip to content

Commit

Permalink
Added "New Fonts" sample
Browse files Browse the repository at this point in the history
  • Loading branch information
shu223 committed Oct 17, 2013
1 parent fba1cab commit fa24cb4
Show file tree
Hide file tree
Showing 6 changed files with 211 additions and 0 deletions.
43 changes: 43 additions & 0 deletions Resources/plists/addedIn7.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<string>Thonburi-Light</string>
<string>GeezaPro-Light</string>
<string>Menlo-BoldItalic</string>
<string>Menlo-Regular</string>
<string>Menlo-Bold</string>
<string>Menlo-Italic</string>
<string>IowanOldStyle-Bold</string>
<string>IowanOldStyle-BoldItalic</string>
<string>IowanOldStyle-Italic</string>
<string>IowanOldStyle-Roman</string>
<string>DamascusBold</string>
<string>Damascus</string>
<string>DamascusMedium</string>
<string>DamascusSemiBold</string>
<string>AlNile-Bold</string>
<string>AlNile</string>
<string>Farah</string>
<string>DINCondensed-Bold</string>
<string>Superclarendon-Regular</string>
<string>Superclarendon-BoldItalic</string>
<string>Superclarendon-Light</string>
<string>Superclarendon-BlackItalic</string>
<string>Superclarendon-Italic</string>
<string>Superclarendon-LightItalic</string>
<string>Superclarendon-Bold</string>
<string>Superclarendon-Black</string>
<string>DiwanMishafi</string>
<string>SavoyeLetPlain</string>
<string>AppleSDGothicNeo-Thin</string>
<string>AppleSDGothicNeo-SemiBold</string>
<string>AppleSDGothicNeo-Regular</string>
<string>AppleSDGothicNeo-Light</string>
<string>ArialHebrew-Light</string>
<string>HelveticaNeue-MediumItalic</string>
<string>HelveticaNeue-Thin</string>
<string>HelveticaNeue-Thin_Italic</string>
<string>DINAlternate-Bold</string>
</array>
</plist>
22 changes: 22 additions & 0 deletions iOS7Sampler.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@
8AEF0F9B17FC19C200D2B9BE /* ActivityTrackingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8AEF0F9917FC19C200D2B9BE /* ActivityTrackingViewController.m */; };
8AEF0F9C17FC19C200D2B9BE /* ActivityTrackingViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8AEF0F9A17FC19C200D2B9BE /* ActivityTrackingViewController.xib */; };
8AEF0F9E17FC1BE200D2B9BE /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8AEF0F9D17FC1BE200D2B9BE /* CoreMotion.framework */; };
8AEFF73D181007D5004182BD /* addedIn7.plist in Resources */ = {isa = PBXBuildFile; fileRef = 8AEFF73B181007D5004182BD /* addedIn7.plist */; };
8AEFF7411810083A004182BD /* FontsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8AEFF73F1810083A004182BD /* FontsViewController.m */; };
8AEFF7421810083A004182BD /* FontsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8AEFF7401810083A004182BD /* FontsViewController.xib */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -278,6 +281,10 @@
8AEF0F9917FC19C200D2B9BE /* ActivityTrackingViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ActivityTrackingViewController.m; sourceTree = "<group>"; };
8AEF0F9A17FC19C200D2B9BE /* ActivityTrackingViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ActivityTrackingViewController.xib; sourceTree = "<group>"; };
8AEF0F9D17FC1BE200D2B9BE /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = System/Library/Frameworks/CoreMotion.framework; sourceTree = SDKROOT; };
8AEFF73B181007D5004182BD /* addedIn7.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = addedIn7.plist; sourceTree = "<group>"; };
8AEFF73E1810083A004182BD /* FontsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontsViewController.h; sourceTree = "<group>"; };
8AEFF73F1810083A004182BD /* FontsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FontsViewController.m; sourceTree = "<group>"; };
8AEFF7401810083A004182BD /* FontsViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = FontsViewController.xib; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -468,13 +475,17 @@
8AEF0F9817FC19C200D2B9BE /* ActivityTrackingViewController.h */,
8AEF0F9917FC19C200D2B9BE /* ActivityTrackingViewController.m */,
8AEF0F9A17FC19C200D2B9BE /* ActivityTrackingViewController.xib */,
8AEFF73E1810083A004182BD /* FontsViewController.h */,
8AEFF73F1810083A004182BD /* FontsViewController.m */,
8AEFF7401810083A004182BD /* FontsViewController.xib */,
);
path = SampleViewControllers;
sourceTree = "<group>";
};
8A7BF29617ED5392004EF216 /* Resources */ = {
isa = PBXGroup;
children = (
8AEFF739181007D5004182BD /* plists */,
8A7BF29717ED5392004EF216 /* images */,
);
path = Resources;
Expand Down Expand Up @@ -564,6 +575,14 @@
path = HUAnimator;
sourceTree = "<group>";
};
8AEFF739181007D5004182BD /* plists */ = {
isa = PBXGroup;
children = (
8AEFF73B181007D5004182BD /* addedIn7.plist */,
);
path = plists;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand Down Expand Up @@ -666,6 +685,7 @@
8A6DBC7E17F2C33D004311FE /* QRCodeViewController.xib in Resources */,
8A7BF36C17ED5BB1004EF216 /* m16@2x.png in Resources */,
8A7BF37617ED5BB1004EF216 /* m26@2x.png in Resources */,
8AEFF7421810083A004182BD /* FontsViewController.xib in Resources */,
8A7BF37217ED5BB1004EF216 /* m22@2x.png in Resources */,
8A7BF36517ED5BB1004EF216 /* m9@2x.png in Resources */,
8A7BF38017ED5BB1004EF216 /* m36@2x.png in Resources */,
Expand All @@ -675,6 +695,7 @@
8A6DBC7717F251FB004311FE /* SmileDetectionViewController.xib in Resources */,
8A7BF37B17ED5BB1004EF216 /* m31@2x.png in Resources */,
8AEF0F9C17FC19C200D2B9BE /* ActivityTrackingViewController.xib in Resources */,
8AEFF73D181007D5004182BD /* addedIn7.plist in Resources */,
8A7BF3A117ED7F5D004EF216 /* m5@2x.png in Resources */,
8A7BF38217ED5BB1004EF216 /* m38@2x.png in Resources */,
8A7BF37E17ED5BB1004EF216 /* m34@2x.png in Resources */,
Expand Down Expand Up @@ -749,6 +770,7 @@
8A43D5D417F12307005E8BE8 /* ZBFallenBricksAnimator.m in Sources */,
8A6DBC7D17F2C33D004311FE /* QRCodeViewController.m in Sources */,
8A043B1817F0D34200DA84E9 /* Map3DViewController.m in Sources */,
8AEFF7411810083A004182BD /* FontsViewController.m in Sources */,
8A7BF3BD17ED8B43004EF216 /* HUTransitionHorizontalLinesAnimator.m in Sources */,
8A6DBC7617F251FB004311FE /* SmileDetectionViewController.m in Sources */,
8A43D5DC17F187BE005E8BE8 /* SpriteKitViewController.m in Sources */,
Expand Down
7 changes: 7 additions & 0 deletions iOS7Sampler/MasterViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@ - (void)viewDidLoad
kItemKeyDescription: @"Adding an item to the Safari Reading List with the new Safari Services framework.",
kItemKeyClassPrefix: @"ReadingList",
},

// New Fonts
@{kItemKeyTitle: @"New Fonts",
kItemKeyDescription: @"Displaying new fonts with their FontNames which are needed for \"fontWithName:size:\" method of UIFont.",
kItemKeyClassPrefix: @"Fonts",
},

];
}

Expand Down
13 changes: 13 additions & 0 deletions iOS7Sampler/SampleViewControllers/FontsViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// FontsViewController.h
// iOS7Sampler
//
// Created by shuichi on 10/17/13.
// Copyright (c) 2013 Shuichi Tsutsumi. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface FontsViewController : UIViewController

@end
93 changes: 93 additions & 0 deletions iOS7Sampler/SampleViewControllers/FontsViewController.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
//
// FontsViewController.m
// iOS7Sampler
//
// Created by shuichi on 10/17/13.
// Copyright (c) 2013 Shuichi Tsutsumi. All rights reserved.
//

#import "FontsViewController.h"


@interface FontsViewController ()
@property (nonatomic, strong) NSArray *items;
@end


@implementation FontsViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}

- (void)viewDidLoad
{
[super viewDidLoad];

NSString *path = [[NSBundle mainBundle] pathForResource:@"addedIn7"
ofType:@"plist"];
self.items = [NSArray arrayWithContentsOfFile:path];
}

- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}


// =============================================================================
#pragma mark - TableViewDataSource

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {

return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

return [self.items count];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

if (cell == nil) {

cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle
reuseIdentifier:CellIdentifier];

cell.accessoryType = UITableViewCellAccessoryNone;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
}

NSString *fontName = [self.items objectAtIndex:indexPath.row];

cell.textLabel.text = fontName;
cell.textLabel.font = [UIFont fontWithName:fontName size:cell.textLabel.font.pointSize];

return cell;
}


// =============================================================================
#pragma mark - UITableViewDelegate

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {

return 44.0;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

}

@end
33 changes: 33 additions & 0 deletions iOS7Sampler/SampleViewControllers/FontsViewController.xib
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="4510" systemVersion="12F45" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3742"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="FontsViewController">
<connections>
<outlet property="view" destination="1" id="3"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="1">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" alwaysBounceVertical="YES" style="plain" separatorStyle="none" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" translatesAutoresizingMaskIntoConstraints="NO" id="fsA-vb-KYZ">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<connections>
<outlet property="dataSource" destination="-1" id="EXx-Kq-Q7N"/>
<outlet property="delegate" destination="-1" id="H3f-gI-5E8"/>
</connections>
</tableView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<simulatedStatusBarMetrics key="simulatedStatusBarMetrics"/>
<simulatedNavigationBarMetrics key="simulatedTopBarMetrics" prompted="NO"/>
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina4"/>
</view>
</objects>
</document>

0 comments on commit fa24cb4

Please sign in to comment.