Skip to content

Commit

Permalink
Merge branch 'release/3.0.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
malcommac committed Sep 29, 2019
2 parents 56508ee + 6cbc88a commit 434b753
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Configs/SwiftRichString.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>3.0.1</string>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
11 changes: 4 additions & 7 deletions ExampleiOS/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14313.13.2" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14868" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14283.9"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14824"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Expand All @@ -23,8 +21,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" editable="NO" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="M2v-v6-dEE">
<rect key="frame" x="10" y="30" width="355" height="627"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<rect key="frame" x="10" y="10" width="355" height="647"/>
<string key="text">Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.</string>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
Expand Down
14 changes: 7 additions & 7 deletions Sources/SwiftRichString/Attributes/FontConvertible.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,28 +51,28 @@ public protocol FontConvertible {

// MARK: - FontConvertible for UIFont/NSFont
extension Font: FontConvertible {

/// Return the same instance of the font with specified size.
///
/// - Parameter size: size of the font in points. If size is `nil`, `Font.systemFontSize` is used.
/// - Returns: instance of the font.
public func font(size: CGFloat?) -> Font {
#if os(tvOS)
return Font(name: self.fontName, size: (size ?? TVOS_SYSTEMFONT_SIZE))!
#elseif os(iOS)
return Font(name: self.fontName, size: (size ?? Font.systemFontSize))!
#elseif os(watchOS)
return Font(name: self.fontName, size: (size ?? WATCHOS_SYSTEMFONT_SIZE))!
#elseif os(macOS)
return Font(descriptor: self.fontDescriptor, size: (size ?? Font.systemFontSize))!
return Font(descriptor: self.fontDescriptor, size: (size ?? Font.systemFontSize))!
#else
return Font(descriptor: self.fontDescriptor, size: (size ?? Font.systemFontSize))
#endif
}

}

// MARK: - FontConvertible for String
extension String: FontConvertible {

/// Transform a string to a valid `UIFont`/`NSFont` instance.
/// String must contain a valid Postscript font's name.
///
Expand All @@ -87,5 +87,5 @@ extension String: FontConvertible {
return Font(name: self, size: (size ?? Font.systemFontSize))!
#endif
}

}
2 changes: 1 addition & 1 deletion SwiftRichString.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "SwiftRichString"
s.version = "3.0.2"
s.version = "3.0.3"
s.summary = "Elegant Strings & Attributed Strings Toolkit for Swift"
s.description = <<-DESC
SwiftRichString is the best toolkit to work easily with Strings and Attributed Strings.
Expand Down
8 changes: 8 additions & 0 deletions SwiftRichString.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1524,6 +1524,7 @@
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 3.0.3;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = "com.SwiftRichString.SwiftRichString-iOS";
PRODUCT_NAME = SwiftRichString;
Expand All @@ -1547,6 +1548,7 @@
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 3.0.3;
PRODUCT_BUNDLE_IDENTIFIER = "com.SwiftRichString.SwiftRichString-iOS";
PRODUCT_NAME = SwiftRichString;
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -1596,6 +1598,7 @@
INFOPLIST_FILE = Configs/SwiftRichString.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 3.0.3;
PRODUCT_BUNDLE_IDENTIFIER = "com.SwiftRichString.SwiftRichString-watchOS";
PRODUCT_NAME = SwiftRichString;
SDKROOT = watchos;
Expand All @@ -1620,6 +1623,7 @@
INFOPLIST_FILE = Configs/SwiftRichString.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 3.0.3;
PRODUCT_BUNDLE_IDENTIFIER = "com.SwiftRichString.SwiftRichString-watchOS";
PRODUCT_NAME = SwiftRichString;
SDKROOT = watchos;
Expand All @@ -1644,6 +1648,7 @@
INFOPLIST_FILE = Configs/SwiftRichString.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 3.0.3;
PRODUCT_BUNDLE_IDENTIFIER = "com.SwiftRichString.SwiftRichString-tvOS";
PRODUCT_NAME = SwiftRichString;
SDKROOT = appletvos;
Expand All @@ -1667,6 +1672,7 @@
INFOPLIST_FILE = Configs/SwiftRichString.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 3.0.3;
PRODUCT_BUNDLE_IDENTIFIER = "com.SwiftRichString.SwiftRichString-tvOS";
PRODUCT_NAME = SwiftRichString;
SDKROOT = appletvos;
Expand All @@ -1693,6 +1699,7 @@
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.10;
MARKETING_VERSION = 3.0.3;
PRODUCT_BUNDLE_IDENTIFIER = "com.SwiftRichString.SwiftRichString-macOS";
PRODUCT_NAME = SwiftRichString;
SDKROOT = macosx;
Expand All @@ -1718,6 +1725,7 @@
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.10;
MARKETING_VERSION = 3.0.3;
PRODUCT_BUNDLE_IDENTIFIER = "com.SwiftRichString.SwiftRichString-macOS";
PRODUCT_NAME = SwiftRichString;
SDKROOT = macosx;
Expand Down

0 comments on commit 434b753

Please sign in to comment.