Skip to content

Commit d45fdb5

Browse files
committed
add gif Screenshot; add demo Podfile; add HSUtilities.h ...
1 parent df6c85b commit d45fdb5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+2031
-72
lines changed

HSFont.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "HSFont"
3-
s.version = "1.0.0"
3+
s.version = "1.0.1"
44
s.summary = "A simple iOS and OS X HSFont replace [UIFont, NSFont], HSColor replace [UIColor, NSColor]"
55
s.homepage = "https://github.com/ccworld1000"
66
s.license = "MIT"

HSFont/HSColor+Simple.h

+1-9
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,7 @@
66
// Copyright © 2016年 cc | [email protected]. All rights reserved.
77
//
88

9-
#import "TargetConditionals.h"
10-
11-
#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
12-
#import <UIKit/UIKit.h>
13-
#define HSColor UIColor
14-
#else
15-
#import <Cocoa/Cocoa.h>
16-
#define HSColor NSColor
17-
#endif
9+
#import "HSUtilities.h"
1810

1911
@interface HSColor (Simple)
2012

HSFont/HSFont+Simple.h

+1-9
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,7 @@
66
// Copyright © 2016年 cc [email protected]. All rights reserved.
77
//
88

9-
#import "TargetConditionals.h"
10-
11-
#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
12-
#import <UIKit/UIKit.h>
13-
#define HSFont UIFont
14-
#else
15-
#import <Cocoa/Cocoa.h>
16-
#define HSFont NSFont
17-
#endif
9+
#import "HSUtilities.h"
1810

1911
@interface HSFont (Simple)
2012

HSFont/HSFont+Simple.m

-11
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,5 @@
1010

1111
@implementation HSFont (Simple)
1212

13-
//+ (HSFont *)fontWithName:(NSString *)fontName size:(CGFloat)fontSize {
14-
// return [HSFont fontWithName: fontName size:fontSize];
15-
//}
16-
//
17-
//+ (HSFont *)systemFontOfSize:(CGFloat)fontSize {
18-
// return [HSFont systemFontOfSize: fontSize];
19-
//}
20-
//
21-
//+ (HSFont *)boldSystemFontOfSize:(CGFloat)fontSize {
22-
// return [HSFont boldSystemFontOfSize: fontSize];
23-
//}
2413

2514
@end

HSFont/HSUtilities.h

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
//
2+
// HSUtilities.h
3+
// HSFontiOS
4+
//
5+
// Created by dengyouhua on 16/10/24.
6+
// Copyright © 2016年 cc | [email protected]. All rights reserved.
7+
//
8+
9+
#ifndef HSUtilities_h
10+
#define HSUtilities_h
11+
12+
#import "TargetConditionals.h"
13+
14+
#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
15+
#import <UIKit/UIKit.h>
16+
#define HSFont UIFont
17+
#define HSColor UIColor
18+
#else
19+
#import <Cocoa/Cocoa.h>
20+
#define HSFont NSFont
21+
#define HSColor NSColor
22+
#endif
23+
24+
#import "HSFont+Simple.h"
25+
#import "HSColor+Simple.h"
26+
27+
28+
#endif /* HSUtilities_h */

HSFontMac.gif

37.4 KB
Loading

HSFontMac/HSFontMac.xcodeproj/project.pbxproj

+72-16
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
0098F34B1DB89AEB0066FDCB /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0098F34A1DB89AEB0066FDCB /* ViewController.m */; };
1313
0098F34D1DB89AEB0066FDCB /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0098F34C1DB89AEB0066FDCB /* Assets.xcassets */; };
1414
0098F3501DB89AEB0066FDCB /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0098F34E1DB89AEB0066FDCB /* Main.storyboard */; };
15-
00F058AD1DB8B31200C6E75B /* HSColor+Simple.m in Sources */ = {isa = PBXBuildFile; fileRef = 00F058AA1DB8B31200C6E75B /* HSColor+Simple.m */; };
16-
00F058AE1DB8B31200C6E75B /* HSFont+Simple.m in Sources */ = {isa = PBXBuildFile; fileRef = 00F058AC1DB8B31200C6E75B /* HSFont+Simple.m */; };
15+
128CAF70ECD286E6E216B89D /* libPods-HSFontMac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E33789816D655B24DE7654A4 /* libPods-HSFontMac.a */; };
1716
/* End PBXBuildFile section */
1817

