Skip to content

Commit 761212d

Browse files
committed
Added support to Swift version 3.0 instead of 4.0
1 parent 49eb584 commit 761212d

File tree

9 files changed

+56
-56
lines changed

9 files changed

+56
-56
lines changed

.swift-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4
1+
3.0

Example/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PODS:
2-
- VSTwitterTextCounter (0.1.0)
2+
- VSTwitterTextCounter (0.1.1)
33

44
DEPENDENCIES:
55
- VSTwitterTextCounter (from `../`)
@@ -9,7 +9,7 @@ EXTERNAL SOURCES:
99
:path: ../
1010

1111
SPEC CHECKSUMS:
12-
VSTwitterTextCounter: 0a647c15f256a10011bbbd4b626fc2f5fc2e792e
12+
VSTwitterTextCounter: 75cada993b08664870fdc068c6c1b6394e13dc40
1313

1414
PODFILE CHECKSUM: 614e557836642184f62a4b9c504e1fc4d815b8ce
1515

Example/Pods/Local Podspecs/VSTwitterTextCounter.podspec.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/Pods/Manifest.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/Pods/Pods.xcodeproj/project.pbxproj

Lines changed: 38 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/Pods/Target Support Files/VSTwitterTextCounter/Info.plist

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/VSTwitterTextCounter.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@
527527
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
528528
PRODUCT_NAME = "$(TARGET_NAME)";
529529
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
530-
SWIFT_VERSION = 4.0;
530+
SWIFT_VERSION = 3.0;
531531
};
532532
name = Debug;
533533
};
@@ -546,7 +546,7 @@
546546
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
547547
PRODUCT_NAME = "$(TARGET_NAME)";
548548
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
549-
SWIFT_VERSION = 4.0;
549+
SWIFT_VERSION = 3.0;
550550
};
551551
name = Release;
552552
};

VSTwitterTextCounter.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'VSTwitterTextCounter'
3-
s.version = '0.1.0'
3+
s.version = '0.1.1'
44
s.license = { :type => 'MIT', :file => 'LICENSE' }
55
s.platform = :ios, "8.0"
66
s.ios.deployment_target = '8.0'

VSTwitterTextCounter/Classes/VSTwitterTextCounter.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -373,15 +373,15 @@ public class VSTwitterTextCounter: UIControl
373373
let okString = objcString.substring(to: lastAllowedCharacterIndex)
374374
let overflowingString = objcString.substring(from: lastAllowedCharacterIndex)
375375

376-
let attributedString = NSMutableAttributedString(string: okString, attributes: [.font: textView.font!])
376+
let attributedString = NSMutableAttributedString(string: okString, attributes: [NSFontAttributeName: textView.font!])
377377

378-
attributedString.append(NSAttributedString(string: overflowingString, attributes: [.backgroundColor: VSTwitterTextCounter.OVERFLOWING_TEXT_BACKGROUND, .font: textView.font!]))
378+
attributedString.append(NSAttributedString(string: overflowingString, attributes: [NSBackgroundColorAttributeName: VSTwitterTextCounter.OVERFLOWING_TEXT_BACKGROUND, NSFontAttributeName: textView.font!]))
379379

380380
textView.attributedText = attributedString
381381
}
382382
else // Reset any kind of formatting
383383
{
384-
textView.attributedText = NSAttributedString(string: textView.text, attributes: [.font: textView.font!]) // Resets any kind of attributes
384+
textView.attributedText = NSAttributedString(string: textView.text, attributes: [NSFontAttributeName: textView.font!]) // Resets any kind of attributes
385385
}
386386

387387
// Reapply the range
@@ -439,10 +439,10 @@ public class VSTwitterTextCounter: UIControl
439439
paragraphStyle.alignment = .right
440440

441441
let textFontAttributes = [
442-
.font: font,
443-
.foregroundColor: textColor,
444-
.paragraphStyle: paragraphStyle
445-
] as [NSAttributedStringKey: Any]
442+
NSFontAttributeName: font,
443+
NSForegroundColorAttributeName: textColor,
444+
NSParagraphStyleAttributeName: paragraphStyle
445+
]
446446

447447
let options: NSStringDrawingOptions = [.usesLineFragmentOrigin]
448448

0 commit comments

Comments
 (0)