From 4e89d97ea0dd6fe89367f89d0d02be06610e2ec5 Mon Sep 17 00:00:00 2001 From: Kostya Bychkov Date: Thu, 9 Jun 2016 00:19:43 +0300 Subject: [PATCH 01/16] build time improvements --- Pod/Classes/StringExtensions.swift | 4 ++-- SwiftString.podspec | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Pod/Classes/StringExtensions.swift b/Pod/Classes/StringExtensions.swift index 3a1c8a9..a9fadf4 100644 --- a/Pod/Classes/StringExtensions.swift +++ b/Pod/Classes/StringExtensions.swift @@ -119,8 +119,8 @@ public extension String { } func initialsFirstAndLast() -> String { - let words = self.componentsSeparatedByString(" ") - return words.reduce("") { ($0 == "" ? "" : $0[0...0]) + $1[0...0]} + let words = componentsSeparatedByString(" ") + return words.reduce("") { "\($0.isEmpty ? "" : $0[0...0])\($1[0...0])" } } func isAlpha() -> Bool { diff --git a/SwiftString.podspec b/SwiftString.podspec index 789a96d..91aa988 100644 --- a/SwiftString.podspec +++ b/SwiftString.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "SwiftString" - s.version = "0.5.1" + s.version = "0.5.2" s.summary = "A lightweight string extension for Swift" s.description = <<-DESC From c31ea157c9311bf8ce647ff3ff748ac74e93bea8 Mon Sep 17 00:00:00 2001 From: Jonathan Guthrie Date: Tue, 20 Sep 2016 15:20:13 -0400 Subject: [PATCH 02/16] staging commit --- .gitignore | 66 +++- .travis.yml | 15 - Package.swift | 9 + Pod/Assets/.gitkeep | 0 Pod/Classes/.gitkeep | 0 {Pod/Classes => Sources}/String+HTML.swift | 32 +- .../StringExtensions.swift | 159 ++++---- SwiftString.podspec | 20 - SwiftString.xcodeproj/Configs/Debug.xcconfig | 7 + .../Configs/Project.xcconfig | 7 + .../Configs/Release.xcconfig | 5 + .../SwiftStringTests_Info.plist | 25 ++ SwiftString.xcodeproj/SwiftString_Info.plist | 25 ++ SwiftString.xcodeproj/project.pbxproj | 342 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../xcschemes/SwiftString.xcscheme | 81 +++++ .../xcschemes/xcschememanagement.plist | 12 + Tests/LinuxMain.swift | 5 + Tests/SwiftStringTests/SwiftStringTests.swift | 18 + _Pods.xcodeproj | 1 - 20 files changed, 689 insertions(+), 147 deletions(-) delete mode 100644 .travis.yml create mode 100644 Package.swift delete mode 100644 Pod/Assets/.gitkeep delete mode 100644 Pod/Classes/.gitkeep rename {Pod/Classes => Sources}/String+HTML.swift (92%) rename {Pod/Classes => Sources}/StringExtensions.swift (52%) delete mode 100644 SwiftString.podspec create mode 100644 SwiftString.xcodeproj/Configs/Debug.xcconfig create mode 100644 SwiftString.xcodeproj/Configs/Project.xcconfig create mode 100644 SwiftString.xcodeproj/Configs/Release.xcconfig create mode 100644 SwiftString.xcodeproj/SwiftStringTests_Info.plist create mode 100644 SwiftString.xcodeproj/SwiftString_Info.plist create mode 100644 SwiftString.xcodeproj/project.pbxproj create mode 100644 SwiftString.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 SwiftString.xcodeproj/xcshareddata/xcschemes/SwiftString.xcscheme create mode 100644 SwiftString.xcodeproj/xcshareddata/xcschemes/xcschememanagement.plist create mode 100644 Tests/LinuxMain.swift create mode 100644 Tests/SwiftStringTests/SwiftStringTests.swift delete mode 120000 _Pods.xcodeproj diff --git a/.gitignore b/.gitignore index 48646f0..c80b1a1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,13 @@ -# OS X -.DS_Store - # Xcode +# +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + +## Build generated +.build/ build/ +DerivedData/ + +## Various settings *.pbxuser !default.pbxuser *.mode1v3 @@ -11,29 +16,54 @@ build/ !default.mode2v3 *.perspectivev3 !default.perspectivev3 -xcuserdata -*.xccheckout -profile +xcuserdata/ + +## Other *.moved-aside -DerivedData +*.xcuserstate + +## Obj-C/Swift specific *.hmap *.ipa +*.dSYM.zip +*.dSYM -# Bundler -.bundle +## Playgrounds +timeline.xctimeline +playground.xcworkspace -Carthage +# Swift Package Manager +# +# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. +# Packages/ +.build/ + +# CocoaPods +# # We recommend against adding the Pods directory to your .gitignore. However # you should judge for yourself, the pros and cons are mentioned at: -# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control -# -# Note: if you ignore the Pods directory, make sure to uncomment -# `pod install` in .travis.yml +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control +# +# Pods/ + +# Carthage # -Pods/ +# Add this line if you want to avoid checking in source code from Carthage dependencies. +# Carthage/Checkouts + +Carthage/Build -Example/Podfile.lock +# fastlane +# +# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the +# screenshots whenever they are needed. +# For more information about the recommended setup visit: +# https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md -*.lock +fastlane/report.xml +fastlane/Preview.html +fastlane/screenshots +fastlane/test_output -*.lock +Packages/ +docs/ \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3c50207..0000000 --- a/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -# references: -# * http://www.objc.io/issue-6/travis-ci.html -# * https://github.com/supermarin/xcpretty#usage - -language: objective-c -osx_image: xcode7.1 -cache: cocoapods -podfile: Example/Podfile -before_install: -- gem install cocoapods # Since Travis is not always on latest version -- pod install --project-directory=Example - -script: -- set -o pipefail && xcodebuild test -workspace Example/SwiftString.xcworkspace -scheme SwiftString-Example -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO | xcpretty -- pod lib lint diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..d89cc77 --- /dev/null +++ b/Package.swift @@ -0,0 +1,9 @@ +// Generated automatically by Perfect Assistant Application +// Date: 2016-09-17 01:35:49 +0000 +import PackageDescription +let package = Package( + name: "SwiftString", + targets: [], + dependencies: [], + exclude: [] +) diff --git a/Pod/Assets/.gitkeep b/Pod/Assets/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/Pod/Classes/.gitkeep b/Pod/Classes/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/Pod/Classes/String+HTML.swift b/Sources/String+HTML.swift similarity index 92% rename from Pod/Classes/String+HTML.swift rename to Sources/String+HTML.swift index 1895b55..cef0ac4 100644 --- a/Pod/Classes/String+HTML.swift +++ b/Sources/String+HTML.swift @@ -1,8 +1,10 @@ // adapted from https://gist.github.com/mwaterfall/25b4a6a06dc3309d9555 +import Foundation + public extension String { - private struct HTMLEntities { + fileprivate struct HTMLEntities { static let characterEntities : [String: Character] = [ // XML predefined entities: @@ -268,9 +270,9 @@ public extension String { // Unicode character, e.g. // decodeNumeric("64", 10) --> "@" // decodeNumeric("20ac", 16) --> "€" - private func decodeNumeric(string : String, base : Int32) -> Character? { + fileprivate func decodeNumeric(_ string : String, base : Int32) -> Character? { let code = UInt32(strtoul(string, nil, base)) - return Character(UnicodeScalar(code)) + return Character(UnicodeScalar(code)!) } // Decode the HTML character entity to the corresponding @@ -279,11 +281,11 @@ public extension String { // decode("€") --> "€" // decode("<") --> "<" // decode("&foo;") --> nil - private func decode(entity : String) -> Character? { + fileprivate func decode(_ entity : String) -> Character? { if entity.hasPrefix("&#x") || entity.hasPrefix("&#X"){ - return decodeNumeric(entity.substringFromIndex(entity.startIndex.advancedBy(3)), base: 16) + return decodeNumeric(entity.substring(from: entity.index(entity.startIndex, offsetBy: 3)), base: 16) } else if entity.hasPrefix("&#") { - return decodeNumeric(entity.substringFromIndex(entity.startIndex.advancedBy(2)), base: 10) + return decodeNumeric(entity.substring(from: entity.index(entity.startIndex, offsetBy: 2)), base: 10) } else { return HTMLEntities.characterEntities[entity] } @@ -298,21 +300,21 @@ public extension String { var position = startIndex // Find the next '&' and copy the characters preceding it to `result`: - while let ampRange = self.rangeOfString("&", range: position ..< endIndex) { - result.appendContentsOf(self[position ..< ampRange.startIndex]) - position = ampRange.startIndex + while let ampRange = self.range(of: "&", range: position ..< endIndex) { + result.append(self[position ..< ampRange.lowerBound]) + position = ampRange.lowerBound // Find the next ';' and copy everything from '&' to ';' into `entity` - if let semiRange = self.rangeOfString(";", range: position ..< endIndex) { - let entity = self[position ..< semiRange.endIndex] - position = semiRange.endIndex + if let semiRange = self.range(of: ";", range: position ..< endIndex) { + let entity = self[position ..< semiRange.upperBound] + position = semiRange.upperBound if let decoded = decode(entity) { // Replace by decoded character: result.append(decoded) } else { // Invalid entity, copy verbatim: - result.appendContentsOf(entity) + result.append(entity) } } else { // No matching ';'. @@ -320,7 +322,7 @@ public extension String { } } // Copy remaining characters to `result`: - result.appendContentsOf(self[position ..< endIndex]) + result.append(self[position ..< endIndex]) return result } -} \ No newline at end of file +} diff --git a/Pod/Classes/StringExtensions.swift b/Sources/StringExtensions.swift similarity index 52% rename from Pod/Classes/StringExtensions.swift rename to Sources/StringExtensions.swift index 218d426..291478c 100644 --- a/Pod/Classes/StringExtensions.swift +++ b/Sources/StringExtensions.swift @@ -5,6 +5,7 @@ // Created by Andrew Mayne on 30/01/2016. // Copyright © 2016 Red Brick Labs. All rights reserved. // +import Foundation public extension String { @@ -14,13 +15,13 @@ public extension String { /// - parameter right: The right bookend /// /// - returns: The string between the two bookends, or nil if the bookends cannot be found, the bookends are the same or appear contiguously. - func between(left: String, _ right: String) -> String? { + func between(_ left: String, _ right: String) -> String? { guard - let leftRange = rangeOfString(left), rightRange = rangeOfString(right, options: .BackwardsSearch) - where left != right && leftRange.endIndex != rightRange.startIndex + let leftRange = range(of:left), let rightRange = range(of: right, options: .backwards), + left != right && leftRange.upperBound != rightRange.lowerBound else { return nil } - return self[leftRange.endIndex...rightRange.startIndex.predecessor()] + return self[leftRange.upperBound...index(before: rightRange.lowerBound)] } @@ -28,69 +29,69 @@ public extension String { func camelize() -> String { let source = clean(with: " ", allOf: "-", "_") if source.characters.contains(" ") { - let first = source.substringToIndex(source.startIndex.advancedBy(1)) - let cammel = NSString(format: "%@", (source as NSString).capitalizedString.stringByReplacingOccurrencesOfString(" ", withString: "", options: [], range: nil)) as String + let first = self[self.startIndex...self.index(after: startIndex)] //source.substringToIndex(source.index(after: startIndex)) + let cammel = NSString(format: "%@", (source as NSString).capitalized.replacingOccurrences(of: " ", with: "")) as String let rest = String(cammel.characters.dropFirst()) return "\(first)\(rest)" } else { - let first = (source as NSString).lowercaseString.substringToIndex(source.startIndex.advancedBy(1)) + var first = source[self.startIndex...self.index(after: startIndex)].lowercased() let rest = String(source.characters.dropFirst()) return "\(first)\(rest)" } } func capitalize() -> String { - return capitalizedString + return capitalized } - func contains(substring: String) -> Bool { - return rangeOfString(substring) != nil + func contains(_ substring: String) -> Bool { + return range(of: substring) != nil } - func chompLeft(prefix: String) -> String { - if let prefixRange = rangeOfString(prefix) { - if prefixRange.endIndex >= endIndex { - return self[startIndex.. String { + if let prefixRange = range(of: prefix) { + if prefixRange.upperBound >= endIndex { + return self[startIndex.. String { - if let suffixRange = rangeOfString(suffix, options: .BackwardsSearch) { - if suffixRange.endIndex >= endIndex { - return self[startIndex.. String { + if let suffixRange = range(of: suffix, options: .backwards) { + if suffixRange.upperBound >= endIndex { + return self[startIndex.. String { - let components = componentsSeparatedByCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()).filter { !$0.isEmpty } - return components.joinWithSeparator(" ") + let thecomponents = components(separatedBy: NSCharacterSet.whitespacesAndNewlines).filter { !$0.isEmpty } + return thecomponents.joined(separator: " ") } - func clean(with with: String, allOf: String...) -> String { + func clean(with: String, allOf: String...) -> String { var string = self for target in allOf { - string = string.stringByReplacingOccurrencesOfString(target, withString: with) + string = string.replacingOccurrences(of: target, with: with) } return string } - func count(substring: String) -> Int { - return componentsSeparatedByString(substring).count-1 + func count(_ substring: String) -> Int { + return components(separatedBy: substring).count-1 } - func endsWith(suffix: String) -> Bool { + func endsWith(_ suffix: String) -> Bool { return hasSuffix(suffix) } - func ensureLeft(prefix: String) -> String { + func ensureLeft(_ prefix: String) -> String { if startsWith(prefix) { return self } else { @@ -98,7 +99,7 @@ public extension String { } } - func ensureRight(suffix: String) -> String { + func ensureRight(_ suffix: String) -> String { if endsWith(suffix) { return self } else { @@ -106,20 +107,20 @@ public extension String { } } - func indexOf(substring: String) -> Int? { - if let range = rangeOfString(substring) { - return startIndex.distanceTo(range.startIndex) + func indexOf(_ substring: String) -> Int? { + if let range = range(of: substring) { + return startIndex.distanceTo(range.lowerBound) } return nil } func initials() -> String { - let words = self.componentsSeparatedByString(" ") + let words = self.components(separatedBy: " ") return words.reduce(""){$0 + $1[0...0]} } func initialsFirstAndLast() -> String { - let words = self.componentsSeparatedByString(" ") + let words = self.components(separatedBy: " ") return words.reduce("") { ($0 == "" ? "" : $0[0...0]) + $1[0...0]} } @@ -133,23 +134,25 @@ public extension String { } func isAlphaNumeric() -> Bool { - let alphaNumeric = NSCharacterSet.alphanumericCharacterSet() - return componentsSeparatedByCharactersInSet(alphaNumeric).joinWithSeparator("").length == 0 + let alphaNumeric = NSCharacterSet.alphanumerics + let output = self.unicodeScalars.split { !alphaNumeric.contains($0)}.map(String.init) + return output.count != 1 +// return componentsSeparatedByCharactersInSet(alphaNumeric).joinWithSeparator("").length == 0 } func isEmpty() -> Bool { - return self.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()).length == 0 + return self.trimmingCharacters(in: .whitespacesAndNewlines).length == 0 } func isNumeric() -> Bool { - if let _ = defaultNumberFormatter().numberFromString(self) { + if let _ = defaultNumberFormatter().number(from: self) { return true } return false } - func join(elements: S) -> String { - return elements.map{String($0)}.joinWithSeparator(self) + func join(_ elements: S) -> String { + return elements.map{String(describing: $0)}.joined(separator: self) } func latinize() -> String { @@ -166,20 +169,20 @@ public extension String { } } - func pad(n: Int, _ string: String = " ") -> String { + func pad(_ n: Int, _ string: String = " ") -> String { return "".join([string.times(n), self, string.times(n)]) } - func padLeft(n: Int, _ string: String = " ") -> String { + func padLeft(_ n: Int, _ string: String = " ") -> String { return "".join([string.times(n), self]) } - func padRight(n: Int, _ string: String = " ") -> String { + func padRight(_ n: Int, _ string: String = " ") -> String { return "".join([self, string.times(n)]) } func slugify(withSeparator separator: Character = "-") -> String { - let slugCharacterSet = NSCharacterSet(charactersInString: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\(separator)") + let slugCharacterSet = NSCharacterSet(charactersIn: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\(separator)") return latinize() .lowercaseString .componentsSeparatedByCharactersInSet(slugCharacterSet.invertedSet) @@ -187,11 +190,11 @@ public extension String { .joinWithSeparator(String(separator)) } - func split(separator: Character) -> [String] { + func split(_ separator: Character) -> [String] { return characters.split{$0 == separator}.map(String.init) } - func startsWith(prefix: String) -> Bool { + func startsWith(_ prefix: String) -> Bool { return hasPrefix(prefix) } @@ -203,46 +206,46 @@ public extension String { .joinWithSeparator(" ") } - func times(n: Int) -> String { + func times(_ n: Int) -> String { return (0.. Float? { - if let number = defaultNumberFormatter().numberFromString(self) { + if let number = defaultNumberFormatter().number(from: self) { return number.floatValue } return nil } func toInt() -> Int? { - if let number = defaultNumberFormatter().numberFromString(self) { - return number.integerValue + if let number = defaultNumberFormatter().number(from: self) { + return number.intValue } return nil } - func toDouble(locale: NSLocale = NSLocale.systemLocale()) -> Double? { + func toDouble(_ locale: NSLocale = NSLocale.systemLocale) -> Double? { let nf = localeNumberFormatter(locale) - if let number = nf.numberFromString(self) { + if let number = nf.number(from: self) { return number.doubleValue } return nil } func toBool() -> Bool? { - let trimmed = self.trimmed().lowercaseString + let trimmed = self.trimmed().lowercased() if trimmed == "true" || trimmed == "false" { return (trimmed as NSString).boolValue } return nil } - func toDate(format: String = "yyyy-MM-dd") -> NSDate? { - return dateFormatter(format).dateFromString(self) + func toDate(_ format: String = "yyyy-MM-dd") -> NSDate? { + return dateFormatter(format).date(from: self) as NSDate? } - func toDateTime(format: String = "yyyy-MM-dd HH:mm:ss") -> NSDate? { + func toDateTime(_ format: String = "yyyy-MM-dd HH:mm:ss") -> NSDate? { return toDate(format) } @@ -254,7 +257,7 @@ public extension String { } func trimmedRight() -> String { - if let range = rangeOfCharacterFromSet(NSCharacterSet.whitespaceAndNewlineCharacterSet().invertedSet, options: NSStringCompareOptions.BackwardsSearch) { + if let range = rangeOfCharacterFrom(NSCharacterSet.whitespaceAndNewlineCharacterSet.inverted, options: NSString.CompareOptions.BackwardsSearch) { return self[startIndex..) -> String { get { - let startIndex = self.startIndex.advancedBy(r.startIndex) - let endIndex = self.startIndex.advancedBy(r.endIndex - r.startIndex) + let startIndex = self.characters.index(self.startIndex, offsetBy: r.lowerBound) + let endIndex = self.characters.index(self.startIndex, offsetBy: r.upperBound - r.lowerBound) return self[startIndex.. String { - let start = self.startIndex.advancedBy(startIndex) - let end = self.startIndex.advancedBy(startIndex + length) + func substring(_ startIndex: Int, length: Int) -> String { + let start = self.characters.index(self.startIndex, offsetBy: startIndex) + let end = self.characters.index(self.startIndex, offsetBy: startIndex + length) return self[start.. Character { get { - let index = self.startIndex.advancedBy(i) + let index = self.characters.index(self.startIndex, offsetBy: i) return self[index] } } } private enum ThreadLocalIdentifier { - case DateFormatter(String) + case dateFormatter(String) - case DefaultNumberFormatter - case LocaleNumberFormatter(NSLocale) + case defaultNumberFormatter + case localeNumberFormatter(NSLocale) var objcDictKey: String { switch self { - case .DateFormatter(let format): + case .dateFormatter(let format): return "SS\(self)\(format)" case .LocaleNumberFormatter(let l): return "SS\(self)\(l.localeIdentifier)" @@ -304,8 +307,8 @@ private enum ThreadLocalIdentifier { } } -private func threadLocalInstance(identifier: ThreadLocalIdentifier, @autoclosure initialValue: () -> T) -> T { - let storage = NSThread.currentThread().threadDictionary +private func threadLocalInstance(_ identifier: ThreadLocalIdentifier, initialValue: @autoclosure () -> T) -> T { + let storage = Thread.current.threadDictionary let k = identifier.objcDictKey let instance: T = storage[k] as? T ?? initialValue() @@ -316,22 +319,22 @@ private func threadLocalInstance(identifier: ThreadLocalIdentifier return instance } -private func dateFormatter(format: String) -> NSDateFormatter { - return threadLocalInstance(.DateFormatter(format), initialValue: { - let df = NSDateFormatter() +private func dateFormatter(_ format: String) -> DateFormatter { + return threadLocalInstance(.dateFormatter(format), initialValue: { + let df = DateFormatter() df.dateFormat = format return df }()) } -private func defaultNumberFormatter() -> NSNumberFormatter { - return threadLocalInstance(.DefaultNumberFormatter, initialValue: NSNumberFormatter()) +private func defaultNumberFormatter() -> NumberFormatter { + return threadLocalInstance(.defaultNumberFormatter, initialValue: NumberFormatter()) } -private func localeNumberFormatter(locale: NSLocale) -> NSNumberFormatter { - return threadLocalInstance(.LocaleNumberFormatter(locale), initialValue: { - let nf = NSNumberFormatter() - nf.locale = locale +private func localeNumberFormatter(_ locale: NSLocale) -> NumberFormatter { + return threadLocalInstance(.localeNumberFormatter(locale), initialValue: { + let nf = NumberFormatter() + nf.locale = locale as Locale! return nf }()) } diff --git a/SwiftString.podspec b/SwiftString.podspec deleted file mode 100644 index 789a96d..0000000 --- a/SwiftString.podspec +++ /dev/null @@ -1,20 +0,0 @@ -Pod::Spec.new do |s| - s.name = "SwiftString" - s.version = "0.5.1" - s.summary = "A lightweight string extension for Swift" - - s.description = <<-DESC - Common methods and String operations for Swift - DESC - - s.homepage = "https://github.com/amayne/SwiftString" - s.license = 'MIT' - s.author = { "Andrew Mayne" => "andrew@redbricklab.com" } - s.source = { :git => "https://github.com/amayne/SwiftString.git", :tag => s.version.to_s } - s.social_media_url = 'https://twitter.com/amayne' - - s.platform = :ios, '8.0' - s.requires_arc = true - - s.source_files = 'Pod/Classes/**/*' -end diff --git a/SwiftString.xcodeproj/Configs/Debug.xcconfig b/SwiftString.xcodeproj/Configs/Debug.xcconfig new file mode 100644 index 0000000..8b48456 --- /dev/null +++ b/SwiftString.xcodeproj/Configs/Debug.xcconfig @@ -0,0 +1,7 @@ +#include "Project.xcconfig" +COPY_PHASE_STRIP = NO +DEBUG_INFORMATION_FORMAT = dwarf +ENABLE_NS_ASSERTIONS = YES +GCC_OPTIMIZATION_LEVEL = 0 +ONLY_ACTIVE_ARCH = YES +SWIFT_OPTIMIZATION_LEVEL = -Onone diff --git a/SwiftString.xcodeproj/Configs/Project.xcconfig b/SwiftString.xcodeproj/Configs/Project.xcconfig new file mode 100644 index 0000000..5f63024 --- /dev/null +++ b/SwiftString.xcodeproj/Configs/Project.xcconfig @@ -0,0 +1,7 @@ +PRODUCT_NAME = $(TARGET_NAME) +SUPPORTED_PLATFORMS = macosx iphoneos iphonesimulator appletvos appletvsimulator watchos watchsimulator +MACOSX_DEPLOYMENT_TARGET = 10.10 +DYLIB_INSTALL_NAME_BASE = @rpath +OTHER_SWIFT_FLAGS = -DXcode +COMBINE_HIDPI_IMAGES = YES +USE_HEADERMAP = NO diff --git a/SwiftString.xcodeproj/Configs/Release.xcconfig b/SwiftString.xcodeproj/Configs/Release.xcconfig new file mode 100644 index 0000000..93f7c3d --- /dev/null +++ b/SwiftString.xcodeproj/Configs/Release.xcconfig @@ -0,0 +1,5 @@ +#include "Project.xcconfig" +DEBUG_INFORMATION_FORMAT = dwarf-with-dsym +GCC_OPTIMIZATION_LEVEL = s +SWIFT_OPTIMIZATION_LEVEL = -O +COPY_PHASE_STRIP = YES diff --git a/SwiftString.xcodeproj/SwiftStringTests_Info.plist b/SwiftString.xcodeproj/SwiftStringTests_Info.plist new file mode 100644 index 0000000..7c23420 --- /dev/null +++ b/SwiftString.xcodeproj/SwiftStringTests_Info.plist @@ -0,0 +1,25 @@ + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/SwiftString.xcodeproj/SwiftString_Info.plist b/SwiftString.xcodeproj/SwiftString_Info.plist new file mode 100644 index 0000000..57ada9f --- /dev/null +++ b/SwiftString.xcodeproj/SwiftString_Info.plist @@ -0,0 +1,25 @@ + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/SwiftString.xcodeproj/project.pbxproj b/SwiftString.xcodeproj/project.pbxproj new file mode 100644 index 0000000..a89315c --- /dev/null +++ b/SwiftString.xcodeproj/project.pbxproj @@ -0,0 +1,342 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + _LinkFileRef_SwiftString_via_SwiftStringTests /* SwiftString.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = "_____Product_SwiftString" /* SwiftString.framework */; }; + "__src_cc_ref_Sources/String+HTML.swift" /* String+HTML.swift in Sources */ = {isa = PBXBuildFile; fileRef = "__PBXFileRef_Sources/String+HTML.swift" /* String+HTML.swift */; }; + __src_cc_ref_Sources/StringExtensions.swift /* StringExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Sources/StringExtensions.swift /* StringExtensions.swift */; }; + __src_cc_ref_Tests/SwiftStringTests/SwiftStringTests.swift /* SwiftStringTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Tests/SwiftStringTests/SwiftStringTests.swift /* SwiftStringTests.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + E0AD59D81D91B4DD00DC93F0 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = __RootObject_ /* Project object */; + proxyType = 1; + remoteGlobalIDString = "______Target_SwiftString"; + remoteInfo = SwiftString; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + __PBXFileRef_Example /* Example */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Example; sourceTree = ""; }; + __PBXFileRef_Package.swift /* Package.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = ""; }; + "__PBXFileRef_Sources/String+HTML.swift" /* String+HTML.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = "String+HTML.swift"; path = "Sources/String+HTML.swift"; sourceTree = ""; }; + __PBXFileRef_Sources/StringExtensions.swift /* StringExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = StringExtensions.swift; path = Sources/StringExtensions.swift; sourceTree = ""; }; + __PBXFileRef_SwiftString.xcodeproj/Configs/Debug.xcconfig /* SwiftString.xcodeproj/Configs/Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = SwiftString.xcodeproj/Configs/Debug.xcconfig; sourceTree = ""; }; + __PBXFileRef_SwiftString.xcodeproj/Configs/Project.xcconfig /* SwiftString.xcodeproj/Configs/Project.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = SwiftString.xcodeproj/Configs/Project.xcconfig; sourceTree = ""; }; + __PBXFileRef_SwiftString.xcodeproj/Configs/Release.xcconfig /* SwiftString.xcodeproj/Configs/Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = SwiftString.xcodeproj/Configs/Release.xcconfig; sourceTree = ""; }; + __PBXFileRef_Tests/SwiftStringTests/SwiftStringTests.swift /* SwiftStringTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = SwiftStringTests.swift; path = Tests/SwiftStringTests/SwiftStringTests.swift; sourceTree = ""; }; + "_____Product_SwiftString" /* SwiftString.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = SwiftString.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + "_____Product_SwiftStringTests" /* SwiftStringTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; path = SwiftStringTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + "___LinkPhase_SwiftString" /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 0; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + "___LinkPhase_SwiftStringTests" /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 0; + files = ( + _LinkFileRef_SwiftString_via_SwiftStringTests /* SwiftString.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + TestProducts_ /* Tests */ = { + isa = PBXGroup; + children = ( + "_____Product_SwiftStringTests" /* SwiftStringTests.xctest */, + ); + name = Tests; + sourceTree = ""; + }; + "___RootGroup_" = { + isa = PBXGroup; + children = ( + __PBXFileRef_Package.swift /* Package.swift */, + "_____Configs_" /* Configs */, + "_____Sources_" /* Sources */, + __PBXFileRef_Example /* Example */, + "_______Tests_" /* Tests */, + "____Products_" /* Products */, + ); + sourceTree = ""; + }; + "____Products_" /* Products */ = { + isa = PBXGroup; + children = ( + TestProducts_ /* Tests */, + "_____Product_SwiftString" /* SwiftString.framework */, + ); + name = Products; + sourceTree = ""; + }; + "_____Configs_" /* Configs */ = { + isa = PBXGroup; + children = ( + __PBXFileRef_SwiftString.xcodeproj/Configs/Project.xcconfig /* SwiftString.xcodeproj/Configs/Project.xcconfig */, + __PBXFileRef_SwiftString.xcodeproj/Configs/Debug.xcconfig /* SwiftString.xcodeproj/Configs/Debug.xcconfig */, + __PBXFileRef_SwiftString.xcodeproj/Configs/Release.xcconfig /* SwiftString.xcodeproj/Configs/Release.xcconfig */, + ); + name = Configs; + sourceTree = ""; + }; + "_____Sources_" /* Sources */ = { + isa = PBXGroup; + children = ( + "_______Group_SwiftString" /* SwiftString */, + ); + name = Sources; + sourceTree = ""; + }; + "_______Group_SwiftString" /* SwiftString */ = { + isa = PBXGroup; + children = ( + "__PBXFileRef_Sources/String+HTML.swift" /* String+HTML.swift */, + __PBXFileRef_Sources/StringExtensions.swift /* StringExtensions.swift */, + ); + name = SwiftString; + sourceTree = ""; + }; + "_______Group_SwiftStringTests" /* SwiftStringTests */ = { + isa = PBXGroup; + children = ( + __PBXFileRef_Tests/SwiftStringTests/SwiftStringTests.swift /* SwiftStringTests.swift */, + ); + name = SwiftStringTests; + sourceTree = ""; + }; + "_______Tests_" /* Tests */ = { + isa = PBXGroup; + children = ( + "_______Group_SwiftStringTests" /* SwiftStringTests */, + ); + name = Tests; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + "______Target_SwiftString" /* SwiftString */ = { + isa = PBXNativeTarget; + buildConfigurationList = "_______Confs_SwiftString" /* Build configuration list for PBXNativeTarget "SwiftString" */; + buildPhases = ( + CompilePhase_SwiftString /* Sources */, + "___LinkPhase_SwiftString" /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = SwiftString; + productName = SwiftString; + productReference = "_____Product_SwiftString" /* SwiftString.framework */; + productType = "com.apple.product-type.framework"; + }; + "______Target_SwiftStringTests" /* SwiftStringTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = "_______Confs_SwiftStringTests" /* Build configuration list for PBXNativeTarget "SwiftStringTests" */; + buildPhases = ( + CompilePhase_SwiftStringTests /* Sources */, + "___LinkPhase_SwiftStringTests" /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + __Dependency_SwiftString /* PBXTargetDependency */, + ); + name = SwiftStringTests; + productName = SwiftStringTests; + productReference = "_____Product_SwiftStringTests" /* SwiftStringTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + __RootObject_ /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 9999; + TargetAttributes = { + "______Target_SwiftString" = { + LastSwiftMigration = 0800; + }; + "______Target_SwiftStringTests" = { + LastSwiftMigration = 0800; + }; + }; + }; + buildConfigurationList = "___RootConfs_" /* Build configuration list for PBXProject "SwiftString" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = "___RootGroup_"; + productRefGroup = "____Products_" /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + "______Target_SwiftString" /* SwiftString */, + "______Target_SwiftStringTests" /* SwiftStringTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + CompilePhase_SwiftString /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 0; + files = ( + "__src_cc_ref_Sources/String+HTML.swift" /* String+HTML.swift in Sources */, + __src_cc_ref_Sources/StringExtensions.swift /* StringExtensions.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CompilePhase_SwiftStringTests /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 0; + files = ( + __src_cc_ref_Tests/SwiftStringTests/SwiftStringTests.swift /* SwiftStringTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + __Dependency_SwiftString /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = "______Target_SwiftString" /* SwiftString */; + targetProxy = E0AD59D81D91B4DD00DC93F0 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + _ReleaseConf_SwiftString /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ENABLE_TESTABILITY = YES; + FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks"; + INFOPLIST_FILE = SwiftString.xcodeproj/SwiftString_Info.plist; + LD_RUNPATH_SEARCH_PATHS = "\"$(TOOLCHAIN_DIR)/usr/lib/swift/macosx\""; + LIBRARY_SEARCH_PATHS = "\"$(PROJECT_TEMP_DIR)/SymlinkLibs/\""; + OTHER_LDFLAGS = "\"$(inherited)\""; + OTHER_SWIFT_FLAGS = "\"$(inherited)\""; + PRODUCT_BUNDLE_IDENTIFIER = SwiftString; + PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = SWIFT_PACKAGE; + SWIFT_VERSION = 3.0; + }; + name = Release; + }; + _ReleaseConf_SwiftStringTests /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; + FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks"; + INFOPLIST_FILE = SwiftString.xcodeproj/SwiftStringTests_Info.plist; + LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks"; + LIBRARY_SEARCH_PATHS = "\"$(PROJECT_TEMP_DIR)/SymlinkLibs/\""; + OTHER_LDFLAGS = "\"$(inherited)\""; + OTHER_SWIFT_FLAGS = "\"$(inherited)\""; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = SWIFT_PACKAGE; + SWIFT_VERSION = 3.0; + }; + name = Release; + }; + "___DebugConf_SwiftString" /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ENABLE_TESTABILITY = YES; + FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks"; + INFOPLIST_FILE = SwiftString.xcodeproj/SwiftString_Info.plist; + LD_RUNPATH_SEARCH_PATHS = "\"$(TOOLCHAIN_DIR)/usr/lib/swift/macosx\""; + LIBRARY_SEARCH_PATHS = "\"$(PROJECT_TEMP_DIR)/SymlinkLibs/\""; + OTHER_LDFLAGS = "\"$(inherited)\""; + OTHER_SWIFT_FLAGS = "\"$(inherited)\""; + PRODUCT_BUNDLE_IDENTIFIER = SwiftString; + PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = SWIFT_PACKAGE; + SWIFT_VERSION = 3.0; + }; + name = Debug; + }; + "___DebugConf_SwiftStringTests" /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; + FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks"; + INFOPLIST_FILE = SwiftString.xcodeproj/SwiftStringTests_Info.plist; + LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks"; + LIBRARY_SEARCH_PATHS = "\"$(PROJECT_TEMP_DIR)/SymlinkLibs/\""; + OTHER_LDFLAGS = "\"$(inherited)\""; + OTHER_SWIFT_FLAGS = "\"$(inherited)\""; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = SWIFT_PACKAGE; + SWIFT_VERSION = 3.0; + }; + name = Debug; + }; + "_____Release_" /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = __PBXFileRef_SwiftString.xcodeproj/Configs/Release.xcconfig /* SwiftString.xcodeproj/Configs/Release.xcconfig */; + buildSettings = { + }; + name = Release; + }; + "_______Debug_" /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = __PBXFileRef_SwiftString.xcodeproj/Configs/Debug.xcconfig /* SwiftString.xcodeproj/Configs/Debug.xcconfig */; + buildSettings = { + }; + name = Debug; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + "___RootConfs_" /* Build configuration list for PBXProject "SwiftString" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + "_______Debug_" /* Debug */, + "_____Release_" /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Debug; + }; + "_______Confs_SwiftString" /* Build configuration list for PBXNativeTarget "SwiftString" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + "___DebugConf_SwiftString" /* Debug */, + _ReleaseConf_SwiftString /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Debug; + }; + "_______Confs_SwiftStringTests" /* Build configuration list for PBXNativeTarget "SwiftStringTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + "___DebugConf_SwiftStringTests" /* Debug */, + _ReleaseConf_SwiftStringTests /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Debug; + }; +/* End XCConfigurationList section */ + }; + rootObject = __RootObject_ /* Project object */; +} diff --git a/SwiftString.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/SwiftString.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/SwiftString.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/SwiftString.xcodeproj/xcshareddata/xcschemes/SwiftString.xcscheme b/SwiftString.xcodeproj/xcshareddata/xcschemes/SwiftString.xcscheme new file mode 100644 index 0000000..bbb84fa --- /dev/null +++ b/SwiftString.xcodeproj/xcshareddata/xcschemes/SwiftString.xcscheme @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SwiftString.xcodeproj/xcshareddata/xcschemes/xcschememanagement.plist b/SwiftString.xcodeproj/xcshareddata/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..2ee5ba0 --- /dev/null +++ b/SwiftString.xcodeproj/xcshareddata/xcschemes/xcschememanagement.plist @@ -0,0 +1,12 @@ + + + + SchemeUserState + + SwiftString.xcscheme + + + SuppressBuildableAutocreation + + + diff --git a/Tests/LinuxMain.swift b/Tests/LinuxMain.swift new file mode 100644 index 0000000..879cba6 --- /dev/null +++ b/Tests/LinuxMain.swift @@ -0,0 +1,5 @@ +import XCTest +import SwiftStringTestSuite +var tests = [XCTestCaseEntry]() +tests += SwiftStringTestSuite.allTests() +XCTMain(tests) diff --git a/Tests/SwiftStringTests/SwiftStringTests.swift b/Tests/SwiftStringTests/SwiftStringTests.swift new file mode 100644 index 0000000..9b6fa13 --- /dev/null +++ b/Tests/SwiftStringTests/SwiftStringTests.swift @@ -0,0 +1,18 @@ +import XCTest +#if os(Linux) + import SwiftGlibc +#else + import Darwin +#endif +@testable import SwiftString +class SwiftStringTests: XCTestCase { + override func setUp() { + super.setUp() + } + override func tearDown() { + super.tearDown() + } + + + +} diff --git a/_Pods.xcodeproj b/_Pods.xcodeproj deleted file mode 120000 index 3c5a8e7..0000000 --- a/_Pods.xcodeproj +++ /dev/null @@ -1 +0,0 @@ -Example/Pods/Pods.xcodeproj \ No newline at end of file From 9c3e82329b48f7d57af7122c7e2bd7ef3e527670 Mon Sep 17 00:00:00 2001 From: Jonathan Guthrie Date: Tue, 20 Sep 2016 17:24:25 -0400 Subject: [PATCH 03/16] Finished tests --- Example/Podfile | 11 - Example/Podfile.lock | 17 - Example/SwiftString.xcodeproj/project.pbxproj | 591 ------------------ .../contents.xcworkspacedata | 7 - .../xcschemes/SwiftString-Example.xcscheme | 115 ---- .../contents.xcworkspacedata | 10 - Example/SwiftString/AppDelegate.swift | 46 -- .../SwiftString/Base.lproj/LaunchScreen.xib | 41 -- .../SwiftString/Base.lproj/Main.storyboard | 25 - .../AppIcon.appiconset/Contents.json | 38 -- Example/SwiftString/Info.plist | 39 -- Example/SwiftString/ViewController.swift | 24 - Example/Tests/Info.plist | 24 - Example/Tests/String+HTMLTests.swift | 13 - Example/Tests/StringExtensionTests.swift | 259 -------- Sources/StringExtensions.swift | 86 ++- .../{String+HTML.swift => StringHTML.swift} | 0 SwiftString.xcodeproj/project.pbxproj | 10 +- Tests/SwiftStringTests/SwiftStringTests.swift | 224 +++++++ 19 files changed, 269 insertions(+), 1311 deletions(-) delete mode 100644 Example/Podfile delete mode 100644 Example/Podfile.lock delete mode 100644 Example/SwiftString.xcodeproj/project.pbxproj delete mode 100644 Example/SwiftString.xcodeproj/project.xcworkspace/contents.xcworkspacedata delete mode 100644 Example/SwiftString.xcodeproj/xcshareddata/xcschemes/SwiftString-Example.xcscheme delete mode 100644 Example/SwiftString.xcworkspace/contents.xcworkspacedata delete mode 100644 Example/SwiftString/AppDelegate.swift delete mode 100644 Example/SwiftString/Base.lproj/LaunchScreen.xib delete mode 100644 Example/SwiftString/Base.lproj/Main.storyboard delete mode 100644 Example/SwiftString/Images.xcassets/AppIcon.appiconset/Contents.json delete mode 100644 Example/SwiftString/Info.plist delete mode 100644 Example/SwiftString/ViewController.swift delete mode 100644 Example/Tests/Info.plist delete mode 100644 Example/Tests/String+HTMLTests.swift delete mode 100644 Example/Tests/StringExtensionTests.swift rename Sources/{String+HTML.swift => StringHTML.swift} (100%) diff --git a/Example/Podfile b/Example/Podfile deleted file mode 100644 index f013c53..0000000 --- a/Example/Podfile +++ /dev/null @@ -1,11 +0,0 @@ -source 'https://github.com/CocoaPods/Specs.git' -use_frameworks! - -target 'SwiftString_Example', :exclusive => true do - pod 'SwiftString', :path => '../' -end - -target 'SwiftString_Tests', :exclusive => true do - pod 'SwiftString', :path => '../' - pod 'SwiftHamcrest' -end diff --git a/Example/Podfile.lock b/Example/Podfile.lock deleted file mode 100644 index 7b0c421..0000000 --- a/Example/Podfile.lock +++ /dev/null @@ -1,17 +0,0 @@ -PODS: - - SwiftHamcrest (0.3) - - SwiftString (0.1) - -DEPENDENCIES: - - SwiftHamcrest - - SwiftString (from `../`) - -EXTERNAL SOURCES: - SwiftString: - :path: "../" - -SPEC CHECKSUMS: - SwiftHamcrest: 652d2e197df0957b532f1c66a9112bc809030965 - SwiftString: 0a32494e59f63c337ad0b2b5fa8cdba5c536484a - -COCOAPODS: 0.39.0 diff --git a/Example/SwiftString.xcodeproj/project.pbxproj b/Example/SwiftString.xcodeproj/project.pbxproj deleted file mode 100644 index a672999..0000000 --- a/Example/SwiftString.xcodeproj/project.pbxproj +++ /dev/null @@ -1,591 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 589430772C3EC1111068D513 /* Pods_SwiftString_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BA0E139958C875325F8154C8 /* Pods_SwiftString_Example.framework */; }; - 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD51AFB9204008FA782 /* AppDelegate.swift */; }; - 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD71AFB9204008FA782 /* ViewController.swift */; }; - 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607FACD91AFB9204008FA782 /* Main.storyboard */; }; - 607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDC1AFB9204008FA782 /* Images.xcassets */; }; - 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; }; - 607FACEC1AFB9204008FA782 /* StringExtensionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACEB1AFB9204008FA782 /* StringExtensionTests.swift */; }; - C914AF1AC37AD238F5BE89DF /* Pods_SwiftString_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AF3B5F0448FBA6B5F3853E10 /* Pods_SwiftString_Tests.framework */; }; - E361734F1C5EC0DA0063AAC7 /* String+HTMLTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E361734E1C5EC0DA0063AAC7 /* String+HTMLTests.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 607FACE61AFB9204008FA782 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 607FACC81AFB9204008FA782 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 607FACCF1AFB9204008FA782; - remoteInfo = SwiftString; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 019FA1CE0AA97C15E2CE000C /* Pods-SwiftString_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftString_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwiftString_Example/Pods-SwiftString_Example.debug.xcconfig"; sourceTree = ""; }; - 0426C5BFC54D8C1FBD78C15F /* Pods-SwiftString_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftString_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwiftString_Example/Pods-SwiftString_Example.release.xcconfig"; sourceTree = ""; }; - 372CCE3674464B433AA934A9 /* SwiftString.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = SwiftString.podspec; path = ../SwiftString.podspec; sourceTree = ""; }; - 43D9619446241F6E12A5D132 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; - 607FACD01AFB9204008FA782 /* SwiftString_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwiftString_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 607FACD51AFB9204008FA782 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 607FACD71AFB9204008FA782 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - 607FACDA1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 607FACDC1AFB9204008FA782 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; - 607FACDF1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; - 607FACE51AFB9204008FA782 /* SwiftString_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwiftString_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 607FACEA1AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 607FACEB1AFB9204008FA782 /* StringExtensionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringExtensionTests.swift; sourceTree = ""; }; - 6F2196573BA624D905B98536 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; - AF3B5F0448FBA6B5F3853E10 /* Pods_SwiftString_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwiftString_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - BA0E139958C875325F8154C8 /* Pods_SwiftString_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwiftString_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - CAF2F5323C60B18222F42A88 /* Pods-SwiftString_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftString_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwiftString_Tests/Pods-SwiftString_Tests.release.xcconfig"; sourceTree = ""; }; - DD7662C0FCE9A2A50CCAA5DA /* Pods-SwiftString_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftString_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwiftString_Tests/Pods-SwiftString_Tests.debug.xcconfig"; sourceTree = ""; }; - E361734E1C5EC0DA0063AAC7 /* String+HTMLTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+HTMLTests.swift"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 607FACCD1AFB9204008FA782 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 589430772C3EC1111068D513 /* Pods_SwiftString_Example.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 607FACE21AFB9204008FA782 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - C914AF1AC37AD238F5BE89DF /* Pods_SwiftString_Tests.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 607FACC71AFB9204008FA782 = { - isa = PBXGroup; - children = ( - 607FACF51AFB993E008FA782 /* Podspec Metadata */, - 607FACD21AFB9204008FA782 /* Example for SwiftString */, - 607FACE81AFB9204008FA782 /* Tests */, - 607FACD11AFB9204008FA782 /* Products */, - 90F499C4F609D8EE4B8866F0 /* Pods */, - 9B5FA3D4893E4286D48E5F75 /* Frameworks */, - ); - sourceTree = ""; - }; - 607FACD11AFB9204008FA782 /* Products */ = { - isa = PBXGroup; - children = ( - 607FACD01AFB9204008FA782 /* SwiftString_Example.app */, - 607FACE51AFB9204008FA782 /* SwiftString_Tests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - 607FACD21AFB9204008FA782 /* Example for SwiftString */ = { - isa = PBXGroup; - children = ( - 607FACD51AFB9204008FA782 /* AppDelegate.swift */, - 607FACD71AFB9204008FA782 /* ViewController.swift */, - 607FACD91AFB9204008FA782 /* Main.storyboard */, - 607FACDC1AFB9204008FA782 /* Images.xcassets */, - 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */, - 607FACD31AFB9204008FA782 /* Supporting Files */, - ); - name = "Example for SwiftString"; - path = SwiftString; - sourceTree = ""; - }; - 607FACD31AFB9204008FA782 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 607FACD41AFB9204008FA782 /* Info.plist */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - 607FACE81AFB9204008FA782 /* Tests */ = { - isa = PBXGroup; - children = ( - 607FACEB1AFB9204008FA782 /* StringExtensionTests.swift */, - E361734E1C5EC0DA0063AAC7 /* String+HTMLTests.swift */, - 607FACE91AFB9204008FA782 /* Supporting Files */, - ); - path = Tests; - sourceTree = ""; - }; - 607FACE91AFB9204008FA782 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 607FACEA1AFB9204008FA782 /* Info.plist */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - 607FACF51AFB993E008FA782 /* Podspec Metadata */ = { - isa = PBXGroup; - children = ( - 372CCE3674464B433AA934A9 /* SwiftString.podspec */, - 43D9619446241F6E12A5D132 /* README.md */, - 6F2196573BA624D905B98536 /* LICENSE */, - ); - name = "Podspec Metadata"; - sourceTree = ""; - }; - 90F499C4F609D8EE4B8866F0 /* Pods */ = { - isa = PBXGroup; - children = ( - 019FA1CE0AA97C15E2CE000C /* Pods-SwiftString_Example.debug.xcconfig */, - 0426C5BFC54D8C1FBD78C15F /* Pods-SwiftString_Example.release.xcconfig */, - DD7662C0FCE9A2A50CCAA5DA /* Pods-SwiftString_Tests.debug.xcconfig */, - CAF2F5323C60B18222F42A88 /* Pods-SwiftString_Tests.release.xcconfig */, - ); - name = Pods; - sourceTree = ""; - }; - 9B5FA3D4893E4286D48E5F75 /* Frameworks */ = { - isa = PBXGroup; - children = ( - BA0E139958C875325F8154C8 /* Pods_SwiftString_Example.framework */, - AF3B5F0448FBA6B5F3853E10 /* Pods_SwiftString_Tests.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 607FACCF1AFB9204008FA782 /* SwiftString_Example */ = { - isa = PBXNativeTarget; - buildConfigurationList = 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "SwiftString_Example" */; - buildPhases = ( - 1EED4C78D4534C0B6CCEACEF /* Check Pods Manifest.lock */, - 607FACCC1AFB9204008FA782 /* Sources */, - 607FACCD1AFB9204008FA782 /* Frameworks */, - 607FACCE1AFB9204008FA782 /* Resources */, - 669AE38B7A12FD629F57750E /* Embed Pods Frameworks */, - 2FB142E00953020DAFCDEA76 /* Copy Pods Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = SwiftString_Example; - productName = SwiftString; - productReference = 607FACD01AFB9204008FA782 /* SwiftString_Example.app */; - productType = "com.apple.product-type.application"; - }; - 607FACE41AFB9204008FA782 /* SwiftString_Tests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "SwiftString_Tests" */; - buildPhases = ( - DD43306B24A8C58478E69FA2 /* Check Pods Manifest.lock */, - 607FACE11AFB9204008FA782 /* Sources */, - 607FACE21AFB9204008FA782 /* Frameworks */, - 607FACE31AFB9204008FA782 /* Resources */, - F82078855395DF8B82837C90 /* Embed Pods Frameworks */, - 98E0193430A08EF1190A7DC0 /* Copy Pods Resources */, - ); - buildRules = ( - ); - dependencies = ( - 607FACE71AFB9204008FA782 /* PBXTargetDependency */, - ); - name = SwiftString_Tests; - productName = Tests; - productReference = 607FACE51AFB9204008FA782 /* SwiftString_Tests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 607FACC81AFB9204008FA782 /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 0720; - LastUpgradeCheck = 0720; - ORGANIZATIONNAME = CocoaPods; - TargetAttributes = { - 607FACCF1AFB9204008FA782 = { - CreatedOnToolsVersion = 6.3.1; - DevelopmentTeam = T6UGWQ58CZ; - }; - 607FACE41AFB9204008FA782 = { - CreatedOnToolsVersion = 6.3.1; - TestTargetID = 607FACCF1AFB9204008FA782; - }; - }; - }; - buildConfigurationList = 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "SwiftString" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 607FACC71AFB9204008FA782; - productRefGroup = 607FACD11AFB9204008FA782 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 607FACCF1AFB9204008FA782 /* SwiftString_Example */, - 607FACE41AFB9204008FA782 /* SwiftString_Tests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 607FACCE1AFB9204008FA782 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */, - 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */, - 607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 607FACE31AFB9204008FA782 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 1EED4C78D4534C0B6CCEACEF /* Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Check Pods Manifest.lock"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; - showEnvVarsInLog = 0; - }; - 2FB142E00953020DAFCDEA76 /* Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwiftString_Example/Pods-SwiftString_Example-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - 669AE38B7A12FD629F57750E /* Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Embed Pods Frameworks"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwiftString_Example/Pods-SwiftString_Example-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 98E0193430A08EF1190A7DC0 /* Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwiftString_Tests/Pods-SwiftString_Tests-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - DD43306B24A8C58478E69FA2 /* Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Check Pods Manifest.lock"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; - showEnvVarsInLog = 0; - }; - F82078855395DF8B82837C90 /* Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Embed Pods Frameworks"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwiftString_Tests/Pods-SwiftString_Tests-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 607FACCC1AFB9204008FA782 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */, - 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 607FACE11AFB9204008FA782 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 607FACEC1AFB9204008FA782 /* StringExtensionTests.swift in Sources */, - E361734F1C5EC0DA0063AAC7 /* String+HTMLTests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 607FACE71AFB9204008FA782 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 607FACCF1AFB9204008FA782 /* SwiftString_Example */; - targetProxy = 607FACE61AFB9204008FA782 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 607FACD91AFB9204008FA782 /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 607FACDA1AFB9204008FA782 /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */ = { - isa = PBXVariantGroup; - children = ( - 607FACDF1AFB9204008FA782 /* Base */, - ); - name = LaunchScreen.xib; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 607FACED1AFB9204008FA782 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = 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_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.3; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - }; - name = Debug; - }; - 607FACEE1AFB9204008FA782 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = 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_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.3; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 607FACF01AFB9204008FA782 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 019FA1CE0AA97C15E2CE000C /* Pods-SwiftString_Example.debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_IDENTITY = "iPhone Developer"; - INFOPLIST_FILE = SwiftString/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MODULE_NAME = ExampleApp; - PRODUCT_BUNDLE_IDENTIFIER = "com.redbricklabs.SwiftString-Example"; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 607FACF11AFB9204008FA782 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 0426C5BFC54D8C1FBD78C15F /* Pods-SwiftString_Example.release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_IDENTITY = "iPhone Developer"; - INFOPLIST_FILE = SwiftString/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MODULE_NAME = ExampleApp; - PRODUCT_BUNDLE_IDENTIFIER = "com.redbricklabs.SwiftString-Example"; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; - 607FACF31AFB9204008FA782 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = DD7662C0FCE9A2A50CCAA5DA /* Pods-SwiftString_Tests.debug.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - FRAMEWORK_SEARCH_PATHS = ( - "$(SDKROOT)/Developer/Library/Frameworks", - "$(inherited)", - ); - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - INFOPLIST_FILE = Tests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwiftString_Example.app/SwiftString_Example"; - }; - name = Debug; - }; - 607FACF41AFB9204008FA782 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = CAF2F5323C60B18222F42A88 /* Pods-SwiftString_Tests.release.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - FRAMEWORK_SEARCH_PATHS = ( - "$(SDKROOT)/Developer/Library/Frameworks", - "$(inherited)", - ); - INFOPLIST_FILE = Tests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwiftString_Example.app/SwiftString_Example"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "SwiftString" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 607FACED1AFB9204008FA782 /* Debug */, - 607FACEE1AFB9204008FA782 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "SwiftString_Example" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 607FACF01AFB9204008FA782 /* Debug */, - 607FACF11AFB9204008FA782 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "SwiftString_Tests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 607FACF31AFB9204008FA782 /* Debug */, - 607FACF41AFB9204008FA782 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 607FACC81AFB9204008FA782 /* Project object */; -} diff --git a/Example/SwiftString.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Example/SwiftString.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index b2b993e..0000000 --- a/Example/SwiftString.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Example/SwiftString.xcodeproj/xcshareddata/xcschemes/SwiftString-Example.xcscheme b/Example/SwiftString.xcodeproj/xcshareddata/xcschemes/SwiftString-Example.xcscheme deleted file mode 100644 index aa24f9c..0000000 --- a/Example/SwiftString.xcodeproj/xcshareddata/xcschemes/SwiftString-Example.xcscheme +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Example/SwiftString.xcworkspace/contents.xcworkspacedata b/Example/SwiftString.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 2846d4e..0000000 --- a/Example/SwiftString.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/Example/SwiftString/AppDelegate.swift b/Example/SwiftString/AppDelegate.swift deleted file mode 100644 index 080e283..0000000 --- a/Example/SwiftString/AppDelegate.swift +++ /dev/null @@ -1,46 +0,0 @@ -// -// AppDelegate.swift -// SwiftString -// -// Created by Andrew Mayne on 01/31/2016. -// Copyright (c) 2016 Andrew Mayne. All rights reserved. -// - -import UIKit - -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate { - - var window: UIWindow? - - - func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { - // Override point for customization after application launch. - return true - } - - func applicationWillResignActive(application: UIApplication) { - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. - } - - func applicationDidEnterBackground(application: UIApplication) { - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. - } - - func applicationWillEnterForeground(application: UIApplication) { - // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. - } - - func applicationDidBecomeActive(application: UIApplication) { - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - } - - func applicationWillTerminate(application: UIApplication) { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. - } - - -} - diff --git a/Example/SwiftString/Base.lproj/LaunchScreen.xib b/Example/SwiftString/Base.lproj/LaunchScreen.xib deleted file mode 100644 index f98581d..0000000 --- a/Example/SwiftString/Base.lproj/LaunchScreen.xib +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Example/SwiftString/Base.lproj/Main.storyboard b/Example/SwiftString/Base.lproj/Main.storyboard deleted file mode 100644 index 52ea29e..0000000 --- a/Example/SwiftString/Base.lproj/Main.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Example/SwiftString/Images.xcassets/AppIcon.appiconset/Contents.json b/Example/SwiftString/Images.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index d3942e9..0000000 --- a/Example/SwiftString/Images.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/Example/SwiftString/Info.plist b/Example/SwiftString/Info.plist deleted file mode 100644 index eb18faa..0000000 --- a/Example/SwiftString/Info.plist +++ /dev/null @@ -1,39 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - - - diff --git a/Example/SwiftString/ViewController.swift b/Example/SwiftString/ViewController.swift deleted file mode 100644 index c94d6a5..0000000 --- a/Example/SwiftString/ViewController.swift +++ /dev/null @@ -1,24 +0,0 @@ -// -// ViewController.swift -// SwiftString -// -// Created by Andrew Mayne on 01/31/2016. -// Copyright (c) 2016 Andrew Mayne. All rights reserved. -// - -import UIKit - -class ViewController: UIViewController { - - override func viewDidLoad() { - super.viewDidLoad() - // Do any additional setup after loading the view, typically from a nib. - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - // Dispose of any resources that can be recreated. - } - -} - diff --git a/Example/Tests/Info.plist b/Example/Tests/Info.plist deleted file mode 100644 index ba72822..0000000 --- a/Example/Tests/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - - diff --git a/Example/Tests/String+HTMLTests.swift b/Example/Tests/String+HTMLTests.swift deleted file mode 100644 index a93c677..0000000 --- a/Example/Tests/String+HTMLTests.swift +++ /dev/null @@ -1,13 +0,0 @@ -import XCTest -import Hamcrest -import SwiftString - -class StringHTMLTests: XCTestCase { - - func testDecodeHTML() { - assertThat("The Weekend ‘King Of The Fall’".decodeHTML(), presentAnd(equalTo("The Weekend ‘King Of The Fall’"))) - assertThat(" 4 < 5 & 3 > 2 . Price: 12 €. @ ".decodeHTML(), presentAnd(equalTo(" 4 < 5 & 3 > 2 . Price: 12 €. @ "))) - assertThat("this is so "good"".decodeHTML(), presentAnd(equalTo("this is so \"good\""))) - } - -} diff --git a/Example/Tests/StringExtensionTests.swift b/Example/Tests/StringExtensionTests.swift deleted file mode 100644 index 2c26d19..0000000 --- a/Example/Tests/StringExtensionTests.swift +++ /dev/null @@ -1,259 +0,0 @@ -import XCTest -import Hamcrest -import SwiftString - -class SwiftStringTests: XCTestCase { - - func testBetween() { - assertThat("foo".between("", ""), presentAnd(equalTo("foo"))) - assertThat("foo".between("", ""), presentAnd(equalTo("foo"))) - assertThat("foo".between("", ""), nilValue()) - assertThat("Some strings } are very {weird}, dont you think?".between("{", "}"), presentAnd(equalTo("weird"))) - assertThat("".between("", ""), nilValue()) - assertThat("foo".between("", ""), nilValue()) - } - - func testCamelize() { - assertThat("os version".camelize() == "osVersion") - assertThat("HelloWorld".camelize() == "helloWorld") - assertThat("someword With Characters".camelize() == "somewordWithCharacters") - assertThat("data_rate".camelize() == "dataRate") - assertThat("background-color".camelize() == "backgroundColor") - } - - func testCapitalize() { - assertThat("hello world".capitalize() == "Hello World") - } - - func testChompLeft() { - assertThat("foobar".chompLeft("foo") == "bar") - assertThat("foobar".chompLeft("bar") == "foo") - } - - func testChompRight() { - assertThat("foobar".chompRight("bar") == "foo") - assertThat("foobar".chompRight("foo") == "bar") - } - - func testClean() { - assertThat("thisoneistwoathreetest".clean(with: " ", allOf: "one", "two", "three") == "this is a test") - } - - func testCollapseWhitespace() { - assertThat(" String \t libraries are \n\n\t fun\n! ".collapseWhitespace() == "String libraries are fun !") - } - - func testContains() { - assertThat("foobar".contains("foo") == true) - assertThat("foobar".contains("ba") == true) - assertThat("foobar".contains("something") == false) - } - - func testCount() { - assertThat("hi hi ho hey hihey".count("hi") == 3) - } - - func testEndsWith() { - assertThat("hello world".endsWith("world") == true) - assertThat("hello world".endsWith("foo") == false) - } - - func testEnsureLeft() { - assertThat("/subdir".ensureLeft("/") == "/subdir") - assertThat("subdir".ensureLeft("/") == "/subdir") - } - - func testEnsureRight() { - assertThat("subdir/".ensureRight("/") == "subdir/") - assertThat("subdir".ensureRight("/") == "subdir/") - } - - func testIndexOf() { - assertThat("hello".indexOf("hell"), presentAnd(equalTo(0))) - assertThat("hello".indexOf("lo"), presentAnd(equalTo(3))) - assertThat("hello".indexOf("world"), nilValue()) - } - - func testInitials() { - assertThat("First".initials() == "F") - assertThat("First Last".initials() == "FL") - assertThat("First Middle1 Middle2 Middle3 Last".initials() == "FMMML") - } - - func testInitialsFirstAndLast() { - assertThat("First Last".initialsFirstAndLast() == "FL") - assertThat("First Middle1 Middle2 Middle3 Last".initialsFirstAndLast() == "FL") - } - - func testIsAlpha() { - assertThat("fdafaf3".isAlpha() == false) - assertThat("afaf".isAlpha() == true) - assertThat("dfdf--dfd".isAlpha() == false) - } - - func testIsAlphaNumeric() { - assertThat("afaf35353afaf".isAlphaNumeric() == true) - assertThat("FFFF99fff".isAlphaNumeric() == true) - assertThat("99".isAlphaNumeric() == true) - assertThat("afff".isAlphaNumeric() == true) - assertThat("-33".isAlphaNumeric() == false) - assertThat("aaff..".isAlphaNumeric() == false) - } - - func testIsEmpty() { - assertThat("".isEmpty() == true) - assertThat(" ".isEmpty() == true) - assertThat("\t\t\t ".isEmpty() == true) - assertThat("\n\n".isEmpty() == true) - assertThat("helo".isEmpty() == false) - } - - func testIsNumeric() { - assertThat("abc".isNumeric() == false) - assertThat("123a".isNumeric() == false) - assertThat("1".isNumeric() == true) - assertThat("22".isNumeric() == true) - assertThat("33.0".isNumeric() == true) - assertThat("-63.0".isNumeric() == true) - } - - func testJoin() { - assertThat(",".join([1,2,3]) == "1,2,3") - assertThat(",".join([]) == "") - assertThat(",".join(["a","b","c"]) == "a,b,c") - assertThat("! ".join(["hey","who are you?"]) == "hey! who are you?") - } - - func testLatinize() { - assertThat("šÜįéïöç".latinize() == "sUieioc") - assertThat("crème brûlée".latinize() == "creme brulee") - } - - func testLines() { - assertThat("test".lines() == ["test"]) - assertThat("test\nsentence".lines() == ["test", "sentence"]) - assertThat("test \nsentence".lines() == ["test ", "sentence"]) - //Test Carriage return instead of just newlines - assertThat("test\rsentence".lines() == ["test", "sentence"]) - } - - func testPad() { - assertThat("hello".pad(2) == " hello ") - assertThat("hello".pad(1, "\t") == "\thello\t") - } - - func testPadLeft() { - assertThat("hello".padLeft(10) == " hello") - assertThat("what?".padLeft(2, "!") == "!!what?") - } - - func testPadRight() { - assertThat("hello".padRight(10) == "hello ") - assertThat("hello".padRight(2, "!") == "hello!!") - } - - func testStartsWith() { - assertThat("hello world".startsWith("hello") == true) - assertThat("hello world".startsWith("foo") == false) - } - - func testSplit() { - assertThat("hello world".split(" ")[0] == "hello") - assertThat("hello world".split(" ")[1] == "world") - assertThat("helloworld".split(" ")[0] == "helloworld") - } - - func testTimes() { - assertThat("hi".times(3) == "hihihi") - assertThat(" ".times(10) == " ") - } - - func testTrimmedLeft() { - assertThat(" How are you? ".trimmedLeft() == "How are you? ") - } - - func testTrimmedRight() { - assertThat(" How are you? ".trimmedRight() == " How are you?") - } - - func testTrimmed() { - assertThat(" How are you? ".trimmed() == "How are you?") - //Added per Issue #9 - https://github.com/amayne/SwiftString/issues/9 - assertThat(" ".trimmed().characters.count == 0) - assertThat(" ".trimmed().characters.count == 0) - assertThat(" ".trimmed().characters.count == 0) - } - - func testToBool() { - assertThat("asdwads".toBool(), nilValue()) - assertThat("true".toBool(), presentAnd(equalTo(true))) - assertThat("false".toBool(), presentAnd(equalTo(false))) - } - - func testToFloat() { - assertThat("asdwads".toFloat(), nilValue()) - assertThat("2.00".toFloat(), presentAnd(equalTo(2.0))) - assertThat("2".toFloat(), presentAnd(equalTo(2.0))) - } - - func testToInt() { - assertThat("asdwads".toInt(), nilValue()) - assertThat("2.00".toInt(), presentAnd(equalTo(2))) - assertThat("2".toInt(), presentAnd(equalTo(2))) - } - - func testToDate() { - assertThat("asdwads".toDate(), nilValue()) - - let calendar = NSCalendar.currentCalendar() - let components = calendar.components([.Day , .Month , .Year], fromDate: "2014-06-03".toDate()!) - - assertThat(components.year == 2014) - assertThat(components.month == 6) - assertThat(components.day == 3) - } - - func testToDateTime() { - assertThat("asdwads".toDateTime(), nilValue()) - let calendar = NSCalendar.currentCalendar() - let components = calendar.components([.Day , .Month , .Year, .Hour, .Minute, .Second], fromDate: "2014-06-03 13:15:01".toDateTime()!) - - assertThat(components.year == 2014) - assertThat(components.month == 6) - assertThat(components.day == 3) - assertThat(components.hour == 13) - assertThat(components.minute == 15) - assertThat(components.second == 1) - } - - func testToDouble() { - assertThat("asdwads".toDouble(), nilValue()) - assertThat("2.00".toDouble(), presentAnd(equalTo(2.0))) - assertThat("2".toDouble(), presentAnd(equalTo(2.0))) - } - - func testSlugify() { - assertThat("Global Thermonuclear Warfare".slugify() == "global-thermonuclear-warfare") - assertThat("Global Thermonuclear Warfare".slugify(withSeparator: "_") == "global_thermonuclear_warfare") - assertThat("Crème brûlée".slugify() == "creme-brulee") - } - - func testStripPunctuation() { - assertThat("My, st[ring] *full* of %punct)".stripPunctuation() == "My string full of punct") - } - - func testSubstring() { - let subject = "hello world" - assertThat(subject.substring(0, length: 1) == "h") - assertThat(subject.substring(0, length: 11) == "hello world") - } - - func testSubscripts() { - let subject = "hello world" - assertThat(subject[0...1] == "he") - assertThat(subject[0..<1] == "h") - assertThat(subject[0] == "h") - assertThat(subject[0...10] == "hello world") - } - -} diff --git a/Sources/StringExtensions.swift b/Sources/StringExtensions.swift index 291478c..9754a5a 100644 --- a/Sources/StringExtensions.swift +++ b/Sources/StringExtensions.swift @@ -34,7 +34,7 @@ public extension String { let rest = String(cammel.characters.dropFirst()) return "\(first)\(rest)" } else { - var first = source[self.startIndex...self.index(after: startIndex)].lowercased() + let first = source[self.startIndex...self.index(after: startIndex)].lowercased() let rest = String(source.characters.dropFirst()) return "\(first)\(rest)" } @@ -44,10 +44,10 @@ public extension String { return capitalized } - func contains(_ substring: String) -> Bool { - return range(of: substring) != nil - } - +// func contains(_ substring: String) -> Bool { +// return range(of: substring) != nil +// } + func chompLeft(_ prefix: String) -> String { if let prefixRange = range(of: prefix) { if prefixRange.upperBound >= endIndex { @@ -109,19 +109,21 @@ public extension String { func indexOf(_ substring: String) -> Int? { if let range = range(of: substring) { - return startIndex.distanceTo(range.lowerBound) + return self.distance(from: startIndex, to: range.lowerBound) +// return startIndex.distanceTo(range.lowerBound) } return nil } func initials() -> String { let words = self.components(separatedBy: " ") - return words.reduce(""){$0 + $1[0...0]} + return words.reduce(""){$0 + $1[startIndex...startIndex]} +// return words.reduce(""){$0 + $1[0...0]} } func initialsFirstAndLast() -> String { let words = self.components(separatedBy: " ") - return words.reduce("") { ($0 == "" ? "" : $0[0...0]) + $1[0...0]} + return words.reduce("") { ($0 == "" ? "" : $0[startIndex...startIndex]) + $1[startIndex...startIndex]} } func isAlpha() -> Bool { @@ -136,7 +138,12 @@ public extension String { func isAlphaNumeric() -> Bool { let alphaNumeric = NSCharacterSet.alphanumerics let output = self.unicodeScalars.split { !alphaNumeric.contains($0)}.map(String.init) - return output.count != 1 + if output.count == 1 { + if output[0] != self { + return false + } + } + return output.count == 1 // return componentsSeparatedByCharactersInSet(alphaNumeric).joinWithSeparator("").length == 0 } @@ -151,16 +158,17 @@ public extension String { return false } - func join(_ elements: S) -> String { + private func join(_ elements: S) -> String { return elements.map{String(describing: $0)}.joined(separator: self) } - + func latinize() -> String { - return self.stringByFoldingWithOptions(.DiacriticInsensitiveSearch, locale: NSLocale.currentLocale()) + return self.folding(options: .diacriticInsensitive, locale: .current) +// stringByFoldingWithOptions(.DiacriticInsensitiveSearch, locale: NSLocale.currentLocale()) } func lines() -> [String] { - return self.componentsSeparatedByCharactersInSet(NSCharacterSet.newlineCharacterSet()) + return self.components(separatedBy: NSCharacterSet.newlines) } var length: Int { @@ -184,26 +192,26 @@ public extension String { func slugify(withSeparator separator: Character = "-") -> String { let slugCharacterSet = NSCharacterSet(charactersIn: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\(separator)") return latinize() - .lowercaseString - .componentsSeparatedByCharactersInSet(slugCharacterSet.invertedSet) + .lowercased() + .components(separatedBy: slugCharacterSet.inverted) .filter { $0 != "" } - .joinWithSeparator(String(separator)) + .joined(separator: String(separator)) } - func split(_ separator: Character) -> [String] { + func split(_ separator: Character = " ") -> [String] { return characters.split{$0 == separator}.map(String.init) } func startsWith(_ prefix: String) -> Bool { return hasPrefix(prefix) } - + func stripPunctuation() -> String { - return componentsSeparatedByCharactersInSet(.punctuationCharacterSet()) - .joinWithSeparator("") - .componentsSeparatedByString(" ") + return components(separatedBy: .punctuationCharacters) + .joined(separator: "") + .components(separatedBy: " ") .filter { $0 != "" } - .joinWithSeparator(" ") + .joined(separator: " ") } func times(_ n: Int) -> String { @@ -223,48 +231,36 @@ public extension String { } return nil } - - func toDouble(_ locale: NSLocale = NSLocale.systemLocale) -> Double? { - let nf = localeNumberFormatter(locale) - - if let number = nf.number(from: self) { - return number.doubleValue - } - return nil - } - + func toBool() -> Bool? { let trimmed = self.trimmed().lowercased() - if trimmed == "true" || trimmed == "false" { - return (trimmed as NSString).boolValue - } - return nil + return (trimmed as NSString).boolValue } - func toDate(_ format: String = "yyyy-MM-dd") -> NSDate? { - return dateFormatter(format).date(from: self) as NSDate? + func toDate(_ format: String = "yyyy-MM-dd") -> Date? { + return dateFormatter(format).date(from: self) as Date? } - func toDateTime(_ format: String = "yyyy-MM-dd HH:mm:ss") -> NSDate? { + func toDateTime(_ format: String = "yyyy-MM-dd HH:mm:ss") -> Date? { return toDate(format) } func trimmedLeft() -> String { - if let range = rangeOfCharacterFromSet(NSCharacterSet.whitespaceAndNewlineCharacterSet().invertedSet) { - return self[range.startIndex.. String { - if let range = rangeOfCharacterFrom(NSCharacterSet.whitespaceAndNewlineCharacterSet.inverted, options: NSString.CompareOptions.BackwardsSearch) { - return self[startIndex.. String { - return self.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()) + return self.trimmingCharacters(in: .whitespacesAndNewlines) } subscript(r: Range) -> String { @@ -299,7 +295,7 @@ private enum ThreadLocalIdentifier { switch self { case .dateFormatter(let format): return "SS\(self)\(format)" - case .LocaleNumberFormatter(let l): + case .localeNumberFormatter(let l): return "SS\(self)\(l.localeIdentifier)" default: return "SS\(self)" diff --git a/Sources/String+HTML.swift b/Sources/StringHTML.swift similarity index 100% rename from Sources/String+HTML.swift rename to Sources/StringHTML.swift diff --git a/SwiftString.xcodeproj/project.pbxproj b/SwiftString.xcodeproj/project.pbxproj index a89315c..c46d183 100644 --- a/SwiftString.xcodeproj/project.pbxproj +++ b/SwiftString.xcodeproj/project.pbxproj @@ -8,7 +8,7 @@ /* Begin PBXBuildFile section */ _LinkFileRef_SwiftString_via_SwiftStringTests /* SwiftString.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = "_____Product_SwiftString" /* SwiftString.framework */; }; - "__src_cc_ref_Sources/String+HTML.swift" /* String+HTML.swift in Sources */ = {isa = PBXBuildFile; fileRef = "__PBXFileRef_Sources/String+HTML.swift" /* String+HTML.swift */; }; + "__src_cc_ref_Sources/String+HTML.swift" /* StringHTML.swift in Sources */ = {isa = PBXBuildFile; fileRef = "__PBXFileRef_Sources/String+HTML.swift" /* StringHTML.swift */; }; __src_cc_ref_Sources/StringExtensions.swift /* StringExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Sources/StringExtensions.swift /* StringExtensions.swift */; }; __src_cc_ref_Tests/SwiftStringTests/SwiftStringTests.swift /* SwiftStringTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Tests/SwiftStringTests/SwiftStringTests.swift /* SwiftStringTests.swift */; }; /* End PBXBuildFile section */ @@ -24,9 +24,8 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - __PBXFileRef_Example /* Example */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Example; sourceTree = ""; }; __PBXFileRef_Package.swift /* Package.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = ""; }; - "__PBXFileRef_Sources/String+HTML.swift" /* String+HTML.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = "String+HTML.swift"; path = "Sources/String+HTML.swift"; sourceTree = ""; }; + "__PBXFileRef_Sources/String+HTML.swift" /* StringHTML.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = StringHTML.swift; path = Sources/StringHTML.swift; sourceTree = ""; }; __PBXFileRef_Sources/StringExtensions.swift /* StringExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = StringExtensions.swift; path = Sources/StringExtensions.swift; sourceTree = ""; }; __PBXFileRef_SwiftString.xcodeproj/Configs/Debug.xcconfig /* SwiftString.xcodeproj/Configs/Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = SwiftString.xcodeproj/Configs/Debug.xcconfig; sourceTree = ""; }; __PBXFileRef_SwiftString.xcodeproj/Configs/Project.xcconfig /* SwiftString.xcodeproj/Configs/Project.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = SwiftString.xcodeproj/Configs/Project.xcconfig; sourceTree = ""; }; @@ -69,7 +68,6 @@ __PBXFileRef_Package.swift /* Package.swift */, "_____Configs_" /* Configs */, "_____Sources_" /* Sources */, - __PBXFileRef_Example /* Example */, "_______Tests_" /* Tests */, "____Products_" /* Products */, ); @@ -105,7 +103,7 @@ "_______Group_SwiftString" /* SwiftString */ = { isa = PBXGroup; children = ( - "__PBXFileRef_Sources/String+HTML.swift" /* String+HTML.swift */, + "__PBXFileRef_Sources/String+HTML.swift" /* StringHTML.swift */, __PBXFileRef_Sources/StringExtensions.swift /* StringExtensions.swift */, ); name = SwiftString; @@ -202,7 +200,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 0; files = ( - "__src_cc_ref_Sources/String+HTML.swift" /* String+HTML.swift in Sources */, + "__src_cc_ref_Sources/String+HTML.swift" /* StringHTML.swift in Sources */, __src_cc_ref_Sources/StringExtensions.swift /* StringExtensions.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/Tests/SwiftStringTests/SwiftStringTests.swift b/Tests/SwiftStringTests/SwiftStringTests.swift index 9b6fa13..784c2fe 100644 --- a/Tests/SwiftStringTests/SwiftStringTests.swift +++ b/Tests/SwiftStringTests/SwiftStringTests.swift @@ -13,6 +13,230 @@ class SwiftStringTests: XCTestCase { super.tearDown() } + func testBetween() { + let s = "The stupid brown fox" + XCTAssert(((s.between("stupid", "fox")?.characters.count) != nil), "Between is invalid") + } + func testCamelize() { + let s = "The stupid brown fox" + XCTAssert((s.camelize() != "The Stupid Brown Fox"), "Camelize is invalid") + } + func testCapitalize() { + let s = "the Fox" + XCTAssert((s.capitalize() != "THE FOX"), "Capitalize is invalid") + } + func testChompLeft() { + let s = "The stupid brown Fox" + XCTAssertEqual(s.chompLeft("The "), "stupid brown Fox", "ChompLeft is invalid") + } + func testChompRight() { + let s = "The stupid brown Fox" + XCTAssertEqual(s.chompLeft(" Fox"), "The stupid brown", "ChompRight is invalid") + } + //collapseWhitespace + func testcollapseWhitespace() { + let s = "The stupid brown fox" + XCTAssertEqual(s.collapseWhitespace(), "The stupid brown fox", "collapseWhitespace is invalid") + } + + //clean + func testclean() { + let s = "The stupid brøwn føx" + XCTAssertEqual(s.clean(with: "o",allOf: "ø"), "The stupid brown fox", "clean is invalid") + } + //count + func testcount() { + let s = "The stupid brown fox" + XCTAssertEqual(s.count("o"), 2, "count is invalid") + } + //endsWith + func testendsWith() { + let s = "The stupid brown fox" + XCTAssertEqual(s.endsWith("foc"), false, "endsWith is invalid") + XCTAssertEqual(s.endsWith("fox"), true, "endsWith is invalid") + } + //ensureLeft + func testensureLeft() { + let s = "The stupid brown fox" + XCTAssertNotEqual(s.ensureLeft("Tha"), s, "ensureLeft is invalid") + XCTAssertEqual(s.ensureLeft("The"), "The stupid brown fox", "ensureLeft is invalid") + XCTAssertEqual(s.ensureLeft("And "), "And The stupid brown fox", "ensureLeft is invalid") + } + //ensureRight + func testensureRight() { + let s = "The stupid brown fox" + XCTAssertNotEqual(s.ensureRight("fax"), s, "ensureRight is invalid") + XCTAssertEqual(s.ensureRight("fox"), "The stupid brown fox", "ensureRight is invalid") + XCTAssertEqual(s.ensureRight(" died."), "The stupid brown fox died.", "ensureRight is invalid") + } + //indexOf + func testindexOf() { + let s = "The stupid brøwn føx" + XCTAssertEqual(s.indexOf("s"), 4, "indexOf is invalid") + XCTAssertNotEqual(s.indexOf("s"), 7, "indexOf is invalid") + } + //initials + func testinitials() { + let s = "brown Fox" + XCTAssertEqual(s.initials(), "bF", "initials is invalid") + XCTAssertNotEqual(s.initials(), "BS", "initials is invalid") + } + //initialsFirstAndLast + func testinitialsFirstAndLast() { + let s = "stupid brown Fox" + XCTAssertEqual(s.initialsFirstAndLast(), "sF", "initialsFirstAndLast is invalid") + XCTAssertNotEqual(s.initialsFirstAndLast(), "bF", "initialsFirstAndLast is invalid") + } + //isAlpha + func testisAlpha() { + let s = "stupid brown Fox" + XCTAssertEqual(s.isAlpha(), false, "isAlpha is invalid") + + let sn = "stupid2Fox" + XCTAssertEqual(sn.isAlpha(), false, "isAlpha is invalid") + + let ss = "stupidbrownFox" + XCTAssertEqual(ss.isAlpha(), true, "isAlpha is invalid") + } + //isAlphaNumeric + func testisAlphaNumeric() { + let s = "stupid brown Fox!" + XCTAssertEqual(s.isAlphaNumeric(), false, "isAlphaNumeric is invalid") + + let snx = "stupid2Fox!" + XCTAssertEqual(snx.isAlphaNumeric(), false, "isAlphaNumeric is invalid") + + let sn = "stupid2Fox" + XCTAssertEqual(sn.isAlphaNumeric(), true, "isAlphaNumeric is invalid") + + let ss = "stupidbrownFox" + XCTAssertEqual(ss.isAlphaNumeric(), true, "isAlphaNumeric is invalid") + } + //isEmpty + func testisEmpty() { + let s = "stupid brown Fox!" + XCTAssertEqual(s.isEmpty(), false, "isEmpty is invalid") + + let snx = "" + XCTAssertEqual(snx.isEmpty(), true, "isEmpty is invalid") + } + //isNumeric + func testisNumeric() { + let s = "stupid brown Fox!" + XCTAssertEqual(s.isNumeric(), false, "isNumeric is invalid") + + let snx = "12" + XCTAssertEqual(snx.isNumeric(), true, "isNumeric is invalid") + } + //latinize + func testlatinize() { + let s = "The stüpid brown Fox" + XCTAssertEqual(s.latinize(), "The stupid brown Fox", "latinize is invalid") + } + //lines + func testlines() { + let s = "The stupid brown Fox\nis dead." + XCTAssertEqual(s.lines(), ["The stupid brown Fox","is dead."], "lines is invalid") + } + //length + func testlength() { + let s = "The stupid brown Fox" + XCTAssertEqual(s.length, 20, "length is invalid") + } + //pad + func testpad() { + let s = "The stupid brown Fox" + XCTAssertEqual(s.pad(3,"x"), "xxxThe stupid brown Foxxxx", "pad is invalid") + } + //padLeft + func testpadLeft() { + let s = "The stupid brown Fox" + XCTAssertEqual(s.padLeft(3,"x"), "xxxThe stupid brown Fox", "padLeft is invalid") + } + //padRight + func testpadRight() { + let s = "The stupid brown Fox" + XCTAssertEqual(s.padRight(3,"x"), "The stupid brown Foxxxx", "padRight is invalid") + } + //slugify + func testslugify() { + let s = "The stupid brown Fox" + XCTAssertEqual(s.slugify(), "the-stupid-brown-fox", "slugify is invalid") + } + //split + func testsplit() { + let s = "The stupid brown Fox - is dead" + XCTAssertEqual(s.split(), ["The","stupid","brown","Fox","-","is","dead"], "split is invalid") + XCTAssertEqual(s.split("-"), ["The stupid brown Fox "," is dead"], "split is invalid") + } + //startsWith + func teststartsWith() { + let s = "The stupid brown Fox" + XCTAssertEqual(s.startsWith("The stupid"), true, "startsWith is invalid") + XCTAssertEqual(s.startsWith("The nice"), false, "startsWith is invalid") + } + //stripPunctuation + func teststripPunctuation() { + let s = "The stupid! brown Fox" + XCTAssertEqual(s.stripPunctuation(), "The stupid brown Fox", "stripPunctuation is invalid") + } + //toFloat + func testtoFloat() { + let s = "2.0" + XCTAssertEqual(s.toFloat(), 2.0, "toFloat is invalid") + } + //toInt + func testtoInt() { + let s = "2" + XCTAssertEqual(s.toInt(), 2, "toInt is invalid") + } + //toBool + func testtoBool() { + let s = "0" + XCTAssertEqual(s.toBool(), false, "toBool is invalid") + let s1 = "-1" + XCTAssertEqual(s1.toBool(), true, "toBool is invalid") + let s2 = "1" + XCTAssertEqual(s2.toBool(), true, "toBool is invalid") + let s3 = "2" + XCTAssertEqual(s3.toBool(), true, "toBool is invalid") + } + //toDate + func testtoDate() { + let s = "2016-03-01" + let formatter = DateFormatter() + formatter.dateFormat = "yyyy/MM/dd" + let someDateTime = formatter.date(from: "2016-03-01") + XCTAssertEqual(s.toDate(),someDateTime, "toDate is invalid") + } + //toDateTime + func testtoDateTime() { + let s = "2016-03-01 18:31:00" + let formatter = DateFormatter() + formatter.dateFormat = "yyyy/MM/dd HH:mm:SS" + let someDateTime = formatter.date(from: "2016-03-01 18:31:00") + XCTAssertEqual(s.toDateTime(),someDateTime, "toDateTime is invalid") + } + //trimmedLeft + func testtrimmedLeft() { + let s = " The stupid brown fox " + XCTAssertEqual(s.trimmedLeft(), "The stupid brown fox ", "trimmedLeft is invalid") + } + //trimmedRight + func testtrimmedRight() { + let s = " The stupid brown fox " + XCTAssertEqual(s.trimmedRight(), " The stupid brown fox", "trimmedRight is invalid") + } + //trimmed + func testtrimmed() { + let s = " The stupid brown fox " + XCTAssertEqual(s.trimmed(), "The stupid brown fox", "trimmed is invalid") + } + //substring + func testsubstring() { + let s = "The stupid brown fox" + XCTAssertEqual(s.substring(4,length: 9), "stupid br", "trimmed is invalid") + } } From 3994a2d80596ebdab89e5e075a2e262d7ffc0f34 Mon Sep 17 00:00:00 2001 From: Jonathan Guthrie Date: Tue, 20 Sep 2016 17:29:22 -0400 Subject: [PATCH 04/16] Updated readme with SPM info --- README.md | 105 +++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 76 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 61981d4..f4d2e00 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,20 @@ # SwiftString -[![CI Status](http://img.shields.io/travis/amayne/SwiftString.svg?style=flat)](https://travis-ci.org/amayne/SwiftString) -[![Version](https://img.shields.io/cocoapods/v/SwiftString.svg?style=flat)](http://cocoapods.org/pods/SwiftString) -[![License](https://img.shields.io/cocoapods/l/SwiftString.svg?style=flat)](http://cocoapods.org/pods/SwiftString) -[![Platform](https://img.shields.io/cocoapods/p/SwiftString.svg?style=flat)](http://cocoapods.org/pods/SwiftString) -[![Swift-2.1](http://img.shields.io/badge/Swift-2.1-blue.svg)]() - -SwiftString is a lightweight string extension for Swift. +SwiftString is a lightweight string extension for Swift 3. This library was motivated by having to search StackOverflow for common string operations, and wanting them to be in one place with test coverage. -## Installation +Note the original client side Swift 2 repo can be found here: +[https://github.com/amayne/SwiftString](https://github.com/amayne/SwiftString) -SwiftString is available through [CocoaPods](http://cocoapods.org). To install -it, simply add the following line to your Podfile: -```ruby -pod "SwiftString" -``` +## This Fork + +This fork is intended as a server side utility. + +* It is Swift 3.0 and Swift Package Manager (SPM) ready. +* Added sigificant test coverage + ## Usage @@ -28,7 +25,8 @@ import SwiftString ## Methods **between(left, right)** -```swift + +``` swift "foo".between("", "") // "foo" "foo".between("", "") // "foo" "foo".between("", "") // nil @@ -38,6 +36,7 @@ import SwiftString ``` **camelize()** + ```swift "os version".camelize() // "osVersion" "HelloWorld".camelize() // "helloWorld" @@ -48,40 +47,39 @@ import SwiftString **capitalize()** + ```swift "hello world".capitalize() // "Hello World" ``` **chompLeft(string)** + ```swift "foobar".chompLeft("foo") // "bar" "foobar".chompLeft("bar") // "foo" ``` **chompRight(string)** + ```swift "foobar".chompRight("bar") // "foo" "foobar".chompRight("foo") // "bar" ``` **collapseWhitespace()** -```swift -" String \t libraries are \n\n\t fun\n! ".collapseWhitespace() // "String libraries are fun !") -``` -**contains(substring)** ```swift -"foobar".contains("foo") // true -"foobar".contains("bar") // true -"foobar".contains("something") // false +" String \t libraries are \n\n\t fun\n! ".collapseWhitespace() // "String libraries are fun !") ``` **count(string)** + ```swift "hi hi ho hey hihey".count("hi") // 3 ``` **decodeHTML()** + ```swift "The Weekend ‘King Of The Fall’".decodeHTML() // "The Weekend ‘King Of The Fall’" " 4 < 5 & 3 > 2 . Price: 12 €. @ ".decodeHTML() // " 4 < 5 & 3 > 2 . Price: 12 €. @ " @@ -89,24 +87,28 @@ import SwiftString ``` **endsWith(suffix)** + ```swift "hello world".endsWith("world") // true "hello world".endsWith("foo") // false ``` **ensureLeft(prefix)** + ```swift "/subdir".ensureLeft("/") // "/subdir" "subdir".ensureLeft("/") // "/subdir" ``` **ensureRight(suffix)** + ```swift "subdir/".ensureRight("/") // "subdir/" "subdir".ensureRight("/") // "subdir/" ``` **indexOf(substring)** + ```swift "hello".indexOf("hell"), // 0 "hello".indexOf("lo"), // 3 @@ -114,6 +116,7 @@ import SwiftString ``` **initials()** + ```swift "First".initials(), // "F" "First Last".initials(), // "FL" @@ -121,12 +124,14 @@ import SwiftString ``` **initialsFirstAndLast()** + ```swift "First Last".initialsFirstAndLast(), // "FL" "First Middle1 Middle2 Middle3 Last".initialsFirstAndLast() // "FL" ``` **isAlpha()** + ```swift "fdafaf3".isAlpha() // false "afaf".isAlpha() // true @@ -134,6 +139,7 @@ import SwiftString ``` **isAlphaNumeric()** + ```swift "afaf35353afaf".isAlphaNumeric() // true "FFFF99fff".isAlphaNumeric() // true @@ -144,6 +150,7 @@ import SwiftString ``` **isEmpty()** + ```swift " ".isEmpty() // true "\t\t\t ".isEmpty() // true @@ -152,6 +159,7 @@ import SwiftString ``` **isNumeric()** + ```swift "abc".isNumeric() // false "123a".isNumeric() // false @@ -161,21 +169,15 @@ import SwiftString "-63.0".isNumeric() // true ``` -**join(sequence)** -```swift -",".join([1,2,3]) // "1,2,3" -",".join([]) // "" -",".join(["a","b","c"]) // "a,b,c" -"! ".join(["hey","who are you?"]) // "hey! who are you?" -``` - **latinize()** + ```swift "šÜįéïöç".latinize() // "sUieioc" "crème brûlée".latinize() // "creme brulee" ``` **lines()** + ```swift "test".lines() // ["test"] "test\nsentence".lines() // ["test", "sentence"] @@ -183,30 +185,35 @@ import SwiftString ``` **pad(n, string)** + ```swift "hello".pad(2) // " hello " "hello".pad(1, "\t") // "\thello\t" ``` **padLeft(n, string)** + ```swift "hello".padLeft(10) // " hello" "what?".padLeft(2, "!") // "!!what?" ``` **padRight(n, string)** + ```swift "hello".padRight(10) // "hello " "hello".padRight(2, "!") // "hello!!" ``` **startsWith(prefix)** + ```swift "hello world".startsWith("hello") // true "hello world".startsWith("foo") // false ``` **split(separator)** + ```swift "hello world".split(" ")[0] // "hello" "hello world".split(" ")[1] // "world" @@ -214,12 +221,14 @@ import SwiftString ``` **times(n)** + ```swift "hi".times(3) // "hihihi" " ".times(10) // " " ``` **toBool()** + ```swift "asdwads".toBool() // nil "true".toBool() // true @@ -227,6 +236,7 @@ import SwiftString ``` **toFloat()** + ```swift "asdwads".toFloat() // nil "2.00".toFloat() // 2.0 @@ -234,6 +244,7 @@ import SwiftString ``` **toInt()** + ```swift "asdwads".toInt() // nil "2.00".toInt() // 2 @@ -241,18 +252,21 @@ import SwiftString ``` **toDate()** + ```swift "asdwads".toDate() // nil "2014-06-03".toDate() // NSDate ``` **toDateTime()** + ```swift "asdwads".toDateTime() // nil "2014-06-03 13:15:01".toDateTime() // NSDate ``` **toDouble()** + ```swift "asdwads".toDouble() // nil "2.00".toDouble() // 2.0 @@ -260,38 +274,45 @@ import SwiftString ``` **trimmedLeft()** + ```swift " How are you? ".trimmedLeft() // "How are you? " ``` **trimmedRight()** + ```swift " How are you? ".trimmedRight() // " How are you?" ``` **trimmed()** + ```swift " How are you? ".trimmed() // "How are you?" ``` **slugify()** + ```swift "Global Thermonuclear Warfare".slugify() // "global-thermonuclear-warfare" "Crème brûlée".slugify() // "creme-brulee" ``` **stripPunctuation()** + ```swift "My, st[ring] *full* of %punct)".stripPunctuation() // "My string full of punct" ``` **substring(startIndex, length)** + ```swift "hello world".substring(0, length: 1) // "h" "hello world".substring(0, length: 11) // "hello world" ``` **[subscript]** + ```swift "hello world"[0...1] // "he" "hello world"[0..<1] // "h" @@ -299,10 +320,36 @@ import SwiftString "hello world"[0...10] // "hello world" ``` +## Requirements + +- Swift version 3.0 + +## Installation + +### Install via Swift Package Manager + +* Add the following to your `Package.swift` file: + +``` swift +.Package( + url: "https://github.com/iamjono/SwiftString.git", + majorVersion: 1, minor: 0 + ), +``` + +Then, regenerate your Xcode project: + +``` +swift package generate-xcodeproj +``` + + ## Author Andrew Mayne, andrew@redbricklab.com +Swift 3 SPM module, Jonathan Guthrie, jono@guthrie.net.nz + ## License SwiftString is available under the MIT license. See the LICENSE file for more info. From 2cfd84889c162bc11575ac1efcc78fff3ba1686d Mon Sep 17 00:00:00 2001 From: Jonathan Guthrie Date: Tue, 11 Oct 2016 12:39:34 -0400 Subject: [PATCH 05/16] Fixing some linux specific issues --- Sources/StringExtensions.swift | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/Sources/StringExtensions.swift b/Sources/StringExtensions.swift index 9754a5a..ae08d34 100644 --- a/Sources/StringExtensions.swift +++ b/Sources/StringExtensions.swift @@ -30,7 +30,8 @@ public extension String { let source = clean(with: " ", allOf: "-", "_") if source.characters.contains(" ") { let first = self[self.startIndex...self.index(after: startIndex)] //source.substringToIndex(source.index(after: startIndex)) - let cammel = NSString(format: "%@", (source as NSString).capitalized.replacingOccurrences(of: " ", with: "")) as String + let strip = source.capitalized.replacingOccurrences(of: " ", with: "") + let cammel = String(format: "%@", strip) let rest = String(cammel.characters.dropFirst()) return "\(first)\(rest)" } else { @@ -234,9 +235,19 @@ public extension String { func toBool() -> Bool? { let trimmed = self.trimmed().lowercased() - return (trimmed as NSString).boolValue + if Int(trimmed) != 0 { + return true + } + switch trimmed { + case "true", "yes", "1": + return true + case "false", "no", "0": + return false + default: + return false + } } - + func toDate(_ format: String = "yyyy-MM-dd") -> Date? { return dateFormatter(format).date(from: self) as Date? } @@ -293,7 +304,7 @@ private enum ThreadLocalIdentifier { var objcDictKey: String { switch self { - case .dateFormatter(let format): + case .dateFormatter(var format): return "SS\(self)\(format)" case .localeNumberFormatter(let l): return "SS\(self)\(l.localeIdentifier)" @@ -327,10 +338,10 @@ private func defaultNumberFormatter() -> NumberFormatter { return threadLocalInstance(.defaultNumberFormatter, initialValue: NumberFormatter()) } -private func localeNumberFormatter(_ locale: NSLocale) -> NumberFormatter { - return threadLocalInstance(.localeNumberFormatter(locale), initialValue: { +private func localeNumberFormatter(_ locale: Locale) -> NumberFormatter { + return threadLocalInstance(.localeNumberFormatter(locale as NSLocale), initialValue: { let nf = NumberFormatter() - nf.locale = locale as Locale! + nf.locale = locale return nf }()) } From 57abb34b12a98068ce03bac703c5f93925abfc04 Mon Sep 17 00:00:00 2001 From: Jonathan Guthrie Date: Tue, 11 Oct 2016 12:45:48 -0400 Subject: [PATCH 06/16] Linux compatibility --- Sources/StringExtensions.swift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Sources/StringExtensions.swift b/Sources/StringExtensions.swift index ae08d34..8cb4b31 100644 --- a/Sources/StringExtensions.swift +++ b/Sources/StringExtensions.swift @@ -30,8 +30,8 @@ public extension String { let source = clean(with: " ", allOf: "-", "_") if source.characters.contains(" ") { let first = self[self.startIndex...self.index(after: startIndex)] //source.substringToIndex(source.index(after: startIndex)) - let strip = source.capitalized.replacingOccurrences(of: " ", with: "") - let cammel = String(format: "%@", strip) + let cammel = source.capitalized.replacingOccurrences(of: " ", with: "") +// let cammel = String(format: "%@", strip) let rest = String(cammel.characters.dropFirst()) return "\(first)\(rest)" } else { @@ -300,14 +300,14 @@ private enum ThreadLocalIdentifier { case dateFormatter(String) case defaultNumberFormatter - case localeNumberFormatter(NSLocale) + case localeNumberFormatter(Locale) var objcDictKey: String { switch self { case .dateFormatter(var format): return "SS\(self)\(format)" case .localeNumberFormatter(let l): - return "SS\(self)\(l.localeIdentifier)" + return "SS\(self)\(l.identifier)" default: return "SS\(self)" } @@ -315,7 +315,7 @@ private enum ThreadLocalIdentifier { } private func threadLocalInstance(_ identifier: ThreadLocalIdentifier, initialValue: @autoclosure () -> T) -> T { - let storage = Thread.current.threadDictionary + var storage = Thread.current.threadDictionary let k = identifier.objcDictKey let instance: T = storage[k] as? T ?? initialValue() @@ -339,7 +339,7 @@ private func defaultNumberFormatter() -> NumberFormatter { } private func localeNumberFormatter(_ locale: Locale) -> NumberFormatter { - return threadLocalInstance(.localeNumberFormatter(locale as NSLocale), initialValue: { + return threadLocalInstance(.localeNumberFormatter(locale), initialValue: { let nf = NumberFormatter() nf.locale = locale return nf From e2a6d7794391e44ecb156ab22bd6e7ac48ba5ed0 Mon Sep 17 00:00:00 2001 From: Jonathan Guthrie Date: Fri, 14 Oct 2016 15:07:21 -0400 Subject: [PATCH 07/16] added isValidEmail --- Sources/StringExtensions.swift | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Sources/StringExtensions.swift b/Sources/StringExtensions.swift index 8cb4b31..29bad2c 100644 --- a/Sources/StringExtensions.swift +++ b/Sources/StringExtensions.swift @@ -345,3 +345,10 @@ private func localeNumberFormatter(_ locale: Locale) -> NumberFormatter { return nf }()) } + +extension String { + func isValidEmail() -> Bool { + let regex = try? NSRegularExpression(pattern: "^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$", options: .caseInsensitive) + return regex?.firstMatch(in: self, options: [], range: NSMakeRange(0, self.characters.count)) != nil + } +} From 257ed148dd1599e86655ef4e255da40d9da89ee7 Mon Sep 17 00:00:00 2001 From: Jonathan Guthrie Date: Fri, 14 Oct 2016 15:10:58 -0400 Subject: [PATCH 08/16] made public --- Sources/StringExtensions.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/StringExtensions.swift b/Sources/StringExtensions.swift index 29bad2c..3427d12 100644 --- a/Sources/StringExtensions.swift +++ b/Sources/StringExtensions.swift @@ -304,7 +304,7 @@ private enum ThreadLocalIdentifier { var objcDictKey: String { switch self { - case .dateFormatter(var format): + case .dateFormatter(let format): return "SS\(self)\(format)" case .localeNumberFormatter(let l): return "SS\(self)\(l.identifier)" @@ -315,7 +315,7 @@ private enum ThreadLocalIdentifier { } private func threadLocalInstance(_ identifier: ThreadLocalIdentifier, initialValue: @autoclosure () -> T) -> T { - var storage = Thread.current.threadDictionary + let storage = Thread.current.threadDictionary let k = identifier.objcDictKey let instance: T = storage[k] as? T ?? initialValue() @@ -346,7 +346,7 @@ private func localeNumberFormatter(_ locale: Locale) -> NumberFormatter { }()) } -extension String { +public extension String { func isValidEmail() -> Bool { let regex = try? NSRegularExpression(pattern: "^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$", options: .caseInsensitive) return regex?.firstMatch(in: self, options: [], range: NSMakeRange(0, self.characters.count)) != nil From 4f9c48e35c683d0d4c8b62abc73f29ca73cda67c Mon Sep 17 00:00:00 2001 From: Jonathan Guthrie Date: Sun, 16 Oct 2016 16:49:24 -0400 Subject: [PATCH 09/16] change for linux regexp --- Sources/StringExtensions.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sources/StringExtensions.swift b/Sources/StringExtensions.swift index 3427d12..83afb69 100644 --- a/Sources/StringExtensions.swift +++ b/Sources/StringExtensions.swift @@ -348,7 +348,11 @@ private func localeNumberFormatter(_ locale: Locale) -> NumberFormatter { public extension String { func isValidEmail() -> Bool { + #if os(Linux) + let regex = try? RegularExpression(pattern: "^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$", options: .caseInsensitive) + #else let regex = try? NSRegularExpression(pattern: "^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$", options: .caseInsensitive) + #endif return regex?.firstMatch(in: self, options: [], range: NSMakeRange(0, self.characters.count)) != nil } } From b2cea024ea91b2df1af082f2d7b1be69d695cd3e Mon Sep 17 00:00:00 2001 From: Jonathan Guthrie Date: Sun, 16 Oct 2016 16:52:13 -0400 Subject: [PATCH 10/16] let to var --- Sources/StringExtensions.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/StringExtensions.swift b/Sources/StringExtensions.swift index 83afb69..f117668 100644 --- a/Sources/StringExtensions.swift +++ b/Sources/StringExtensions.swift @@ -315,7 +315,7 @@ private enum ThreadLocalIdentifier { } private func threadLocalInstance(_ identifier: ThreadLocalIdentifier, initialValue: @autoclosure () -> T) -> T { - let storage = Thread.current.threadDictionary + var storage = Thread.current.threadDictionary let k = identifier.objcDictKey let instance: T = storage[k] as? T ?? initialValue() From ed1132269896e0a3e68cc4bb29d0063c142f55b9 Mon Sep 17 00:00:00 2001 From: Jonathan Guthrie Date: Sun, 16 Oct 2016 16:57:50 -0400 Subject: [PATCH 11/16] removing date test linux. foundation issues --- Tests/SwiftStringTests/SwiftStringTests.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Tests/SwiftStringTests/SwiftStringTests.swift b/Tests/SwiftStringTests/SwiftStringTests.swift index 784c2fe..58dfc5c 100644 --- a/Tests/SwiftStringTests/SwiftStringTests.swift +++ b/Tests/SwiftStringTests/SwiftStringTests.swift @@ -203,6 +203,7 @@ class SwiftStringTests: XCTestCase { let s3 = "2" XCTAssertEqual(s3.toBool(), true, "toBool is invalid") } + #if !os(Linux) //toDate func testtoDate() { let s = "2016-03-01" @@ -219,6 +220,7 @@ class SwiftStringTests: XCTestCase { let someDateTime = formatter.date(from: "2016-03-01 18:31:00") XCTAssertEqual(s.toDateTime(),someDateTime, "toDateTime is invalid") } + #endif //trimmedLeft func testtrimmedLeft() { let s = " The stupid brown fox " From 63406632ac855927aa7bceb8b6d249b1e523e5bf Mon Sep 17 00:00:00 2001 From: Jonathan Guthrie Date: Sun, 16 Oct 2016 17:06:43 -0400 Subject: [PATCH 12/16] fixing linux tests --- Tests/LinuxMain.swift | 9 ++-- Tests/SwiftStringTests/SwiftStringTests.swift | 42 +++++++++++++++++++ 2 files changed, 47 insertions(+), 4 deletions(-) diff --git a/Tests/LinuxMain.swift b/Tests/LinuxMain.swift index 879cba6..3bcdbbc 100644 --- a/Tests/LinuxMain.swift +++ b/Tests/LinuxMain.swift @@ -1,5 +1,6 @@ import XCTest -import SwiftStringTestSuite -var tests = [XCTestCaseEntry]() -tests += SwiftStringTestSuite.allTests() -XCTMain(tests) +@testable import SwiftStringTests + +XCTMain([ + testCase(SwiftStringTests.allTests), + ]) diff --git a/Tests/SwiftStringTests/SwiftStringTests.swift b/Tests/SwiftStringTests/SwiftStringTests.swift index 58dfc5c..e500c0c 100644 --- a/Tests/SwiftStringTests/SwiftStringTests.swift +++ b/Tests/SwiftStringTests/SwiftStringTests.swift @@ -5,6 +5,7 @@ import XCTest import Darwin #endif @testable import SwiftString + class SwiftStringTests: XCTestCase { override func setUp() { super.setUp() @@ -241,4 +242,45 @@ class SwiftStringTests: XCTestCase { let s = "The stupid brown fox" XCTAssertEqual(s.substring(4,length: 9), "stupid br", "trimmed is invalid") } + + static var allTests : [(String, (SwiftStringTests) -> () throws -> Void)] { + return [ + ("testBetween", testBetween), + ("testCamelize", testCamelize), + ("testCapitalize", testCapitalize), + ("testChompLeft", testChompLeft), + ("testChompRight", testChompRight), + ("testcollapseWhitespace", testcollapseWhitespace), + ("testclean", testclean), + ("testcount", testcount), + ("testendsWith", testendsWith), + ("testensureLeft", testensureLeft), + ("testensureRight", testensureRight), + ("testindexOf", testindexOf), + ("testinitials", testinitials), + ("testinitialsFirstAndLast", testinitialsFirstAndLast), + ("testisAlpha", testisAlpha), + ("testisAlphaNumeric", testisAlphaNumeric), + ("testisEmpty", testisEmpty), + ("testisNumeric", testisNumeric), + ("testlatinize", testlatinize), + ("testlines", testlines), + ("testlength", testlength), + ("testpad", testpad), + ("testpadLeft", testpadLeft), + ("testpadRight", testpadRight), + ("testslugify", testslugify), + ("testsplit", testsplit), + ("teststartsWith", teststartsWith), + ("teststripPunctuation", teststripPunctuation), + ("testtoFloat", testtoFloat), + ("testtoInt", testtoInt), + ("testtoBool", testtoBool), + ("testtrimmedLeft", testtrimmedLeft), + ("testtrimmedRight", testtrimmedRight), + ("testtrimmed", testtrimmed), + ("testsubstring", testsubstring) + ] + } + } From 3a6d37a0f28d1029c45e3ca4bfc3d1d98d0fd267 Mon Sep 17 00:00:00 2001 From: Jonathan Guthrie Date: Mon, 24 Oct 2016 20:59:11 -0400 Subject: [PATCH 13/16] add tokenize --- Sources/StringExtensions.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Sources/StringExtensions.swift b/Sources/StringExtensions.swift index f117668..6cd6902 100644 --- a/Sources/StringExtensions.swift +++ b/Sources/StringExtensions.swift @@ -198,7 +198,12 @@ public extension String { .filter { $0 != "" } .joined(separator: String(separator)) } - + + /// split the string into a string array by white spaces + func tokenize() -> [String] { + return self.components(separatedBy: .whitespaces) + } + func split(_ separator: Character = " ") -> [String] { return characters.split{$0 == separator}.map(String.init) } From ed508f665bb76b327d79695335cca11b89442892 Mon Sep 17 00:00:00 2001 From: Jonathan Guthrie Date: Mon, 24 Oct 2016 21:04:00 -0400 Subject: [PATCH 14/16] adding left, and right --- Sources/StringExtensions.swift | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Sources/StringExtensions.swift b/Sources/StringExtensions.swift index 6cd6902..5cc7b9f 100644 --- a/Sources/StringExtensions.swift +++ b/Sources/StringExtensions.swift @@ -298,7 +298,17 @@ public extension String { let index = self.characters.index(self.startIndex, offsetBy: i) return self[index] } - } + } + + /// get the left part of the string before the index + func left(_ range:Range?) -> String { + return self.substring(to: (range?.lowerBound)!) + } + /// get the right part of the string after the index + func right(_ range:Range?) -> String { + return self.substring(from: self.index((range?.lowerBound)!, offsetBy:1)) + } + } private enum ThreadLocalIdentifier { From f7394e1828cd39824bdb088e7c76961d3f84d65a Mon Sep 17 00:00:00 2001 From: Jonathan Guthrie Date: Mon, 24 Oct 2016 21:30:33 -0400 Subject: [PATCH 15/16] remove left & right trial. use os context switch for storage --- Sources/StringExtensions.swift | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/Sources/StringExtensions.swift b/Sources/StringExtensions.swift index 5cc7b9f..a4bc400 100644 --- a/Sources/StringExtensions.swift +++ b/Sources/StringExtensions.swift @@ -300,14 +300,14 @@ public extension String { } } - /// get the left part of the string before the index - func left(_ range:Range?) -> String { - return self.substring(to: (range?.lowerBound)!) - } - /// get the right part of the string after the index - func right(_ range:Range?) -> String { - return self.substring(from: self.index((range?.lowerBound)!, offsetBy:1)) - } +// /// get the left part of the string before the index +// func left(_ range:Range?) -> String { +// return self.substring(to: (range?.lowerBound)!) +// } +// /// get the right part of the string after the index +// func right(_ range:Range?) -> String { +// return self.substring(from: self.index((range?.lowerBound)!, offsetBy:1)) +// } } @@ -330,7 +330,11 @@ private enum ThreadLocalIdentifier { } private func threadLocalInstance(_ identifier: ThreadLocalIdentifier, initialValue: @autoclosure () -> T) -> T { - var storage = Thread.current.threadDictionary + #if os(Linux) + var storage = Thread.current.threadDictionary + #else + let storage = Thread.current.threadDictionary + #endif let k = identifier.objcDictKey let instance: T = storage[k] as? T ?? initialValue() From 5ead3f2228bd4da0d25a6f5b003da4d3a9799859 Mon Sep 17 00:00:00 2001 From: Kostya Bychkov Date: Tue, 25 Oct 2016 23:28:03 +0300 Subject: [PATCH 16/16] remove pods, update podspec --- .../Local Podspecs/SwiftString.podspec.json | 21 - Example/Pods/Manifest.lock | 16 - Example/Pods/Pods.xcodeproj/project.pbxproj | 540 ------------------ .../Pods-dsdsds/Info.plist | 26 - .../Pods-dsdsds-acknowledgements.markdown | 26 - .../Pods-dsdsds-acknowledgements.plist | 56 -- .../Pods-dsdsds/Pods-dsdsds-dummy.m | 5 - .../Pods-dsdsds/Pods-dsdsds-frameworks.sh | 91 --- .../Pods-dsdsds/Pods-dsdsds-resources.sh | 102 ---- .../Pods-dsdsds/Pods-dsdsds-umbrella.h | 6 - .../Pods-dsdsds/Pods-dsdsds.debug.xcconfig | 10 - .../Pods-dsdsds/Pods-dsdsds.modulemap | 6 - .../Pods-dsdsds/Pods-dsdsds.release.xcconfig | 10 - .../SwiftString/Info.plist | 26 - .../SwiftString/SwiftString-dummy.m | 5 - .../SwiftString/SwiftString-prefix.pch | 4 - .../SwiftString/SwiftString-umbrella.h | 6 - .../SwiftString/SwiftString.modulemap | 6 - .../SwiftString/SwiftString.xcconfig | 9 - Pod/Classes/StringExtensions.swift | 0 SwiftString.podspec | 2 +- 21 files changed, 1 insertion(+), 972 deletions(-) delete mode 100644 Example/Pods/Local Podspecs/SwiftString.podspec.json delete mode 100644 Example/Pods/Manifest.lock delete mode 100644 Example/Pods/Pods.xcodeproj/project.pbxproj delete mode 100644 Example/Pods/Target Support Files/Pods-dsdsds/Info.plist delete mode 100644 Example/Pods/Target Support Files/Pods-dsdsds/Pods-dsdsds-acknowledgements.markdown delete mode 100644 Example/Pods/Target Support Files/Pods-dsdsds/Pods-dsdsds-acknowledgements.plist delete mode 100644 Example/Pods/Target Support Files/Pods-dsdsds/Pods-dsdsds-dummy.m delete mode 100755 Example/Pods/Target Support Files/Pods-dsdsds/Pods-dsdsds-frameworks.sh delete mode 100755 Example/Pods/Target Support Files/Pods-dsdsds/Pods-dsdsds-resources.sh delete mode 100644 Example/Pods/Target Support Files/Pods-dsdsds/Pods-dsdsds-umbrella.h delete mode 100644 Example/Pods/Target Support Files/Pods-dsdsds/Pods-dsdsds.debug.xcconfig delete mode 100644 Example/Pods/Target Support Files/Pods-dsdsds/Pods-dsdsds.modulemap delete mode 100644 Example/Pods/Target Support Files/Pods-dsdsds/Pods-dsdsds.release.xcconfig delete mode 100644 Example/Pods/Target Support Files/SwiftString/Info.plist delete mode 100644 Example/Pods/Target Support Files/SwiftString/SwiftString-dummy.m delete mode 100644 Example/Pods/Target Support Files/SwiftString/SwiftString-prefix.pch delete mode 100644 Example/Pods/Target Support Files/SwiftString/SwiftString-umbrella.h delete mode 100644 Example/Pods/Target Support Files/SwiftString/SwiftString.modulemap delete mode 100644 Example/Pods/Target Support Files/SwiftString/SwiftString.xcconfig delete mode 100644 Pod/Classes/StringExtensions.swift diff --git a/Example/Pods/Local Podspecs/SwiftString.podspec.json b/Example/Pods/Local Podspecs/SwiftString.podspec.json deleted file mode 100644 index eb136bf..0000000 --- a/Example/Pods/Local Podspecs/SwiftString.podspec.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "SwiftString", - "version": "0.5.1", - "summary": "A lightweight string extension for Swift", - "description": "Common methods and String operations for Swift", - "homepage": "https://github.com/amayne/SwiftString", - "license": "MIT", - "authors": { - "Andrew Mayne": "andrew@redbricklab.com" - }, - "source": { - "git": "https://github.com/amayne/SwiftString.git", - "tag": "0.5.1" - }, - "social_media_url": "https://twitter.com/amayne", - "platforms": { - "ios": "8.0" - }, - "requires_arc": true, - "source_files": "Pod/Classes/**/*" -} diff --git a/Example/Pods/Manifest.lock b/Example/Pods/Manifest.lock deleted file mode 100644 index 67d304d..0000000 --- a/Example/Pods/Manifest.lock +++ /dev/null @@ -1,16 +0,0 @@ -PODS: - - SwiftString (0.5.1) - -DEPENDENCIES: - - SwiftString (from `../`) - -EXTERNAL SOURCES: - SwiftString: - :path: "../" - -SPEC CHECKSUMS: - SwiftString: 55c189fc54f3f5e3030a355155be47c41852bcc6 - -PODFILE CHECKSUM: a863f0519f1b58f0a579f1a036655b9815d61848 - -COCOAPODS: 1.0.1 diff --git a/Example/Pods/Pods.xcodeproj/project.pbxproj b/Example/Pods/Pods.xcodeproj/project.pbxproj deleted file mode 100644 index cf96373..0000000 --- a/Example/Pods/Pods.xcodeproj/project.pbxproj +++ /dev/null @@ -1,540 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 184FA68A1C5F32D668F41243BCB8DD32 /* Pods-dsdsds-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 1476BBD323A24BCEAE61060A484CB9AA /* Pods-dsdsds-dummy.m */; }; - 4488ABAB48AFA3B9D2420244C0F70BC6 /* SwiftString-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = DF32C51451367D84B2FE6A9550D5C0E6 /* SwiftString-dummy.m */; }; - 4A3A44703E21AC20EC6E35DA1A39E62F /* Pods-dsdsds-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = BC6EA5892C619A68BC65004445B16185 /* Pods-dsdsds-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 77B2A41F6399C5449F54CA7047E3AB79 /* SwiftString-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 1774B0EFEB85D3C5ADFCA420E3EF35ED /* SwiftString-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7C2221E2C150775D8316BE7D2FB4A299 /* StringExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 55D9CDB91C182AE6F22BC5453CA6CFFE /* StringExtensions.swift */; }; - D730318F68F578D9CDF88587CF9803B0 /* String+HTML.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50DB31319FBD1428F360C44005FA3D34 /* String+HTML.swift */; }; - E1A47742300BBC655B64FFA9026D5395 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CEC22C73C1608DFA5D5D78BDCB218219 /* Foundation.framework */; }; - F6A8F31416F316D5548CA9DFF4A8308C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CEC22C73C1608DFA5D5D78BDCB218219 /* Foundation.framework */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - A99491C3D0AA6022E3056852D2C9CD76 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 288E6180BA164EDF520447AD4D7D33A7; - remoteInfo = SwiftString; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 011DE1D09BA47F59D9A31D3EDD91AE08 /* Pods-dsdsds.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-dsdsds.debug.xcconfig"; sourceTree = ""; }; - 1476BBD323A24BCEAE61060A484CB9AA /* Pods-dsdsds-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-dsdsds-dummy.m"; sourceTree = ""; }; - 1774B0EFEB85D3C5ADFCA420E3EF35ED /* SwiftString-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "SwiftString-umbrella.h"; sourceTree = ""; }; - 31D71214FF9F6FA17EC88FE807DEF350 /* Pods_dsdsds.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_dsdsds.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 405E6A629C3D8C4E92E7711CA95DD850 /* Pods-dsdsds-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-dsdsds-resources.sh"; sourceTree = ""; }; - 50DB31319FBD1428F360C44005FA3D34 /* String+HTML.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = "String+HTML.swift"; sourceTree = ""; }; - 55D9CDB91C182AE6F22BC5453CA6CFFE /* StringExtensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StringExtensions.swift; sourceTree = ""; }; - 6CE34E29E8197644933CE81F7F4B2CA2 /* SwiftString-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "SwiftString-prefix.pch"; sourceTree = ""; }; - 823DB082B1DC33C166B444F04F5FE2A8 /* Pods-dsdsds-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-dsdsds-frameworks.sh"; sourceTree = ""; }; - 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; - 9E23F238A2BFEE61103C3F69CCC269C1 /* Pods-dsdsds.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "Pods-dsdsds.modulemap"; sourceTree = ""; }; - A796CD6C16FFC8A38687985369D27161 /* SwiftString.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = SwiftString.modulemap; sourceTree = ""; }; - B614861DB8F152617078F517FF5862F2 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - B86B333A372E2962B8D4F1A9B7E3EECE /* SwiftString.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = SwiftString.xcconfig; sourceTree = ""; }; - B9868DCD2DFC595D05DCF8C9754ED04A /* SwiftString.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SwiftString.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - BC6EA5892C619A68BC65004445B16185 /* Pods-dsdsds-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-dsdsds-umbrella.h"; sourceTree = ""; }; - C2568E9AD0572649CEB0709E3A9A8718 /* Pods-dsdsds-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-dsdsds-acknowledgements.markdown"; sourceTree = ""; }; - CEC22C73C1608DFA5D5D78BDCB218219 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; - D33BD11301841E66A2D1907634FB6BB6 /* Pods-dsdsds-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-dsdsds-acknowledgements.plist"; sourceTree = ""; }; - DF32C51451367D84B2FE6A9550D5C0E6 /* SwiftString-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "SwiftString-dummy.m"; sourceTree = ""; }; - E8852B3715029878B96F6475DA3D8D7D /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - FB9A92C2A32CED37B6DB1777931FDBD7 /* Pods-dsdsds.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-dsdsds.release.xcconfig"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 1A407BA42C28AEB52217AE781273FD58 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - E1A47742300BBC655B64FFA9026D5395 /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 80740B5450633170C0F58DEA420B466A /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - F6A8F31416F316D5548CA9DFF4A8308C /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 27AD942A8AA35F0A46C9C905BDA5952F /* Development Pods */ = { - isa = PBXGroup; - children = ( - 633A8BA413E47948A05A9C56D1993E2D /* SwiftString */, - ); - name = "Development Pods"; - sourceTree = ""; - }; - 3A965A20B33EA8A8505F5F0C6271CCED /* Classes */ = { - isa = PBXGroup; - children = ( - 50DB31319FBD1428F360C44005FA3D34 /* String+HTML.swift */, - 55D9CDB91C182AE6F22BC5453CA6CFFE /* StringExtensions.swift */, - ); - path = Classes; - sourceTree = ""; - }; - 3DCAB2B7CDE207B3958B6CB957FCC758 /* iOS */ = { - isa = PBXGroup; - children = ( - CEC22C73C1608DFA5D5D78BDCB218219 /* Foundation.framework */, - ); - name = iOS; - sourceTree = ""; - }; - 4199D0E106FA587C2B6B1B97DFD2A6F3 /* Support Files */ = { - isa = PBXGroup; - children = ( - E8852B3715029878B96F6475DA3D8D7D /* Info.plist */, - A796CD6C16FFC8A38687985369D27161 /* SwiftString.modulemap */, - B86B333A372E2962B8D4F1A9B7E3EECE /* SwiftString.xcconfig */, - DF32C51451367D84B2FE6A9550D5C0E6 /* SwiftString-dummy.m */, - 6CE34E29E8197644933CE81F7F4B2CA2 /* SwiftString-prefix.pch */, - 1774B0EFEB85D3C5ADFCA420E3EF35ED /* SwiftString-umbrella.h */, - ); - name = "Support Files"; - path = "Example/Pods/Target Support Files/SwiftString"; - sourceTree = ""; - }; - 4F2F4B705D46D12C81638F1A21F187F3 /* Targets Support Files */ = { - isa = PBXGroup; - children = ( - B5261BF133746E6D179EF613AD144050 /* Pods-dsdsds */, - ); - name = "Targets Support Files"; - sourceTree = ""; - }; - 633A8BA413E47948A05A9C56D1993E2D /* SwiftString */ = { - isa = PBXGroup; - children = ( - 64DB38C80E724C3B128055595326CDAB /* Pod */, - 4199D0E106FA587C2B6B1B97DFD2A6F3 /* Support Files */, - ); - name = SwiftString; - path = ../..; - sourceTree = ""; - }; - 64DB38C80E724C3B128055595326CDAB /* Pod */ = { - isa = PBXGroup; - children = ( - 3A965A20B33EA8A8505F5F0C6271CCED /* Classes */, - ); - path = Pod; - sourceTree = ""; - }; - 797A83D88223AAC8D534C9B24FFBF4B7 /* Products */ = { - isa = PBXGroup; - children = ( - 31D71214FF9F6FA17EC88FE807DEF350 /* Pods_dsdsds.framework */, - B9868DCD2DFC595D05DCF8C9754ED04A /* SwiftString.framework */, - ); - name = Products; - sourceTree = ""; - }; - 7DB346D0F39D3F0E887471402A8071AB = { - isa = PBXGroup; - children = ( - 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */, - 27AD942A8AA35F0A46C9C905BDA5952F /* Development Pods */, - BC3CA7F9E30CC8F7E2DD044DD34432FC /* Frameworks */, - 797A83D88223AAC8D534C9B24FFBF4B7 /* Products */, - 4F2F4B705D46D12C81638F1A21F187F3 /* Targets Support Files */, - ); - sourceTree = ""; - }; - B5261BF133746E6D179EF613AD144050 /* Pods-dsdsds */ = { - isa = PBXGroup; - children = ( - B614861DB8F152617078F517FF5862F2 /* Info.plist */, - 9E23F238A2BFEE61103C3F69CCC269C1 /* Pods-dsdsds.modulemap */, - C2568E9AD0572649CEB0709E3A9A8718 /* Pods-dsdsds-acknowledgements.markdown */, - D33BD11301841E66A2D1907634FB6BB6 /* Pods-dsdsds-acknowledgements.plist */, - 1476BBD323A24BCEAE61060A484CB9AA /* Pods-dsdsds-dummy.m */, - 823DB082B1DC33C166B444F04F5FE2A8 /* Pods-dsdsds-frameworks.sh */, - 405E6A629C3D8C4E92E7711CA95DD850 /* Pods-dsdsds-resources.sh */, - BC6EA5892C619A68BC65004445B16185 /* Pods-dsdsds-umbrella.h */, - 011DE1D09BA47F59D9A31D3EDD91AE08 /* Pods-dsdsds.debug.xcconfig */, - FB9A92C2A32CED37B6DB1777931FDBD7 /* Pods-dsdsds.release.xcconfig */, - ); - name = "Pods-dsdsds"; - path = "Target Support Files/Pods-dsdsds"; - sourceTree = ""; - }; - BC3CA7F9E30CC8F7E2DD044DD34432FC /* Frameworks */ = { - isa = PBXGroup; - children = ( - 3DCAB2B7CDE207B3958B6CB957FCC758 /* iOS */, - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXHeadersBuildPhase section */ - 664FA7FD427A041E2C3F5FC60BDD0429 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 77B2A41F6399C5449F54CA7047E3AB79 /* SwiftString-umbrella.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - C750CD422B18F516680BEED60F1E6EE3 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 4A3A44703E21AC20EC6E35DA1A39E62F /* Pods-dsdsds-umbrella.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - -/* Begin PBXNativeTarget section */ - 1E52D24095854AC1AC66E0F97AF1C640 /* Pods-dsdsds */ = { - isa = PBXNativeTarget; - buildConfigurationList = F32565FDCCCC86BF5BD1E6EC107652EB /* Build configuration list for PBXNativeTarget "Pods-dsdsds" */; - buildPhases = ( - A724CDAD71EC8379D9704E0148E72694 /* Sources */, - 80740B5450633170C0F58DEA420B466A /* Frameworks */, - C750CD422B18F516680BEED60F1E6EE3 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - 6F977E5AEEACDC26F9D96C82A8F17479 /* PBXTargetDependency */, - ); - name = "Pods-dsdsds"; - productName = "Pods-dsdsds"; - productReference = 31D71214FF9F6FA17EC88FE807DEF350 /* Pods_dsdsds.framework */; - productType = "com.apple.product-type.framework"; - }; - 288E6180BA164EDF520447AD4D7D33A7 /* SwiftString */ = { - isa = PBXNativeTarget; - buildConfigurationList = AC23DA421FC5B510E707A45EF4F145D0 /* Build configuration list for PBXNativeTarget "SwiftString" */; - buildPhases = ( - E3C2DA07F10DB45A7F8B7E4D664CB518 /* Sources */, - 1A407BA42C28AEB52217AE781273FD58 /* Frameworks */, - 664FA7FD427A041E2C3F5FC60BDD0429 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = SwiftString; - productName = SwiftString; - productReference = B9868DCD2DFC595D05DCF8C9754ED04A /* SwiftString.framework */; - productType = "com.apple.product-type.framework"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - D41D8CD98F00B204E9800998ECF8427E /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 0730; - LastUpgradeCheck = 0700; - }; - buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = 7DB346D0F39D3F0E887471402A8071AB; - productRefGroup = 797A83D88223AAC8D534C9B24FFBF4B7 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 1E52D24095854AC1AC66E0F97AF1C640 /* Pods-dsdsds */, - 288E6180BA164EDF520447AD4D7D33A7 /* SwiftString */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - A724CDAD71EC8379D9704E0148E72694 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 184FA68A1C5F32D668F41243BCB8DD32 /* Pods-dsdsds-dummy.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - E3C2DA07F10DB45A7F8B7E4D664CB518 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - D730318F68F578D9CDF88587CF9803B0 /* String+HTML.swift in Sources */, - 7C2221E2C150775D8316BE7D2FB4A299 /* StringExtensions.swift in Sources */, - 4488ABAB48AFA3B9D2420244C0F70BC6 /* SwiftString-dummy.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 6F977E5AEEACDC26F9D96C82A8F17479 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = SwiftString; - target = 288E6180BA164EDF520447AD4D7D33A7 /* SwiftString */; - targetProxy = A99491C3D0AA6022E3056852D2C9CD76 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin XCBuildConfiguration section */ - 3FA451D268613890FA8A5A03801E11D5 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = YES; - ENABLE_NS_ASSERTIONS = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_PREPROCESSOR_DEFINITIONS = ( - "POD_CONFIGURATION_RELEASE=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; - STRIP_INSTALLED_PRODUCT = NO; - SYMROOT = "${SRCROOT}/../build"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 5E62115DE8C09934BF8D2FE5D15FED1E /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "POD_CONFIGURATION_DEBUG=1", - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; - ONLY_ACTIVE_ARCH = YES; - STRIP_INSTALLED_PRODUCT = NO; - SYMROOT = "${SRCROOT}/../build"; - }; - name = Debug; - }; - 68F208879A606760046E3CA3491FE07B /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 011DE1D09BA47F59D9A31D3EDD91AE08 /* Pods-dsdsds.debug.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Target Support Files/Pods-dsdsds/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-dsdsds/Pods-dsdsds.modulemap"; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Pods_dsdsds; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - CA76DC3264DA5F3EF98B1004BEAAF19E /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = FB9A92C2A32CED37B6DB1777931FDBD7 /* Pods-dsdsds.release.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Target Support Files/Pods-dsdsds/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-dsdsds/Pods-dsdsds.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Pods_dsdsds; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - DBBBD67BC30C1736EBB5C211F6FD6360 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = B86B333A372E2962B8D4F1A9B7E3EECE /* SwiftString.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/SwiftString/SwiftString-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/SwiftString/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/SwiftString/SwiftString.modulemap"; - MTL_ENABLE_DEBUG_INFO = YES; - PRODUCT_NAME = SwiftString; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - FA9E60DA34742293F76FA64C80096772 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = B86B333A372E2962B8D4F1A9B7E3EECE /* SwiftString.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/SwiftString/SwiftString-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/SwiftString/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/SwiftString/SwiftString.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; - PRODUCT_NAME = SwiftString; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E62115DE8C09934BF8D2FE5D15FED1E /* Debug */, - 3FA451D268613890FA8A5A03801E11D5 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - AC23DA421FC5B510E707A45EF4F145D0 /* Build configuration list for PBXNativeTarget "SwiftString" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - DBBBD67BC30C1736EBB5C211F6FD6360 /* Debug */, - FA9E60DA34742293F76FA64C80096772 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - F32565FDCCCC86BF5BD1E6EC107652EB /* Build configuration list for PBXNativeTarget "Pods-dsdsds" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 68F208879A606760046E3CA3491FE07B /* Debug */, - CA76DC3264DA5F3EF98B1004BEAAF19E /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = D41D8CD98F00B204E9800998ECF8427E /* Project object */; -} diff --git a/Example/Pods/Target Support Files/Pods-dsdsds/Info.plist b/Example/Pods/Target Support Files/Pods-dsdsds/Info.plist deleted file mode 100644 index 2243fe6..0000000 --- a/Example/Pods/Target Support Files/Pods-dsdsds/Info.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - ${PRODUCT_BUNDLE_IDENTIFIER} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0.0 - CFBundleSignature - ???? - CFBundleVersion - ${CURRENT_PROJECT_VERSION} - NSPrincipalClass - - - diff --git a/Example/Pods/Target Support Files/Pods-dsdsds/Pods-dsdsds-acknowledgements.markdown b/Example/Pods/Target Support Files/Pods-dsdsds/Pods-dsdsds-acknowledgements.markdown deleted file mode 100644 index a51c0ff..0000000 --- a/Example/Pods/Target Support Files/Pods-dsdsds/Pods-dsdsds-acknowledgements.markdown +++ /dev/null @@ -1,26 +0,0 @@ -# Acknowledgements -This application makes use of the following third party libraries: - -## SwiftString - -Copyright (c) 2016 Andrew Mayne - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -Generated by CocoaPods - https://cocoapods.org diff --git a/Example/Pods/Target Support Files/Pods-dsdsds/Pods-dsdsds-acknowledgements.plist b/Example/Pods/Target Support Files/Pods-dsdsds/Pods-dsdsds-acknowledgements.plist deleted file mode 100644 index 7b4a4b0..0000000 --- a/Example/Pods/Target Support Files/Pods-dsdsds/Pods-dsdsds-acknowledgements.plist +++ /dev/null @@ -1,56 +0,0 @@ - - - - - PreferenceSpecifiers - - - FooterText - This application makes use of the following third party libraries: - Title - Acknowledgements - Type - PSGroupSpecifier - - - FooterText - Copyright (c) 2016 Andrew Mayne <andrew.c.mayne@gmail.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - - Title - SwiftString - Type - PSGroupSpecifier - - - FooterText - Generated by CocoaPods - https://cocoapods.org - Title - - Type - PSGroupSpecifier - - - StringsTable - Acknowledgements - Title - Acknowledgements - - diff --git a/Example/Pods/Target Support Files/Pods-dsdsds/Pods-dsdsds-dummy.m b/Example/Pods/Target Support Files/Pods-dsdsds/Pods-dsdsds-dummy.m deleted file mode 100644 index cedfe47..0000000 --- a/Example/Pods/Target Support Files/Pods-dsdsds/Pods-dsdsds-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_Pods_dsdsds : NSObject -@end -@implementation PodsDummy_Pods_dsdsds -@end diff --git a/Example/Pods/Target Support Files/Pods-dsdsds/Pods-dsdsds-frameworks.sh b/Example/Pods/Target Support Files/Pods-dsdsds/Pods-dsdsds-frameworks.sh deleted file mode 100755 index 695054a..0000000 --- a/Example/Pods/Target Support Files/Pods-dsdsds/Pods-dsdsds-frameworks.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/sh -set -e - -echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" -mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - -SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" - -install_framework() -{ - if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then - local source="${BUILT_PRODUCTS_DIR}/$1" - elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then - local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" - elif [ -r "$1" ]; then - local source="$1" - fi - - local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - - if [ -L "${source}" ]; then - echo "Symlinked..." - source="$(readlink "${source}")" - fi - - # use filter instead of exclude so missing patterns dont' throw errors - echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" - rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" - - local basename - basename="$(basename -s .framework "$1")" - binary="${destination}/${basename}.framework/${basename}" - if ! [ -r "$binary" ]; then - binary="${destination}/${basename}" - fi - - # Strip invalid architectures so "fat" simulator / device frameworks work on device - if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then - strip_invalid_archs "$binary" - fi - - # Resign the code if required by the build settings to avoid unstable apps - code_sign_if_enabled "${destination}/$(basename "$1")" - - # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. - if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then - local swift_runtime_libs - swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) - for lib in $swift_runtime_libs; do - echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" - rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" - code_sign_if_enabled "${destination}/${lib}" - done - fi -} - -# Signs a framework with the provided identity -code_sign_if_enabled() { - if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then - # Use the current code_sign_identitiy - echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" - echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\"" - /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1" - fi -} - -# Strip invalid architectures -strip_invalid_archs() { - binary="$1" - # Get architectures for current file - archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" - stripped="" - for arch in $archs; do - if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then - # Strip non-valid architectures in-place - lipo -remove "$arch" -output "$binary" "$binary" || exit 1 - stripped="$stripped $arch" - fi - done - if [[ "$stripped" ]]; then - echo "Stripped $binary of architectures:$stripped" - fi -} - - -if [[ "$CONFIGURATION" == "Debug" ]]; then - install_framework "$BUILT_PRODUCTS_DIR/SwiftString/SwiftString.framework" -fi -if [[ "$CONFIGURATION" == "Release" ]]; then - install_framework "$BUILT_PRODUCTS_DIR/SwiftString/SwiftString.framework" -fi diff --git a/Example/Pods/Target Support Files/Pods-dsdsds/Pods-dsdsds-resources.sh b/Example/Pods/Target Support Files/Pods-dsdsds/Pods-dsdsds-resources.sh deleted file mode 100755 index 0a15615..0000000 --- a/Example/Pods/Target Support Files/Pods-dsdsds/Pods-dsdsds-resources.sh +++ /dev/null @@ -1,102 +0,0 @@ -#!/bin/sh -set -e - -mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" - -RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt -> "$RESOURCES_TO_COPY" - -XCASSET_FILES=() - -case "${TARGETED_DEVICE_FAMILY}" in - 1,2) - TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" - ;; - 1) - TARGET_DEVICE_ARGS="--target-device iphone" - ;; - 2) - TARGET_DEVICE_ARGS="--target-device ipad" - ;; - *) - TARGET_DEVICE_ARGS="--target-device mac" - ;; -esac - -realpath() { - DIRECTORY="$(cd "${1%/*}" && pwd)" - FILENAME="${1##*/}" - echo "$DIRECTORY/$FILENAME" -} - -install_resource() -{ - if [[ "$1" = /* ]] ; then - RESOURCE_PATH="$1" - else - RESOURCE_PATH="${PODS_ROOT}/$1" - fi - if [[ ! -e "$RESOURCE_PATH" ]] ; then - cat << EOM -error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. -EOM - exit 1 - fi - case $RESOURCE_PATH in - *.storyboard) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" - ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} - ;; - *.xib) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" - ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} - ;; - *.framework) - echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - ;; - *.xcdatamodel) - echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" - xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" - ;; - *.xcdatamodeld) - echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" - xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" - ;; - *.xcmappingmodel) - echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" - xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" - ;; - *.xcassets) - ABSOLUTE_XCASSET_FILE=$(realpath "$RESOURCE_PATH") - XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") - ;; - *) - echo "$RESOURCE_PATH" - echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" - ;; - esac -} - -mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then - mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" - rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -fi -rm -f "$RESOURCES_TO_COPY" - -if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] -then - # Find all other xcassets (this unfortunately includes those of path pods and other targets). - OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) - while read line; do - if [[ $line != "`realpath $PODS_ROOT`*" ]]; then - XCASSET_FILES+=("$line") - fi - done <<<"$OTHER_XCASSETS" - - printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -fi diff --git a/Example/Pods/Target Support Files/Pods-dsdsds/Pods-dsdsds-umbrella.h b/Example/Pods/Target Support Files/Pods-dsdsds/Pods-dsdsds-umbrella.h deleted file mode 100644 index 917976b..0000000 --- a/Example/Pods/Target Support Files/Pods-dsdsds/Pods-dsdsds-umbrella.h +++ /dev/null @@ -1,6 +0,0 @@ -#import - - -FOUNDATION_EXPORT double Pods_dsdsdsVersionNumber; -FOUNDATION_EXPORT const unsigned char Pods_dsdsdsVersionString[]; - diff --git a/Example/Pods/Target Support Files/Pods-dsdsds/Pods-dsdsds.debug.xcconfig b/Example/Pods/Target Support Files/Pods-dsdsds/Pods-dsdsds.debug.xcconfig deleted file mode 100644 index f0931ed..0000000 --- a/Example/Pods/Target Support Files/Pods-dsdsds/Pods-dsdsds.debug.xcconfig +++ /dev/null @@ -1,10 +0,0 @@ -EMBEDDED_CONTENT_CONTAINS_SWIFT = YES -FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/SwiftString" -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' -OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/SwiftString/SwiftString.framework/Headers" -OTHER_LDFLAGS = $(inherited) -framework "SwiftString" -OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT}/Pods diff --git a/Example/Pods/Target Support Files/Pods-dsdsds/Pods-dsdsds.modulemap b/Example/Pods/Target Support Files/Pods-dsdsds/Pods-dsdsds.modulemap deleted file mode 100644 index 8fdfd3e..0000000 --- a/Example/Pods/Target Support Files/Pods-dsdsds/Pods-dsdsds.modulemap +++ /dev/null @@ -1,6 +0,0 @@ -framework module Pods_dsdsds { - umbrella header "Pods-dsdsds-umbrella.h" - - export * - module * { export * } -} diff --git a/Example/Pods/Target Support Files/Pods-dsdsds/Pods-dsdsds.release.xcconfig b/Example/Pods/Target Support Files/Pods-dsdsds/Pods-dsdsds.release.xcconfig deleted file mode 100644 index f0931ed..0000000 --- a/Example/Pods/Target Support Files/Pods-dsdsds/Pods-dsdsds.release.xcconfig +++ /dev/null @@ -1,10 +0,0 @@ -EMBEDDED_CONTENT_CONTAINS_SWIFT = YES -FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/SwiftString" -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' -OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/SwiftString/SwiftString.framework/Headers" -OTHER_LDFLAGS = $(inherited) -framework "SwiftString" -OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT}/Pods diff --git a/Example/Pods/Target Support Files/SwiftString/Info.plist b/Example/Pods/Target Support Files/SwiftString/Info.plist deleted file mode 100644 index 1c2e79e..0000000 --- a/Example/Pods/Target Support Files/SwiftString/Info.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - ${PRODUCT_BUNDLE_IDENTIFIER} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - FMWK - CFBundleShortVersionString - 0.5.1 - CFBundleSignature - ???? - CFBundleVersion - ${CURRENT_PROJECT_VERSION} - NSPrincipalClass - - - diff --git a/Example/Pods/Target Support Files/SwiftString/SwiftString-dummy.m b/Example/Pods/Target Support Files/SwiftString/SwiftString-dummy.m deleted file mode 100644 index 73892fa..0000000 --- a/Example/Pods/Target Support Files/SwiftString/SwiftString-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_SwiftString : NSObject -@end -@implementation PodsDummy_SwiftString -@end diff --git a/Example/Pods/Target Support Files/SwiftString/SwiftString-prefix.pch b/Example/Pods/Target Support Files/SwiftString/SwiftString-prefix.pch deleted file mode 100644 index aa992a4..0000000 --- a/Example/Pods/Target Support Files/SwiftString/SwiftString-prefix.pch +++ /dev/null @@ -1,4 +0,0 @@ -#ifdef __OBJC__ -#import -#endif - diff --git a/Example/Pods/Target Support Files/SwiftString/SwiftString-umbrella.h b/Example/Pods/Target Support Files/SwiftString/SwiftString-umbrella.h deleted file mode 100644 index 86b1c47..0000000 --- a/Example/Pods/Target Support Files/SwiftString/SwiftString-umbrella.h +++ /dev/null @@ -1,6 +0,0 @@ -#import - - -FOUNDATION_EXPORT double SwiftStringVersionNumber; -FOUNDATION_EXPORT const unsigned char SwiftStringVersionString[]; - diff --git a/Example/Pods/Target Support Files/SwiftString/SwiftString.modulemap b/Example/Pods/Target Support Files/SwiftString/SwiftString.modulemap deleted file mode 100644 index 3dd3244..0000000 --- a/Example/Pods/Target Support Files/SwiftString/SwiftString.modulemap +++ /dev/null @@ -1,6 +0,0 @@ -framework module SwiftString { - umbrella header "SwiftString-umbrella.h" - - export * - module * { export * } -} diff --git a/Example/Pods/Target Support Files/SwiftString/SwiftString.xcconfig b/Example/Pods/Target Support Files/SwiftString/SwiftString.xcconfig deleted file mode 100644 index 3879354..0000000 --- a/Example/Pods/Target Support Files/SwiftString/SwiftString.xcconfig +++ /dev/null @@ -1,9 +0,0 @@ -CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/SwiftString -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" -OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT} -PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} -SKIP_INSTALL = YES diff --git a/Pod/Classes/StringExtensions.swift b/Pod/Classes/StringExtensions.swift deleted file mode 100644 index e69de29..0000000 diff --git a/SwiftString.podspec b/SwiftString.podspec index ebca11e..e4a6d9d 100644 --- a/SwiftString.podspec +++ b/SwiftString.podspec @@ -15,5 +15,5 @@ Pod::Spec.new do |s| s.platform = :ios, '8.0' s.requires_arc = true - s.source_files = 'Pod/Classes/**/*' + s.source_files = 'Sources/*' end