Skip to content
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
7 changes: 7 additions & 0 deletions .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>ContextLabel.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>ContextLabel</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>ContextLabelTests</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
6 changes: 3 additions & 3 deletions ContextLabel.podspec
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Pod::Spec.new do |s|
s.name = 'ContextLabel'
s.version = '1.6.0'
s.version = '1.7.0'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.summary = 'A simple to use drop in replacement for UILabel'
s.description = 'A simple to use drop in replacement for UILabel written in Swift that provides automatic detection of links such as URLs, twitter style usernames and hashtags.'
s.authors = { 'Michael Loistl' => '[email protected]' }
s.homepage = "https://github.com/michaelloistl/ContextLabel"
s.source = { :git => 'https://github.com/michaelloistl/ContextLabel.git', :tag => s.version }
s.ios.deployment_target = '8.0'
s.source_files = 'Source/*.{swift}'
s.ios.deployment_target = '11.0'
s.source_files = 'Sources/ContextLabel/*.{swift}'
s.requires_arc = true
end
8 changes: 4 additions & 4 deletions ContextLabel.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
6A5EA9731E7BC20900BCEF8C /* ContextLabelTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ContextLabelTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
6A5EA9771E7BC20900BCEF8C /* ContextLabelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContextLabelTests.swift; sourceTree = "<group>"; };
6A5EA9791E7BC20900BCEF8C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
6A5EA9841E7BC31500BCEF8C /* ContextLabel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContextLabel.swift; sourceTree = "<group>"; };
6A5EA9841E7BC31500BCEF8C /* ContextLabel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ContextLabel.swift; path = ContextLabel/ContextLabel.swift; sourceTree = "<group>"; };
6AEE5CFF1E894FA700DC85AB /* TableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TableViewCell.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -82,7 +82,7 @@
6A5EA9621E7BC20900BCEF8C /* AppDelegate.swift */,
6A5EA9641E7BC20900BCEF8C /* ViewController.swift */,
6AEE5CFF1E894FA700DC85AB /* TableViewCell.swift */,
6A5EA9831E7BC31500BCEF8C /* Source */,
6A5EA9831E7BC31500BCEF8C /* Sources */,
6A5EA9821E7BC30800BCEF8C /* Support Files */,
);
path = ContextLabel;
Expand All @@ -107,12 +107,12 @@
name = "Support Files";
sourceTree = "<group>";
};
6A5EA9831E7BC31500BCEF8C /* Source */ = {
6A5EA9831E7BC31500BCEF8C /* Sources */ = {
isa = PBXGroup;
children = (
6A5EA9841E7BC31500BCEF8C /* ContextLabel.swift */,
);
path = Source;
path = Sources;
sourceTree = SOURCE_ROOT;
};
/* End PBXGroup section */
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
uuid = "6F4EC870-BCF0-41D6-B8C7-165F24B1028B"
type = "1"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "B0347748-F4BB-4FC7-AC2F-DAC74F4B5658"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Sources/ContextLabel/ContextLabel.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "924"
endingLineNumber = "924"
landmarkName = "NSRangeFromRange(_:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "E0730CDF-9CF4-45EF-9BE9-004A3AEDFE5D"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Sources/ContextLabel/ContextLabel.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "926"
endingLineNumber = "926"
landmarkName = "NSRangeFromRange(_:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
7 changes: 5 additions & 2 deletions ContextLabelTests/ContextLabelTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,10 @@ class ContextLabelTests: XCTestCase {

func testPhoneNumbersDetectionInText() {
let contextLabel = ContextLabel(frame: CGRect.zero)
contextLabel.text = "Text with 1-541-754-3010 and (541) 754-3010 and +1-541-754-3010 and +420608123456"
contextLabel.text = "Text with 1-541-754-3010 and (541) 754-3010 and +1-541-754-3010 and +420608123456 and 911"

let linkResults = contextLabel.contextLabelData!.linkResults
XCTAssertEqual(linkResults.count, 4)
XCTAssertEqual(linkResults.count, 5)

XCTAssertEqual(linkResults[0].detectionType, .phoneNumber)
XCTAssertEqual(linkResults[0].text, "1-541-754-3010")
Expand All @@ -250,6 +250,9 @@ class ContextLabelTests: XCTestCase {

XCTAssertEqual(linkResults[3].detectionType, .phoneNumber)
XCTAssertEqual(linkResults[3].text, "+420608123456")

XCTAssertEqual(linkResults[4].detectionType, .phoneNumber)
XCTAssertEqual(linkResults[4].text, "911")
}

}
29 changes: 29 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "ContextLabel",
defaultLocalization: "en",
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "ContextLabel",
targets: ["ContextLabel"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "ContextLabel",
dependencies: []),
.testTarget(
name: "ContextLabelTests",
dependencies: ["ContextLabel"]),
]
)
Loading