Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dnrops
UIFontComplete
提交
25da4330
U
UIFontComplete
项目概览
dnrops
/
UIFontComplete
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
UIFontComplete
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
25da4330
编写于
4月 28, 2017
作者:
N
Nicholas Maccharoli
提交者:
GitHub
4月 28, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #9 from matsune/customFont
Feature for custom fonts
上级
279284ee
69ffdc87
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
35 addition
and
12 deletion
+35
-12
UIFontComplete.xcodeproj/project.pbxproj
UIFontComplete.xcodeproj/project.pbxproj
+12
-0
UIFontComplete/Font.swift
UIFontComplete/Font.swift
+1
-12
UIFontComplete/FontRepresentable.swift
UIFontComplete/FontRepresentable.swift
+22
-0
未找到文件。
UIFontComplete.xcodeproj/project.pbxproj
浏览文件 @
25da4330
...
...
@@ -7,6 +7,7 @@
objects
=
{
/* Begin PBXBuildFile section */
136122C61EB2AD3E009F45E4
/* FontRepresentable.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
136122C51EB2AD3E009F45E4
/* FontRepresentable.swift */
;
};
AAE1A29D1E02618D00610C40
/* UIFontComplete.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
AAE1A2931E02618D00610C40
/* UIFontComplete.framework */
;
};
AAE1A2A21E02618D00610C40
/* UIFontCompleteTests.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
AAE1A2A11E02618D00610C40
/* UIFontCompleteTests.swift */
;
};
AAE1A2A41E02618D00610C40
/* UIFontComplete.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
AAE1A2961E02618D00610C40
/* UIFontComplete.h */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
...
...
@@ -26,6 +27,7 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
136122C51EB2AD3E009F45E4
/* FontRepresentable.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
FontRepresentable.swift
;
sourceTree
=
"<group>"
;
};
AAE1A2931E02618D00610C40
/* UIFontComplete.framework */
=
{
isa
=
PBXFileReference
;
explicitFileType
=
wrapper.framework
;
includeInIndex
=
0
;
path
=
UIFontComplete.framework
;
sourceTree
=
BUILT_PRODUCTS_DIR
;
};
AAE1A2961E02618D00610C40
/* UIFontComplete.h */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
UIFontComplete.h
;
sourceTree
=
"<group>"
;
};
AAE1A2971E02618D00610C40
/* Info.plist */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
text.plist.xml
;
path
=
Info.plist
;
sourceTree
=
"<group>"
;
};
...
...
@@ -56,6 +58,14 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
136122C41EB2AD2A009F45E4
/* Protocol */
=
{
isa
=
PBXGroup
;
children
=
(
136122C51EB2AD3E009F45E4
/* FontRepresentable.swift */
,
);
name
=
Protocol
;
sourceTree
=
"<group>"
;
};
AAE1A2891E02618D00610C40
=
{
isa
=
PBXGroup
;
children
=
(
...
...
@@ -78,6 +88,7 @@
isa
=
PBXGroup
;
children
=
(
AAE1A2B61E027F4B00610C40
/* Supporting */
,
136122C41EB2AD2A009F45E4
/* Protocol */
,
AAE1A2B51E027F3A00610C40
/* Enums */
,
AAE1A2B41E027F1A00610C40
/* Extensions */
,
AAE1A2B11E027E5600610C40
/* Util */
,
...
...
@@ -238,6 +249,7 @@
buildActionMask
=
2147483647
;
files
=
(
AAE1A2B01E0261F600610C40
/* UIFont+Extension.swift in Sources */
,
136122C61EB2AD3E009F45E4
/* FontRepresentable.swift in Sources */
,
AAE1A2AE1E0261B200610C40
/* Font.swift in Sources */
,
AAE1A2B31E027E8100610C40
/* CodeGeneration.swift in Sources */
,
);
...
...
UIFontComplete/Font.swift
浏览文件 @
25da4330
...
...
@@ -6,7 +6,7 @@
//
//
public
enum
Font
:
String
{
public
enum
Font
:
String
,
FontRepresentable
{
// Font Family: Copperplate
case
copperplateLight
=
"Copperplate-Light"
...
...
@@ -397,15 +397,4 @@ public enum Font: String {
case
bodoniSvtyTwoOSITCTTBook
=
"BodoniSvtyTwoOSITCTT-Book"
case
bodoniSvtyTwoOSITCTTBold
=
"BodoniSvtyTwoOSITCTT-Bold"
case
bodoniSvtyTwoOSITCTTBookIt
=
"BodoniSvtyTwoOSITCTT-BookIt"
/// An alternative way to get a particular `UIFont` instance from a `Font`
/// value.
///
/// - parameter of size: The desired size of the font.
///
/// - returns a `UIFont` instance of the desired font family and size, or
/// `nil` if the font family or size isn't installed.
public
func
of
(
size
:
CGFloat
)
->
UIFont
?
{
return
UIFont
(
name
:
rawValue
,
size
:
size
)
}
}
UIFontComplete/FontRepresentable.swift
0 → 100644
浏览文件 @
25da4330
//
// FontRepresentable.swift
// UIFontComplete
//
// Created by Yuma Matsune on 2017/04/28.
//
//
public
protocol
FontRepresentable
:
RawRepresentable
{}
extension
FontRepresentable
where
Self
.
RawValue
==
String
{
/// An alternative way to get a particular `UIFont` instance from a `Font`
/// value.
///
/// - parameter of size: The desired size of the font.
///
/// - returns a `UIFont` instance of the desired font family and size, or
/// `nil` if the font family or size isn't installed.
public
func
of
(
size
:
CGFloat
)
->
UIFont
?
{
return
UIFont
(
name
:
rawValue
,
size
:
size
)
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录