Skip to content

Commit

Permalink
Fix rebase for swift3
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Baranes committed Aug 11, 2016
1 parent 48d077a commit ddb1f21
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15G31" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11191" systemVersion="15G31" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10117"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11191"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
Expand Down
15 changes: 10 additions & 5 deletions Sources/AdaptiveSpaceItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ public class AdaptiveSpaceItem: NSToolbarItem {

private func minSize() -> NSSize {
let items = toolbar?.items
let index = items?.indexOf(self)
let index = items?.index(of: self)
guard let unwrappedIndex = index,
unwrappedItems = items,
superviewFrame = view?.superview?.frame where superviewFrame.origin.x > 0 else {
let unwrappedItems = items,
let superviewFrame = view?.superview?.frame, superviewFrame.origin.x > 0 else {
return minSize
}

Expand Down Expand Up @@ -84,12 +84,17 @@ class AdaptiveSpaceItemView: NSView {

// MARK: - Life cycle

override func awakeFromNib() {
super.awakeFromNib()
adaptiveSpaceItem?.updateWidth()
}

override func viewDidMoveToWindow() {
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(windowDidResize), name: NSWindowDidResizeNotification, object: self.window)
NotificationCenter.default.addObserver(self, selector: #selector(windowDidResize), name: NSNotification.Name.NSWindowDidResize, object: self.window)
}

deinit {
NSNotificationCenter.defaultCenter().removeObserver(self)
NotificationCenter.default.removeObserver(self)
}

// MARK: - Notifications
Expand Down

0 comments on commit ddb1f21

Please sign in to comment.