Skip to content
This repository was archived by the owner on Sep 17, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cartfile.private
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "Quick/Nimble" ~> 6.0
github "Quick/Nimble" ~> 8.0.4
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "Quick/Nimble" "v6.0.1"
github "Quick/Nimble" "v8.0.4"
2 changes: 1 addition & 1 deletion Carthage/Checkouts/Nimble
Submodule Nimble updated 160 files
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ This library puts you back in control by reading the sizes from a CSV file which
#### Via [Carthage](https://github.com/Carthage/Carthage):
Add the following your Cartfile:

For Swift 5:
```Swift
github "ios-studio/Typesetter" ~> 1.1.0
```
For Swift 3:
```Swift
github "ios-studio/Typesetter" ~> 1.0.0
Expand All @@ -22,6 +26,11 @@ github "ios-studio/Typesetter" ~> 0.1.3
#### Via [CocoaPods](https://cocoapods.org/):
Add the following your Podfile:

For Swift 5:
```ruby
pod "Typesetter", "~> 1.1.0"
```

For Swift 3:
```ruby
pod "Typesetter", "~> 1.0.0"
Expand Down
31 changes: 25 additions & 6 deletions Typesetter.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0720;
LastUpgradeCheck = 0820;
LastUpgradeCheck = 1100;
ORGANIZATIONNAME = "Beat Richartz";
TargetAttributes = {
536F38111C5D11E800948324 = {
Expand All @@ -236,10 +236,11 @@
};
buildConfigurationList = 536F380C1C5D11E800948324 /* Build configuration list for PBXProject "Typesetter" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 536F38081C5D11E800948324;
productRefGroup = 536F38131C5D11E800948324 /* Products */;
Expand Down Expand Up @@ -318,18 +319,27 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand Down Expand Up @@ -369,18 +379,27 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand Down Expand Up @@ -431,7 +450,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -456,7 +475,7 @@
PRODUCT_BUNDLE_IDENTIFIER = studio.Typesetter;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand All @@ -473,7 +492,7 @@
PRODUCT_BUNDLE_IDENTIFIER = studio.TypesetterTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -489,7 +508,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = studio.TypesetterTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand Down
24 changes: 10 additions & 14 deletions Typesetter.xcodeproj/xcshareddata/xcschemes/Typesetter.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0820"
LastUpgradeVersion = "1100"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -28,6 +28,15 @@
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "536F38111C5D11E800948324"
BuildableName = "Typesetter.framework"
BlueprintName = "Typesetter"
ReferencedContainer = "container:Typesetter.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -40,17 +49,6 @@
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "536F38111C5D11E800948324"
BuildableName = "Typesetter.framework"
BlueprintName = "Typesetter"
ReferencedContainer = "container:Typesetter.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -71,8 +69,6 @@
ReferencedContainer = "container:Typesetter.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
36 changes: 18 additions & 18 deletions Typesetter/TypesetterTextStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,43 +72,43 @@ public enum TypesetterTextStyle: String {
*/
init(textStyle: String) {
if #available(iOS 9.0, *) {
switch UIFontTextStyle(rawValue: textStyle) {
case UIFontTextStyle.body:
switch UIFont.TextStyle(rawValue: textStyle) {
case UIFont.TextStyle.body:
self = .Body
case UIFontTextStyle.caption1:
case UIFont.TextStyle.caption1:
self = .Caption1
case UIFontTextStyle.caption2:
case UIFont.TextStyle.caption2:
self = .Caption2
case UIFontTextStyle.footnote:
case UIFont.TextStyle.footnote:
self = .Footnote
case UIFontTextStyle.headline:
case UIFont.TextStyle.headline:
self = .Headline
case UIFontTextStyle.subheadline:
case UIFont.TextStyle.subheadline:
self = .Subheadline
case UIFontTextStyle.callout:
case UIFont.TextStyle.callout:
self = .Callout
case UIFontTextStyle.title1:
case UIFont.TextStyle.title1:
self = .Title1
case UIFontTextStyle.title2:
case UIFont.TextStyle.title2:
self = .Title2
case UIFontTextStyle.title3:
case UIFont.TextStyle.title3:
self = .Title3
default:
self = .Body
}
} else {
switch UIFontTextStyle(rawValue: textStyle) {
case UIFontTextStyle.body:
switch UIFont.TextStyle(rawValue: textStyle) {
case UIFont.TextStyle.body:
self = .Body
case UIFontTextStyle.caption1:
case UIFont.TextStyle.caption1:
self = .Caption1
case UIFontTextStyle.caption2:
case UIFont.TextStyle.caption2:
self = .Caption2
case UIFontTextStyle.footnote:
case UIFont.TextStyle.footnote:
self = .Footnote
case UIFontTextStyle.headline:
case UIFont.TextStyle.headline:
self = .Headline
case UIFontTextStyle.subheadline:
case UIFont.TextStyle.subheadline:
self = .Subheadline
default:
self = .Body
Expand Down
24 changes: 12 additions & 12 deletions TypesetterTests/TypesetterTextStyleTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ import Nimble
class TypesetterTextStyleTests: XCTestCase {

func testStyleMapping() {
var mapping: [TypesetterTextStyle: UIFontTextStyle] = [
.Body: UIFontTextStyle.body,
.Caption1: UIFontTextStyle.caption1,
.Caption2: UIFontTextStyle.caption2,
.Footnote: UIFontTextStyle.footnote,
.Headline: UIFontTextStyle.headline,
.Subheadline: UIFontTextStyle.subheadline,
var mapping: [TypesetterTextStyle: UIFont.TextStyle] = [
.Body: UIFont.TextStyle.body,
.Caption1: UIFont.TextStyle.caption1,
.Caption2: UIFont.TextStyle.caption2,
.Footnote: UIFont.TextStyle.footnote,
.Headline: UIFont.TextStyle.headline,
.Subheadline: UIFont.TextStyle.subheadline,
]

if #available(iOS 9.0, *) {
let additionals: [TypesetterTextStyle: UIFontTextStyle] = [
.Callout: UIFontTextStyle.callout,
.Title1: UIFontTextStyle.title1,
.Title2: UIFontTextStyle.title2,
.Title3: UIFontTextStyle.title3
let additionals: [TypesetterTextStyle: UIFont.TextStyle] = [
.Callout: UIFont.TextStyle.callout,
.Title1: UIFont.TextStyle.title1,
.Title2: UIFont.TextStyle.title2,
.Title3: UIFont.TextStyle.title3
]

for (textStyle, uiTextStyle) in additionals {
Expand Down