Skip to content

Commit

Permalink
Merge pull request #25 from JanGorman/swift/4.2
Browse files Browse the repository at this point in the history
Swift/4.2
  • Loading branch information
JanGorman authored Sep 20, 2018
2 parents affc1ad + 33f5c14 commit 9d3a8ca
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 23 deletions.
1 change: 0 additions & 1 deletion .swift-version

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
TargetAttributes = {
F2AB59081B28B3B3001DCC74 = {
CreatedOnToolsVersion = 6.3.2;
LastSwiftMigration = 0900;
LastSwiftMigration = "";
};
};
};
Expand Down Expand Up @@ -339,8 +339,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.schnaub.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -353,8 +352,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.schnaub.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand Down
7 changes: 4 additions & 3 deletions SwiftMessageBar.podspec
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
Pod::Spec.new do |s|

s.name = "SwiftMessageBar"
s.version = "5.2.2"
s.summary = "A Swift Message Bar"
s.name = "SwiftMessageBar"
s.version = "5.3.0"
s.summary = "A Swift Message Bar"
s.swift_version = '4.2'

s.description = <<-DESC
A longer description of SwiftMessageBar in Markdown format.
Expand Down
8 changes: 3 additions & 5 deletions SwiftMessageBar.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
TargetAttributes = {
F2AB58E11B28B33C001DCC74 = {
CreatedOnToolsVersion = 6.3.2;
LastSwiftMigration = 0900;
LastSwiftMigration = 1000;
};
};
};
Expand Down Expand Up @@ -335,8 +335,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -356,8 +355,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.schnaub.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand Down
14 changes: 7 additions & 7 deletions SwiftMessageBar/Message.swift
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ final class Message: UIView {
}

addConstraint(NSLayoutConstraint(item: iconImageView,
attribute: NSLayoutAttribute.centerY,
relatedBy: NSLayoutRelation.equal,
attribute: .centerY,
relatedBy: .equal,
toItem: iconImageView.superview,
attribute: NSLayoutAttribute.centerY,
attribute: .centerY,
multiplier: 1.0,
constant: (topMargin - bottomMargin) / 2.0))
}
Expand All @@ -131,7 +131,7 @@ final class Message: UIView {
addSubview(titleLabel)

if let title = title {
let attributes: [NSAttributedStringKey: Any] = [
let attributes: [NSAttributedString.Key: Any] = [
.font : titleFont,
.foregroundColor: titleFontColor,
.paragraphStyle: paragraphStyle
Expand All @@ -148,7 +148,7 @@ final class Message: UIView {
addSubview(messageLabel)

if let message = message {
let attributes: [NSAttributedStringKey: Any] = [
let attributes: [NSAttributedString.Key: Any] = [
.font : messageFont,
.foregroundColor: messageFontColor,
.paragraphStyle: paragraphStyle
Expand Down Expand Up @@ -180,7 +180,7 @@ final class Message: UIView {

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

var messageSize: CGSize {
let boundedSize = CGSize(width: availableWidth, height: CGFloat.greatestFiniteMagnitude)
let titleFontAttributes: [NSAttributedStringKey: Any] = [.font: messageFont]
let titleFontAttributes: [NSAttributedString.Key: Any] = [.font: messageFont]
if let size = message?.boundingRect(with: boundedSize,
options: [.truncatesLastVisibleLine, .usesLineFragmentOrigin],
attributes: titleFontAttributes, context: nil).size {
Expand Down
4 changes: 2 additions & 2 deletions SwiftMessageBar/SwiftMessageBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public final class SwiftMessageBar {
let messageWindow = MessageWindow()
messageWindow.frame = UIScreen.main.bounds
messageWindow.isHidden = false
messageWindow.windowLevel = UIWindowLevelNormal
messageWindow.windowLevel = .normal
messageWindow.backgroundColor = .clear
messageWindow.messageBarController.statusBarHidden = config.isStatusBarHidden
messageWindow.rootViewController = messageWindow.messageBarController
Expand Down Expand Up @@ -289,7 +289,7 @@ public final class SwiftMessageBar {
}

messageWindow.messageBarView.addSubview(message)
messageWindow.messageBarView.bringSubview(toFront: message)
messageWindow.messageBarView.bringSubviewToFront(message)
isMessageVisible = true
message.configureSubviews()
message.frame = CGRect(x: 0, y: -message.estimatedHeight, width: message.width, height: message.estimatedHeight)
Expand Down

0 comments on commit 9d3a8ca

Please sign in to comment.