Skip to content

Commit

Permalink
Part I modify All NSAttributedStringKey related methods for Swift 4
Browse files Browse the repository at this point in the history
extension NSString for func size(attributes attrs: [String : Any]? = nil) -> NSSize is deleted due to iOS uses size(withAttributes: attrs) now
  • Loading branch information
liuxuan30 authored and pmairoldi committed Sep 7, 2017
1 parent 131602f commit 0cf4ef4
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 13 deletions.
26 changes: 26 additions & 0 deletions Charts.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1125,6 +1125,32 @@
SDKROOT = macosx;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
TARGETED_DEVICE_FAMILY = "1,2,3,4";
TVOS_DEPLOYMENT_TARGET = 9.0;
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
WATCHOS_DEPLOYMENT_TARGET = 2.0;
};
name = Release;
};
06165F391D8110E700722320 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = YES;
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_VERSION = A;
INFOPLIST_FILE = "$(SRCROOT)/Source/Supporting Files/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.dcg.Charts;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
Expand Down
2 changes: 1 addition & 1 deletion Charts.xcodeproj/xcshareddata/xcschemes/Charts.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0700"
LastUpgradeVersion = "0900"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0700"
LastUpgradeVersion = "0900"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
11 changes: 0 additions & 11 deletions Source/Charts/Utils/Platform.swift
Original file line number Diff line number Diff line change
Expand Up @@ -516,17 +516,6 @@ types are aliased to either their UI* implementation (on iOS) or their NS* imple
}
}
}

extension NSString
{
// iOS: size(attributes: ...), OSX: size(withAttributes: ...)
// Both are translated into sizeWithAttributes: on ObjC. So conflict...
@nonobjc
func size(attributes attrs: [NSAttributedStringKey : Any]? = nil) -> NSSize
{
return size(withAttributes: attrs)
}
}

func NSUIGraphicsGetCurrentContext() -> CGContext?
{
Expand Down

0 comments on commit 0cf4ef4

Please sign in to comment.