Skip to content

Commit dbf4d38

Browse files
committed
Remove ImplicitlyUnwrappedOptional to be compatible with Swift 5
1 parent 03238b8 commit dbf4d38

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

Source/BTNavigationDropdownMenu.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ open class BTNavigationDropdownMenu: UIView {
294294
titleToDisplay = title
295295
}
296296

297-
titleSize = (titleToDisplay as NSString).size(withAttributes: [NSAttributedString.Key.font:self.configuration.navigationBarTitleFont])
297+
titleSize = (titleToDisplay as NSString).size(withAttributes: [NSAttributedString.Key.font: self.configuration.navigationBarTitleFont])
298298

299299
// Set frame
300300
let frame = CGRect(x: 0, y: 0, width: titleSize.width + (self.configuration.arrowPadding + self.configuration.arrowImage.size.width)*2, height: self.navigationController!.navigationBar.frame.height)

Source/Internal/BTConfiguration.swift

+5-9
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ final class BTConfiguration {
3131
var cellTextLabelColor: UIColor?
3232
var selectedCellTextLabelColor: UIColor?
3333
var cellTextLabelFont: UIFont!
34-
var navigationBarTitleFont: UIFont!
34+
var navigationBarTitleFont: UIFont
3535
var cellTextLabelAlignment: NSTextAlignment!
3636
var cellSelectionColor: UIColor?
3737
var checkMarkImage: UIImage!
@@ -45,27 +45,23 @@ final class BTConfiguration {
4545
var shouldChangeTitleText: Bool!
4646

4747
init() {
48-
self.defaultValue()
49-
}
50-
51-
func defaultValue() {
5248
// Path for image
5349
let bundle = Bundle(for: BTConfiguration.self)
5450
let url = bundle.url(forResource: "BTNavigationDropdownMenu", withExtension: "bundle")
5551
let imageBundle = Bundle(url: url!)
5652
let checkMarkImagePath = imageBundle?.path(forResource: "checkmark_icon", ofType: "png")
5753
let arrowImagePath = imageBundle?.path(forResource: "arrow_down_icon", ofType: "png")
58-
59-
// Default values
54+
55+
// Set default values
6056
self.menuTitleColor = UIColor.darkGray
6157
self.cellHeight = 50
6258
self.cellBackgroundColor = UIColor.white
6359
self.arrowTintColor = UIColor.white
6460
self.cellSeparatorColor = UIColor.darkGray
6561
self.cellTextLabelColor = UIColor.darkGray
6662
self.selectedCellTextLabelColor = UIColor.darkGray
67-
self.cellTextLabelFont = UIFont(name: "HelveticaNeue-Bold", size: 17)
68-
self.navigationBarTitleFont = UIFont(name: "HelveticaNeue-Bold", size: 17)
63+
self.cellTextLabelFont = UIFont.systemFont(ofSize: 17, weight: .bold)
64+
self.navigationBarTitleFont = UIFont.systemFont(ofSize: 17, weight: .bold)
6965
self.cellTextLabelAlignment = NSTextAlignment.left
7066
self.cellSelectionColor = UIColor.lightGray
7167
self.checkMarkImage = UIImage(contentsOfFile: checkMarkImagePath!)

0 commit comments

Comments
 (0)