Skip to content

Commit

Permalink
Merge branch 'release-2.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
gooichi committed Oct 11, 2017
2 parents 06c392d + 0396eb3 commit 0c8affe
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .dir-locals.el
Expand Up @@ -11,7 +11,7 @@
(let ((d (dir-locals-find-file ".")))
(if (stringp d) d (car d))))))))
(swift-mode
. ((flycheck-swift3-xcrun-sdk . "iphoneos10.3")
. ((flycheck-swift3-xcrun-sdk . "iphoneos11.0")
(flycheck-swift3-target . "arm64-apple-ios8")
(eval . (set (make-local-variable 'library-root)
(expand-file-name "InsetLabel" project-dir)))
Expand Down
2 changes: 1 addition & 1 deletion .swift-version
@@ -1 +1 @@
3.1
4.0
4 changes: 2 additions & 2 deletions .travis.yml
@@ -1,8 +1,8 @@
language: objective-c
osx_image: xcode8.3
osx_image: xcode9
xcode_project: InsetLabelExample/InsetLabelExample.xcodeproj
xcode_scheme: InsetLabelExample
xcode_sdk: iphonesimulator10.3
xcode_sdk: iphonesimulator11.0
before_install:
- gem install xcpretty
script:
Expand Down
4 changes: 2 additions & 2 deletions InsetLabel.podspec
@@ -1,10 +1,10 @@
Pod::Spec.new do |s|
s.name = 'InsetLabel'
s.version = '1.1.0'
s.version = '2.0.0'
s.author = 'GyazSquare'
s.license = { :type => 'MIT' }
s.homepage = 'https://github.com/GyazSquare/InsetLabel'
s.source = { :git => 'https://github.com/GyazSquare/InsetLabel.git', :tag => 'v1.1.0' }
s.source = { :git => 'https://github.com/GyazSquare/InsetLabel.git', :tag => 'v2.0.0' }
s.summary = 'A UILabel subclass supporting content insets written in Swift.'
s.ios.deployment_target = '8.0'
s.tvos.deployment_target = '9.0'
Expand Down
8 changes: 8 additions & 0 deletions InsetLabel/InsetLabel.swift
Expand Up @@ -7,6 +7,7 @@ import UIKit.UILabel
@IBDesignable
@objc(GSLInsetLabel)
open class InsetLabel: UILabel {

// MARK: Properties

open var contentInsets: UIEdgeInsets = .zero {
Expand Down Expand Up @@ -79,6 +80,13 @@ open class InsetLabel: UILabel {
let newRect = UIEdgeInsetsInsetRect(rect, contentInsets)
super.drawText(in: newRect)
}

// MARK: UIView (UIViewHierarchy)

override open func layoutSubviews() {
super.layoutSubviews()
preferredMaxLayoutWidth = frame.width - (contentInsetsLeft + contentInsetsRight)
}

// MARK: UIView (UIConstraintBasedLayoutLayering)

Expand Down
26 changes: 19 additions & 7 deletions InsetLabelExample/InsetLabelExample.xcodeproj/project.pbxproj
Expand Up @@ -153,16 +153,16 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0710;
LastUpgradeCheck = 0810;
LastUpgradeCheck = 0900;
TargetAttributes = {
D731FF0C1C127780004FA287 = {
CreatedOnToolsVersion = 7.1.1;
LastSwiftMigration = 0810;
LastSwiftMigration = 0900;
TestTargetID = D7ADAFD71BB10DC800291D5E;
};
D7ADAFD71BB10DC800291D5E = {
CreatedOnToolsVersion = 7.0;
LastSwiftMigration = 0810;
LastSwiftMigration = 0900;
};
};
};
Expand Down Expand Up @@ -262,7 +262,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.InsetLabelExampleTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/InsetLabelExample.app/InsetLabelExample";
};
name = Debug;
Expand All @@ -275,7 +275,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.InsetLabelExampleTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/InsetLabelExample.app/InsetLabelExample";
};
name = Release;
Expand All @@ -288,14 +288,20 @@
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_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_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 @@ -334,14 +340,20 @@
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_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_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 @@ -374,7 +386,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.InsetLabelExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
Expand All @@ -386,7 +398,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.InsetLabelExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
};
name = Release;
};
Expand Down
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0810"
LastUpgradeVersion = "0900"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,6 +26,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
Expand Down Expand Up @@ -55,6 +56,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
Expand Up @@ -39,6 +39,11 @@
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"scale" : "1x"
}
],
"info" : {
Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -9,8 +9,8 @@ InsetLabel is a UILabel subclass supporting content insets written in Swift.

## Requirements

* Xcode 8.3 (Swift 3.1) or later
* Base SDK: iOS 10.3 / tvOS 10.2 or later
* Xcode 9 (Swift 4.0) or later
* Base SDK: iOS 11.0 / tvOS 11.0 or later
* Deployment Target: iOS 8.0 / tvOS 9.0 or later

## Installation
Expand Down
2 changes: 1 addition & 1 deletion scripts/travis-run-tests.sh
Expand Up @@ -3,7 +3,7 @@
set -ev
set -o pipefail

IOS_SIMULATOR_ID=`xcrun instruments -s devices | sed -n -E 's/^iPhone 7 Plus \(10\.3\)[^+]*\[([[:xdigit:]-]{36})\].*\(Simulator\)$/\1/p' | sed -n -e 1p`
IOS_SIMULATOR_ID=`xcrun instruments -s devices 2>/dev/null | sed -n -E 's/^iPhone 8 Plus \(11\.0\)[^+]*\[([[:xdigit:]-]{36})\].*\(Simulator\)$/\1/p' | sed -n -e 1p`

if [ "${TRAVIS_XCODE_PROJECT-UNDEF}" != "UNDEF" ]; then
xcodebuild -project ${TRAVIS_XCODE_PROJECT} -scheme ${TRAVIS_XCODE_SCHEME} -destination "id=${IOS_SIMULATOR_ID}" -sdk ${TRAVIS_XCODE_SDK} test
Expand Down

0 comments on commit 0c8affe

Please sign in to comment.