Skip to content

Commit 3829347

Browse files
committed
compatible swift4.2
1 parent 7081b4c commit 3829347

4 files changed

Lines changed: 20 additions & 8 deletions

File tree

Example/GrowingTextView.xcodeproj/project.pbxproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,7 @@
469469
ONLY_ACTIVE_ARCH = YES;
470470
SDKROOT = iphoneos;
471471
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
472+
SWIFT_VERSION = 4.2;
472473
};
473474
name = Debug;
474475
};
@@ -516,6 +517,7 @@
516517
MTL_ENABLE_DEBUG_INFO = NO;
517518
SDKROOT = iphoneos;
518519
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
520+
SWIFT_VERSION = 4.2;
519521
VALIDATE_PRODUCT = YES;
520522
};
521523
name = Release;
@@ -537,7 +539,7 @@
537539
PRODUCT_NAME = "$(TARGET_NAME)";
538540
PROVISIONING_PROFILE_SPECIFIER = "";
539541
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
540-
SWIFT_VERSION = 4.0;
542+
SWIFT_VERSION = 4.2;
541543
};
542544
name = Debug;
543545
};
@@ -558,7 +560,7 @@
558560
PRODUCT_NAME = "$(TARGET_NAME)";
559561
PROVISIONING_PROFILE_SPECIFIER = "";
560562
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
561-
SWIFT_VERSION = 4.0;
563+
SWIFT_VERSION = 4.2;
562564
};
563565
name = Release;
564566
};

Example/Pods/Pods.xcodeproj/project.pbxproj

Lines changed: 4 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.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist

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

Pod/Classes/GrowingTextView.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,16 @@ open class GrowingTextView: UITextView {
5757
private func commonInit() {
5858
contentMode = .redraw
5959
associateConstraints()
60-
NotificationCenter.default.addObserver(self, selector: #selector(textDidChange), name: .UITextViewTextDidChange, object: self)
61-
NotificationCenter.default.addObserver(self, selector: #selector(textDidEndEditing), name: .UITextViewTextDidEndEditing, object: self)
60+
NotificationCenter.default.addObserver(self, selector: #selector(textDidChange), name: UITextView.textDidChangeNotification, object: self)
61+
NotificationCenter.default.addObserver(self, selector: #selector(textDidEndEditing), name: UITextView.textDidEndEditingNotification, object: self)
6262
}
6363

6464
deinit {
6565
NotificationCenter.default.removeObserver(self)
6666
}
6767

6868
open override var intrinsicContentSize: CGSize {
69-
return CGSize(width: UIViewNoIntrinsicMetric, height: 30)
69+
return CGSize(width: UIView.noIntrinsicMetric, height: 30)
7070
}
7171

7272
private func associateConstraints() {
@@ -153,7 +153,7 @@ open class GrowingTextView: UITextView {
153153
// Otherwise user placeholder and inherit `text` attributes
154154
let paragraphStyle = NSMutableParagraphStyle()
155155
paragraphStyle.alignment = textAlignment
156-
var attributes: [NSAttributedStringKey: Any] = [
156+
var attributes: [NSAttributedString.Key: Any] = [
157157
.foregroundColor: placeholderColor,
158158
.paragraphStyle: paragraphStyle
159159
]

0 commit comments

Comments
 (0)