Skip to content

Commit

Permalink
pod setup. unfixed error with xlinker
Browse files Browse the repository at this point in the history
  • Loading branch information
tomknig committed Jun 8, 2014
1 parent 9beafbd commit 2c67fbd
Show file tree
Hide file tree
Showing 22 changed files with 1,534 additions and 99 deletions.
67 changes: 67 additions & 0 deletions Classes/TOMSStringExtensions.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
//
// TOMSStringExtensions.swift
// TOMSMorphingLabel
//
// Created by Tom König on 08/06/14.
// Copyright (c) 2014 TomKnig. All rights reserved.
//

import Foundation

extension String {

func mergeIntoString(string: String, maxLookAhead: Int = 6) -> (mergedString: String, rangesOfAdditions: NSRange[], rangesOfDeletions: NSRange[]) {
var rangesOfAdditions = NSRange[]()
var rangesOfDeletions = NSRange[]()
var mergedString = ""
var range: NSRange
var idx = 0, startIndex = -1, endIndex = -1, insertions = 0

for ownChar in self {
var i = 0

for alienChar in string {
if (i++ < idx) {
continue
}

if (startIndex < 0) {
startIndex = idx
}

if ownChar == alienChar {
endIndex = i

mergedString += string.substringFromIndex(startIndex).substringToIndex(endIndex - startIndex)
idx = i
break
}

if (i - idx >= maxLookAhead) {
break
}
}

if (endIndex >= 0) {
if (endIndex - startIndex - 1 > 0) {
rangesOfDeletions += NSRange(location: startIndex + insertions, length: endIndex - startIndex - 1)
}
} else {
rangesOfAdditions += NSRange(location: countElements(mergedString), length: 1)
mergedString += ownChar
++insertions
}

startIndex = -1
endIndex = -1
}

let lengthOfAlienString = countElements(string)
if (idx < lengthOfAlienString) {
rangesOfDeletions += NSRange(location: countElements(mergedString), length: lengthOfAlienString - idx)
mergedString += string.substringFromIndex(idx).substringToIndex(lengthOfAlienString - idx)
}

return (mergedString, rangesOfAdditions, rangesOfDeletions)
}
}
14 changes: 14 additions & 0 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
PODS:
- TOMSMorphingLabel (0.1.0)

DEPENDENCIES:
- TOMSMorphingLabel (from `../`)

EXTERNAL SOURCES:
TOMSMorphingLabel:
:path: ../

SPEC CHECKSUMS:
TOMSMorphingLabel: f4eca92ecaa5743870564f362e74cb3187576457

COCOAPODS: 0.33.1
36 changes: 7 additions & 29 deletions Example/Pods/Local Podspecs/TOMSMorphingLabel.podspec

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

14 changes: 14 additions & 0 deletions Example/Pods/Manifest.lock

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

5 changes: 5 additions & 0 deletions Example/Pods/Pods-TOMSMorphingLabel-Private.xcconfig

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

5 changes: 5 additions & 0 deletions Example/Pods/Pods-TOMSMorphingLabel-dummy.m

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

5 changes: 5 additions & 0 deletions Example/Pods/Pods-TOMSMorphingLabel-prefix.pch

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

Empty file.
26 changes: 26 additions & 0 deletions Example/Pods/Pods-acknowledgements.markdown

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

56 changes: 56 additions & 0 deletions Example/Pods/Pods-acknowledgements.plist

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

5 changes: 5 additions & 0 deletions Example/Pods/Pods-dummy.m

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

14 changes: 14 additions & 0 deletions Example/Pods/Pods-environment.h

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

68 changes: 68 additions & 0 deletions Example/Pods/Pods-resources.sh

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

5 changes: 5 additions & 0 deletions Example/Pods/Pods.xcconfig

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

Loading

0 comments on commit 2c67fbd

Please sign in to comment.