Skip to content

Commit

Permalink
Fix consumption of fluentui-ios (built with Xcode 11) when building w…
Browse files Browse the repository at this point in the history
…ith Xcode 12 (microsoft#231)

* Minor fixes

* Fix swift-lint

* Use spaces instead of tabs

* More tabs to spaces

* Update comment
  • Loading branch information
anandrajeswaran authored Sep 16, 2020
1 parent 44206d2 commit 18bcef8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
8 changes: 7 additions & 1 deletion ios/FluentUI/Navigation/NavigationBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,18 @@ open class NavigationBarTopAccessoryViewAttributes: NSObject {
self.minWidth = minWidth
super.init()
}

public override init() {
self.widthMultiplier = 1.0
self.maxWidth = .greatestFiniteMagnitude
self.minWidth = .zero
}
}

/// Layout attributes for a navigation bar's top search bar.
@objc(MSFNavigationBarTopSearchBarAttributes)
open class NavigationBarTopSearchBarAttributes: NavigationBarTopAccessoryViewAttributes {
@objc public init() {
@objc public override init() {
super.init(widthMultiplier: Constants.widthMultiplier, maxWidth: Constants.viewMaxWidth, minWidth: Constants.viewMinWidth)
}

Expand Down
2 changes: 1 addition & 1 deletion ios/FluentUI/Popup Menu/PopupMenuController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ extension PopupMenuController: UITableViewDataSource {
let identifier = String(describing: cellClass)
tableView.register(cellClass, forCellReuseIdentifier: identifier)

let cell = tableView.dequeueReusableCell(withIdentifier: identifier) as! PopupMenuItemTemplateCell
let cell = tableView.dequeueReusableCell(withIdentifier: identifier) as! (PopupMenuItemTemplateCell & TableViewCell)
cell.setup(item: item)
cell.preservesSpaceForImage = itemsHaveImages

Expand Down
4 changes: 2 additions & 2 deletions ios/FluentUI/Popup Menu/PopupMenuProtocols.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ public protocol PopupMenuTemplateItem: AnyObject {
/**
`PopupMenuItemTemplateCell` represents a template cell protocol inside `PopupMenuController`.
The built-in type is `PopupMenuItemCell`.
You can use `UITableViewCell` conforms to this protocol for customization.
If you are making a custom object conform to this protocol, it must be a `UITableViewCell` for the Pop Up Menu to work properly
*/
@objc(MSFPopupMenuItemTemplateCell)
public protocol PopupMenuItemTemplateCell where Self: UITableViewCell {
public protocol PopupMenuItemTemplateCell {
/// `PopupMenuController` will notify that one or more items in the list contain image(s)
@objc var preservesSpaceForImage: Bool { get set }
/// `PopupMenuController` will notify the custom separatorColor.
Expand Down

0 comments on commit 18bcef8

Please sign in to comment.