Skip to content

Commit 9d3a8ca

Browse files
authored
Merge pull request #25 from JanGorman/swift/4.2
Swift/4.2
2 parents affc1ad + 33f5c14 commit 9d3a8ca

File tree

6 files changed

+19
-23
lines changed

6 files changed

+19
-23
lines changed

.swift-version

-1
This file was deleted.

Example/SwiftMessageBarExample/SwiftMessageBarExample.xcodeproj/project.pbxproj

+3-5
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
TargetAttributes = {
135135
F2AB59081B28B3B3001DCC74 = {
136136
CreatedOnToolsVersion = 6.3.2;
137-
LastSwiftMigration = 0900;
137+
LastSwiftMigration = "";
138138
};
139139
};
140140
};
@@ -339,8 +339,7 @@
339339
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
340340
PRODUCT_BUNDLE_IDENTIFIER = "com.schnaub.$(PRODUCT_NAME:rfc1034identifier)";
341341
PRODUCT_NAME = "$(TARGET_NAME)";
342-
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
343-
SWIFT_VERSION = 4.0;
342+
SWIFT_VERSION = 4.2;
344343
};
345344
name = Debug;
346345
};
@@ -353,8 +352,7 @@
353352
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
354353
PRODUCT_BUNDLE_IDENTIFIER = "com.schnaub.$(PRODUCT_NAME:rfc1034identifier)";
355354
PRODUCT_NAME = "$(TARGET_NAME)";
356-
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
357-
SWIFT_VERSION = 4.0;
355+
SWIFT_VERSION = 4.2;
358356
};
359357
name = Release;
360358
};

SwiftMessageBar.podspec

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
Pod::Spec.new do |s|
22

3-
s.name = "SwiftMessageBar"
4-
s.version = "5.2.2"
5-
s.summary = "A Swift Message Bar"
3+
s.name = "SwiftMessageBar"
4+
s.version = "5.3.0"
5+
s.summary = "A Swift Message Bar"
6+
s.swift_version = '4.2'
67

78
s.description = <<-DESC
89
A longer description of SwiftMessageBar in Markdown format.

SwiftMessageBar.xcodeproj/project.pbxproj

+3-5
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@
149149
TargetAttributes = {
150150
F2AB58E11B28B33C001DCC74 = {
151151
CreatedOnToolsVersion = 6.3.2;
152-
LastSwiftMigration = 0900;
152+
LastSwiftMigration = 1000;
153153
};
154154
};
155155
};
@@ -335,8 +335,7 @@
335335
PRODUCT_NAME = "$(TARGET_NAME)";
336336
SKIP_INSTALL = YES;
337337
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
338-
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
339-
SWIFT_VERSION = 4.0;
338+
SWIFT_VERSION = 4.2;
340339
};
341340
name = Debug;
342341
};
@@ -356,8 +355,7 @@
356355
PRODUCT_BUNDLE_IDENTIFIER = "com.schnaub.$(PRODUCT_NAME:rfc1034identifier)";
357356
PRODUCT_NAME = "$(TARGET_NAME)";
358357
SKIP_INSTALL = YES;
359-
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
360-
SWIFT_VERSION = 4.0;
358+
SWIFT_VERSION = 4.2;
361359
};
362360
name = Release;
363361
};

SwiftMessageBar/Message.swift

+7-7
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,10 @@ final class Message: UIView {
108108
}
109109

110110
addConstraint(NSLayoutConstraint(item: iconImageView,
111-
attribute: NSLayoutAttribute.centerY,
112-
relatedBy: NSLayoutRelation.equal,
111+
attribute: .centerY,
112+
relatedBy: .equal,
113113
toItem: iconImageView.superview,
114-
attribute: NSLayoutAttribute.centerY,
114+
attribute: .centerY,
115115
multiplier: 1.0,
116116
constant: (topMargin - bottomMargin) / 2.0))
117117
}
@@ -131,7 +131,7 @@ final class Message: UIView {
131131
addSubview(titleLabel)
132132

133133
if let title = title {
134-
let attributes: [NSAttributedStringKey: Any] = [
134+
let attributes: [NSAttributedString.Key: Any] = [
135135
.font : titleFont,
136136
.foregroundColor: titleFontColor,
137137
.paragraphStyle: paragraphStyle
@@ -148,7 +148,7 @@ final class Message: UIView {
148148
addSubview(messageLabel)
149149

150150
if let message = message {
151-
let attributes: [NSAttributedStringKey: Any] = [
151+
let attributes: [NSAttributedString.Key: Any] = [
152152
.font : messageFont,
153153
.foregroundColor: messageFontColor,
154154
.paragraphStyle: paragraphStyle
@@ -180,7 +180,7 @@ final class Message: UIView {
180180

181181
var titleSize: CGSize {
182182
let boundedSize = CGSize(width: availableWidth, height: CGFloat.greatestFiniteMagnitude)
183-
let titleFontAttributes: [NSAttributedStringKey: Any] = [.font: titleFont]
183+
let titleFontAttributes: [NSAttributedString.Key: Any] = [.font: titleFont]
184184
if let size = title?.boundingRect(with: boundedSize,
185185
options: [.truncatesLastVisibleLine, .usesLineFragmentOrigin],
186186
attributes: titleFontAttributes, context: nil).size {
@@ -191,7 +191,7 @@ final class Message: UIView {
191191

192192
var messageSize: CGSize {
193193
let boundedSize = CGSize(width: availableWidth, height: CGFloat.greatestFiniteMagnitude)
194-
let titleFontAttributes: [NSAttributedStringKey: Any] = [.font: messageFont]
194+
let titleFontAttributes: [NSAttributedString.Key: Any] = [.font: messageFont]
195195
if let size = message?.boundingRect(with: boundedSize,
196196
options: [.truncatesLastVisibleLine, .usesLineFragmentOrigin],
197197
attributes: titleFontAttributes, context: nil).size {

SwiftMessageBar/SwiftMessageBar.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public final class SwiftMessageBar {
171171
let messageWindow = MessageWindow()
172172
messageWindow.frame = UIScreen.main.bounds
173173
messageWindow.isHidden = false
174-
messageWindow.windowLevel = UIWindowLevelNormal
174+
messageWindow.windowLevel = .normal
175175
messageWindow.backgroundColor = .clear
176176
messageWindow.messageBarController.statusBarHidden = config.isStatusBarHidden
177177
messageWindow.rootViewController = messageWindow.messageBarController
@@ -289,7 +289,7 @@ public final class SwiftMessageBar {
289289
}
290290

291291
messageWindow.messageBarView.addSubview(message)
292-
messageWindow.messageBarView.bringSubview(toFront: message)
292+
messageWindow.messageBarView.bringSubviewToFront(message)
293293
isMessageVisible = true
294294
message.configureSubviews()
295295
message.frame = CGRect(x: 0, y: -message.estimatedHeight, width: message.width, height: message.estimatedHeight)

0 commit comments

Comments
 (0)