Skip to content

Commit

Permalink
Use Xcode 10
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelnisi committed Sep 24, 2018
1 parent f285b70 commit 27a2aa2
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 25 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -12,6 +12,7 @@
*.perspectivev3
*.xccheckout
*.xcuserstate
*.xcworkspace
DerivedData
build/
xcuserdata
2 changes: 1 addition & 1 deletion .travis.yml
@@ -1,6 +1,6 @@
sudo: false
language: objective-c
osx_image: xcode9
osx_image: xcode10
script: "travis_retry make test"
after_success:
- bash <(curl -s https://codecov.io/bash) -J 'HTMLAttributor'
Expand Down
17 changes: 11 additions & 6 deletions HTMLAttributor.xcodeproj/project.pbxproj
Expand Up @@ -146,16 +146,17 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0900;
LastUpgradeCheck = 0900;
LastUpgradeCheck = 1000;
ORGANIZATIONNAME = "Michael Nisi";
TargetAttributes = {
4EEB54851F73760900D685EE = {
CreatedOnToolsVersion = 9.0;
LastSwiftMigration = 0900;
LastSwiftMigration = 1000;
ProvisioningStyle = Automatic;
};
4EEB548E1F73760900D685EE = {
CreatedOnToolsVersion = 9.0;
LastSwiftMigration = 1000;
ProvisioningStyle = Automatic;
};
};
Expand Down Expand Up @@ -237,13 +238,15 @@
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_DOCUMENTATION_COMMENTS = YES;
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;
Expand Down Expand Up @@ -297,13 +300,15 @@
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_DOCUMENTATION_COMMENTS = YES;
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;
Expand Down Expand Up @@ -353,7 +358,7 @@
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand All @@ -374,7 +379,7 @@
PRODUCT_BUNDLE_IDENTIFIER = ink.codes.HTMLAttributor;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
Expand All @@ -388,7 +393,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = ink.codes.HTMLAttributorTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand All @@ -402,7 +407,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = ink.codes.HTMLAttributorTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
Expand Down
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "1000"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,7 +26,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
Expand Down Expand Up @@ -56,7 +55,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
26 changes: 13 additions & 13 deletions HTMLAttributor/HTMLAttributor.swift
Expand Up @@ -95,7 +95,7 @@ public protocol NodeTreeTransforming {
/// - Returns: An attributed Cocoa string.
func attributedString(
_ tree: Node,
styles: [String : [NSAttributedStringKey : Any]]
styles: [String : [NSAttributedString.Key : Any]]
) throws -> NSAttributedString
}

Expand Down Expand Up @@ -395,21 +395,21 @@ public final class HTMLAttributor {
return (result, ranges)
}

public static let defaultStyles: [String: [NSAttributedStringKey : Any]] = [
public static let defaultStyles: [String: [NSAttributedString.Key : Any]] = [
"root": [
NSAttributedStringKey.font: UIFont.preferredFont(
forTextStyle: UIFontTextStyle.body),
NSAttributedStringKey.foregroundColor: UIColor.darkText
NSAttributedString.Key.font: UIFont.preferredFont(
forTextStyle: UIFont.TextStyle.body),
NSAttributedString.Key.foregroundColor: UIColor.darkText
],
"h1": [
NSAttributedStringKey.font: UIFont.preferredFont(
forTextStyle: UIFontTextStyle.headline),
NSAttributedStringKey.foregroundColor: UIColor.darkText
NSAttributedString.Key.font: UIFont.preferredFont(
forTextStyle: UIFont.TextStyle.headline),
NSAttributedString.Key.foregroundColor: UIColor.darkText
],
"a": [
NSAttributedStringKey.font: UIFont.preferredFont(
forTextStyle: UIFontTextStyle.body),
NSAttributedStringKey.foregroundColor: UIColor.blue
NSAttributedString.Key.font: UIFont.preferredFont(
forTextStyle: UIFont.TextStyle.body),
NSAttributedString.Key.foregroundColor: UIColor.blue
]
]

Expand Down Expand Up @@ -446,7 +446,7 @@ extension HTMLAttributor: NodeTreeTransforming {

public func attributedString(
_ tree: Node,
styles: [String: [NSAttributedStringKey : Any]] = HTMLAttributor.defaultStyles
styles: [String: [NSAttributedString.Key : Any]] = HTMLAttributor.defaultStyles
) throws -> NSAttributedString {
let (str, trs) = try taggedString(tree)

Expand All @@ -465,7 +465,7 @@ extension HTMLAttributor: NodeTreeTransforming {
if tag == "a" {
if let href = tr.attributes?["href"] {
if let url = URL(string: href) {
attrs[NSAttributedStringKey.link] = url as AnyObject?
attrs[NSAttributedString.Key.link] = url as AnyObject?
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion HTMLAttributor/Info.plist
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.0.2</string>
<string>2.0.3</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
Expand Down
2 changes: 1 addition & 1 deletion HTMLAttributorTests/Info.plist
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>2.0.2</string>
<string>2.0.3</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
Expand Down

0 comments on commit 27a2aa2

Please sign in to comment.