1918
/* Begin PBXFileReference section */
@@ -26,17 +25,17 @@
2625
0098F34C1DB89AEB0066FDCB /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
2726
0098F34F1DB89AEB0066FDCB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
2827
0098F3511DB89AEB0066FDCB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
29-
00F058A91DB8B31200C6E75B /* HSColor+Simple.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "HSColor+Simple.h"; sourceTree = "<group>"; };
30-
00F058AA1DB8B31200C6E75B /* HSColor+Simple.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "HSColor+Simple.m"; sourceTree = "<group>"; };
31-
00F058AB1DB8B31200C6E75B /* HSFont+Simple.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "HSFont+Simple.h"; sourceTree = "<group>"; };
32-
00F058AC1DB8B31200C6E75B /* HSFont+Simple.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "HSFont+Simple.m"; sourceTree = "<group>"; };
28+
6B78509A8C6DBF119A9B7E5C /* Pods-HSFontMac.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HSFontMac.debug.xcconfig"; path = "Pods/Target Support Files/Pods-HSFontMac/Pods-HSFontMac.debug.xcconfig"; sourceTree = "<group>"; };
29+
6F0368089CDB66B62AF36EAD /* Pods-HSFontMac.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HSFontMac.release.xcconfig"; path = "Pods/Target Support Files/Pods-HSFontMac/Pods-HSFontMac.release.xcconfig"; sourceTree = "<group>"; };
30+
E33789816D655B24DE7654A4 /* libPods-HSFontMac.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-HSFontMac.a"; sourceTree = BUILT_PRODUCTS_DIR; };
3331
/* End PBXFileReference section */
3432

3533
/* Begin PBXFrameworksBuildPhase section */
3634
0098F33D1DB89AEB0066FDCB /* Frameworks */ = {
3735
isa = PBXFrameworksBuildPhase;
3836
buildActionMask = 2147483647;
3937
files = (
38+
128CAF70ECD286E6E216B89D /* libPods-HSFontMac.a in Frameworks */,
4039
);
4140
runOnlyForDeploymentPostprocessing = 0;
4241
};
@@ -48,6 +47,8 @@
4847
children = (
4948
0098F3421DB89AEB0066FDCB /* HSFontMac */,
5049
0098F3411DB89AEB0066FDCB /* Products */,
50+
E28A274413370482554A8F4A /* Pods */,
51+
A3BBBE094A3DD1E36A40D7EC /* Frameworks */,
5152
);
5253
sourceTree = "<group>";
5354
};
@@ -62,7 +63,6 @@
6263
0098F3421DB89AEB0066FDCB /* HSFontMac */ = {
6364
isa = PBXGroup;
6465
children = (
65-
00F058A81DB8B31200C6E75B /* HSFont */,
6666
0098F3431DB89AEB0066FDCB /* AppDelegate.h */,
6767
0098F3441DB89AEB0066FDCB /* AppDelegate.m */,
6868
0098F3491DB89AEB0066FDCB /* ViewController.h */,
@@ -83,16 +83,21 @@
8383
name = "Supporting Files";
8484
sourceTree = "<group>";
8585
};
86-
00F058A81DB8B31200C6E75B /* HSFont */ = {
86+
A3BBBE094A3DD1E36A40D7EC /* Frameworks */ = {
8787
isa = PBXGroup;
8888
children = (
89-
00F058A91DB8B31200C6E75B /* HSColor+Simple.h */,
90-
00F058AA1DB8B31200C6E75B /* HSColor+Simple.m */,
91-
00F058AB1DB8B31200C6E75B /* HSFont+Simple.h */,
92-
00F058AC1DB8B31200C6E75B /* HSFont+Simple.m */,
89+
E33789816D655B24DE7654A4 /* libPods-HSFontMac.a */,
9390
);
94-
name = HSFont;
95-
path = ../../HSFont;
91+
name = Frameworks;
92+
sourceTree = "<group>";
93+
};
94+
E28A274413370482554A8F4A /* Pods */ = {
95+
isa = PBXGroup;
96+
children = (
97+
6B78509A8C6DBF119A9B7E5C /* Pods-HSFontMac.debug.xcconfig */,
98+
6F0368089CDB66B62AF36EAD /* Pods-HSFontMac.release.xcconfig */,
99+
);
100+
name = Pods;
96101
sourceTree = "<group>";
97102
};
98103
/* End PBXGroup section */
@@ -102,9 +107,12 @@
102107
isa = PBXNativeTarget;
103108
buildConfigurationList = 0098F3541DB89AEB0066FDCB /* Build configuration list for PBXNativeTarget "HSFontMac" */;
104109
buildPhases = (
110+
86BA0A48E3CF4D65B57109CB /* [CP] Check Pods Manifest.lock */,
105111
0098F33C1DB89AEB0066FDCB /* Sources */,
106112
0098F33D1DB89AEB0066FDCB /* Frameworks */,
107113
0098F33E1DB89AEB0066FDCB /* Resources */,
114+
DD2FF80927528EDD9715B573 /* [CP] Embed Pods Frameworks */,
115+
7B471D7D324560433C73BD01 /* [CP] Copy Pods Resources */,
108116
);
109117
buildRules = (
110118
);
@@ -159,15 +167,61 @@
159167
};
160168
/* End PBXResourcesBuildPhase section */
161169

170+
/* Begin PBXShellScriptBuildPhase section */
171+
7B471D7D324560433C73BD01 /* [CP] Copy Pods Resources */ = {
172+
isa = PBXShellScriptBuildPhase;
173+
buildActionMask = 2147483647;
174+
files = (
175+
);
176+
inputPaths = (
177+
);
178+
name = "[CP] Copy Pods Resources";
179+
outputPaths = (
180+
);
181+
runOnlyForDeploymentPostprocessing = 0;
182+
shellPath = /bin/sh;
183+
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-HSFontMac/Pods-HSFontMac-resources.sh\"\n";
184+
showEnvVarsInLog = 0;
185+
};
186+
86BA0A48E3CF4D65B57109CB /* [CP] Check Pods Manifest.lock */ = {
187+
isa = PBXShellScriptBuildPhase;
188+
buildActionMask = 2147483647;
189+
files = (
190+
);
191+
inputPaths = (
192+
);
193+
name = "[CP] Check Pods Manifest.lock";
194+
outputPaths = (
195+
);
196+
runOnlyForDeploymentPostprocessing = 0;
197+
shellPath = /bin/sh;
198+
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
199+
showEnvVarsInLog = 0;
200+
};
201+
DD2FF80927528EDD9715B573 /* [CP] Embed Pods Frameworks */ = {
202+
isa = PBXShellScriptBuildPhase;
203+
buildActionMask = 2147483647;
204+
files = (
205+
);
206+
inputPaths = (
207+
);
208+
name = "[CP] Embed Pods Frameworks";
209+
outputPaths = (
210+
);
211+
runOnlyForDeploymentPostprocessing = 0;
212+
shellPath = /bin/sh;
213+
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-HSFontMac/Pods-HSFontMac-frameworks.sh\"\n";
214+
showEnvVarsInLog = 0;
215+
};
216+
/* End PBXShellScriptBuildPhase section */
217+
162218
/* Begin PBXSourcesBuildPhase section */
163219
0098F33C1DB89AEB0066FDCB /* Sources */ = {
164220
isa = PBXSourcesBuildPhase;
165221
buildActionMask = 2147483647;
166222
files = (
167223
0098F34B1DB89AEB0066FDCB /* ViewController.m in Sources */,
168224
0098F3481DB89AEB0066FDCB /* main.m in Sources */,
169-
00F058AD1DB8B31200C6E75B /* HSColor+Simple.m in Sources */,
170-
00F058AE1DB8B31200C6E75B /* HSFont+Simple.m in Sources */,
171225
0098F3451DB89AEB0066FDCB /* AppDelegate.m in Sources */,
172226
);
173227
runOnlyForDeploymentPostprocessing = 0;
@@ -269,6 +323,7 @@
269323
};
270324
0098F3551DB89AEB0066FDCB /* Debug */ = {
271325
isa = XCBuildConfiguration;
326+
baseConfigurationReference = 6B78509A8C6DBF119A9B7E5C /* Pods-HSFontMac.debug.xcconfig */;
272327
buildSettings = {
273328
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
274329
COMBINE_HIDPI_IMAGES = YES;
@@ -281,6 +336,7 @@
281336
};
282337
0098F3561DB89AEB0066FDCB /* Release */ = {
283338
isa = XCBuildConfiguration;
339+
baseConfigurationReference = 6F0368089CDB66B62AF36EAD /* Pods-HSFontMac.release.xcconfig */;
284340
buildSettings = {
285341
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
286342
COMBINE_HIDPI_IMAGES = YES;

HSFontMac/HSFontMac/Base.lproj/Main.storyboard

+4-4
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@
654654
<window key="window" title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" showsToolbarButton="NO" visibleAtLaunch="NO" animationBehavior="default" id="IQv-IB-iLA">
655655
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
656656
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
657-
<rect key="contentRect" x="196" y="240" width="480" height="270"/>
657+
<rect key="contentRect" x="196" y="240" width="699" height="385"/>
658658
<rect key="screenRect" x="0.0" y="0.0" width="1680" height="1027"/>
659659
</window>
660660
<connections>
@@ -663,20 +663,20 @@
663663
</windowController>
664664
<customObject id="Oky-zY-oP4" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
665665
</objects>
666-
<point key="canvasLocation" x="75" y="250"/>
666+
<point key="canvasLocation" x="184.5" y="269.5"/>
667667
</scene>
668668
<!--View Controller-->
669669
<scene sceneID="hIz-AP-VOD">
670670
<objects>
671671
<viewController id="XfG-lQ-9wD" customClass="ViewController" sceneMemberID="viewController">
672672
<view key="view" id="m2S-Jp-Qdl">
673-
<rect key="frame" x="0.0" y="0.0" width="480" height="270"/>
673+
<rect key="frame" x="0.0" y="0.0" width="699" height="556"/>
674674
<autoresizingMask key="autoresizingMask"/>
675675
</view>
676676
</viewController>
677677
<customObject id="rPt-NT-nkU" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
678678
</objects>
679-
<point key="canvasLocation" x="75" y="655"/>
679+
<point key="canvasLocation" x="184.5" y="944"/>
680680
</scene>
681681
</scenes>
682682
</document>

HSFontMac/HSFontMac/ViewController.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
//
88

99
#import <Cocoa/Cocoa.h>
10-
#import "HSColor+Simple.h"
11-
#import "HSFont+Simple.h"
10+
#import <HSUtilities.h>
1211

1312
@interface ViewController : NSViewController
1413

HSFontMac/HSFontMac/ViewController.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ - (void)viewDidLoad {
3030
l.textColor = [HSColor colorWithHexString:[NSString stringWithFormat:@"%x%x%x", index * 4, 255, index * 8]];
3131
}
3232

33-
l.frame = CGRectMake(100, -index * 40, 100, 40);
33+
l.frame = CGRectMake(100, index * 40, 100, 40);
3434

3535
[self.view addSubview: l];
3636
}

HSFontMac/Podfile

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Uncomment the next line to define a global platform for your project
2+
# platform :osx '10.9'
3+
4+
target 'HSFontMac' do
5+
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
6+
# use_frameworks!
7+
8+
pod 'HSFont', path:'..'
9+
10+
end

HSFontMac/Podfile.lock

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
PODS:
2+
- HSFont (1.0.1)
3+
4+
DEPENDENCIES:
5+
- HSFont (from `..`)
6+
7+
EXTERNAL SOURCES:
8+
HSFont:
9+
:path: ".."
10+
11+
SPEC CHECKSUMS:
12+
HSFont: 15b8eb7c5bade3d74bd965851710579e3b4f24b7
13+
14+
PODFILE CHECKSUM: 46a354b010bc46c9c96b8467c1528d271785fc80
15+
16+
COCOAPODS: 1.1.1

HSFontMac/Pods/Headers/Private/HSFont/HSColor+Simple.h

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

HSFontMac/Pods/Headers/Private/HSFont/HSFont+Simple.h

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

HSFontMac/Pods/Headers/Private/HSFont/HSUtilities.h

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

HSFontMac/Pods/Headers/Public/HSFont/HSColor+Simple.h

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

HSFontMac/Pods/Headers/Public/HSFont/HSFont+Simple.h

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

HSFontMac/Pods/Headers/Public/HSFont/HSUtilities.h

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

HSFontMac/Pods/Local Podspecs/HSFont.podspec.json

+31
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)