Skip to content

Commit

Permalink
Merge pull request #103 from zenangst/improve/internals
Browse files Browse the repository at this point in the history
Update use of frameworks and other optimizations
  • Loading branch information
zenangst authored Sep 3, 2019
2 parents af71c65 + 2a6248c commit d9c40bf
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
osx_image: xcode10
osx_image: xcode10.3
language: objective-c

before_install:
Expand Down
14 changes: 14 additions & 0 deletions Gray.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

/* Begin PBXBuildFile section */
2AECAC775C01910CCBFAD88E /* libPods-Gray.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C02BDE925690A5BBA8E6D44 /* libPods-Gray.a */; };
BD07D667231869BD0087F4D4 /* OpaqueView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD07D666231869BD0087F4D4 /* OpaqueView.swift */; };
BD111046215CEB240002D537 /* Shell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD111045215CEB240002D537 /* Shell.swift */; };
BD1A5590219CA170003C7D98 /* DepedencyContainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD1A558F219CA170003C7D98 /* DepedencyContainer.swift */; };
BD1BA9BE215E68840052633B /* IconController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD1BA9BD215E68840052633B /* IconController.swift */; };
Expand Down Expand Up @@ -54,6 +55,7 @@
097E55585FC0FE0ACC791B9E /* Pods-Gray.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Gray.debug.xcconfig"; path = "Target Support Files/Pods-Gray/Pods-Gray.debug.xcconfig"; sourceTree = "<group>"; };
8925482688825713455FEF24 /* Pods-Gray.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Gray.release.xcconfig"; path = "Target Support Files/Pods-Gray/Pods-Gray.release.xcconfig"; sourceTree = "<group>"; };
9C02BDE925690A5BBA8E6D44 /* libPods-Gray.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Gray.a"; sourceTree = BUILT_PRODUCTS_DIR; };
BD07D666231869BD0087F4D4 /* OpaqueView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OpaqueView.swift; sourceTree = "<group>"; };
BD111045215CEB240002D537 /* Shell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Shell.swift; sourceTree = "<group>"; };
BD1A558F219CA170003C7D98 /* DepedencyContainer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DepedencyContainer.swift; sourceTree = "<group>"; };
BD1BA9BD215E68840052633B /* IconController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IconController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -131,6 +133,14 @@
name = Frameworks;
sourceTree = "<group>";
};
BD07D665231869B10087F4D4 /* Views */ = {
isa = PBXGroup;
children = (
BD07D666231869BD0087F4D4 /* OpaqueView.swift */,
);
path = Views;
sourceTree = "<group>";
};
BD111047215CEB8E0002D537 /* Sources */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -195,6 +205,7 @@
BD30ED4B216C010400FD2D91 /* Features */ = {
isa = PBXGroup;
children = (
BD07D665231869B10087F4D4 /* Views */,
BD9D3D79215C2D3F00233333 /* Applications */,
BD987B2822418BB500783BE6 /* Export */,
BD299EB62242148200098B39 /* Import */,
Expand Down Expand Up @@ -519,6 +530,7 @@
BDE5736D2210A9850065597B /* UserDefaults.swift in Sources */,
BD9F0C4C2166773300608FD9 /* SystemPreferenceView.swift in Sources */,
BD987B2A22418BBF00783BE6 /* ExportController.swift in Sources */,
BD07D667231869BD0087F4D4 /* OpaqueView.swift in Sources */,
BDE573682210A2CB0065597B /* AppearanceAware.swift in Sources */,
BD9F0C43216675F300608FD9 /* SystemPreferenceFeatureViewController.swift in Sources */,
BD23492F220744330047F910 /* StatefulItem-macOS.generated.swift in Sources */,
Expand Down Expand Up @@ -674,6 +686,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 0.14.0;
PRODUCT_BUNDLE_IDENTIFIER = com.zenangst.Gray;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.2;
Expand All @@ -695,6 +708,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 0.14.0;
PRODUCT_BUNDLE_IDENTIFIER = com.zenangst.Gray;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.2;
Expand Down
8 changes: 4 additions & 4 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
PODS:
- Blueprints (0.12.0)
- Differific (0.8.2)
- Family (0.20.0)
- Sourcery (0.16.2)
- Family (0.20.6)
- Sourcery (0.17.0)
- UserInterface (0.5.0)

DEPENDENCIES:
Expand All @@ -23,8 +23,8 @@ SPEC REPOS:
SPEC CHECKSUMS:
Blueprints: 45e43bc69f0969967ba462772acdabe196095389
Differific: c3840b9e4d1ee2216b2c0054c270e4a616df9327
Family: 486ecd0bcc8fa1cb8ab73dfc5c04ad94fa48d919
Sourcery: 3f406d227efd179773b3c3599ebd1700d1a6013c
Family: cae19a87ce580920b8d3bba49e38da8ab64b3c69
Sourcery: 3ed61be7c8a1218fce349266139379dba477efe0
UserInterface: 54e15db9aceaec2b9686d00f471adb15d2598ea3

PODFILE CHECKSUM: 9a4a4208e8595d7fa51cbc758521284dec9359cc
Expand Down
2 changes: 1 addition & 1 deletion Resources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.13.0</string>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSApplicationCategoryType</key>
Expand Down
10 changes: 2 additions & 8 deletions Sources/Features/Applications/ApplicationGridView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,11 @@ protocol ApplicationGridViewDelegate: class {

// sourcery: let application = Application
class ApplicationGridView: NSCollectionViewItem, CollectionViewItemComponent, AppearanceAware {
lazy var baseView = NSView()
lazy var baseView = OpaqueView()
weak var delegate: ApplicationGridViewDelegate?

// sourcery: currentAppearance = model.application.appearance
var currentAppearance: Application.Appearance? {
didSet {
if let currentAppearance = self.currentAppearance {
update(with: currentAppearance)
}
}
}
var currentAppearance: Application.Appearance?

// sourcery: $RawBinding = "iconStore.loadIcon(for: model.application) { image in view.iconView.image = image }"
lazy var iconView = NSImageView()
Expand Down
10 changes: 2 additions & 8 deletions Sources/Features/Applications/ApplicationListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,11 @@ protocol ApplicationListViewDelegate: class {

// sourcery: let application = Application
class ApplicationListView: NSCollectionViewItem, CollectionViewItemComponent, AppearanceAware {
let baseView = NSView()
let baseView = OpaqueView()
weak var delegate: ApplicationListViewDelegate?

// sourcery: currentAppearance = model.application.appearance
var currentAppearance: Application.Appearance? {
didSet {
if let currentAppearance = self.currentAppearance {
update(with: currentAppearance)
}
}
}
var currentAppearance: Application.Appearance?

// sourcery: $RawBinding = "iconStore.loadIcon(for: model.application) { image in view.iconView.image = image }"
lazy var iconView: NSImageView = .init()
Expand Down
27 changes: 13 additions & 14 deletions Sources/Features/Main/MainContainerViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,21 @@ class MainContainerViewController: FamilyViewController,
applicationsViewController.delegate = self
preferencesViewController.delegate = self

addChild(importLabelController)
addChild(loadingLabelController)
addChild(preferencesViewController)
addChild(applicationsViewController)

performBatchUpdates({ _ in
body {
add(importLabelController)
add(loadingLabelController)
add(preferencesViewController)
add(applicationsViewController)
loadingLabelController.view.frame.size.height = 120
}, completion: nil)
}

loadingLabelController.view.enclosingScrollView?.drawsBackground = true
}

private func performSearch(with string: String) {
let header = applicationsViewController.component.collectionView.supplementaryView(forElementKind: NSCollectionView.elementKindSectionHeader, at: IndexPath(item: 0, section: 0)) as? CollectionViewHeader

performBatchUpdates({ controller in
body {
switch string.count > 0 {
case false:
preferencesViewController.component.collectionView.animator().alphaValue = 1.0
Expand All @@ -58,17 +57,17 @@ class MainContainerViewController: FamilyViewController,
applicationsViewController.performSearch(with: string)
header?.setText("Search results: \(string)")
}
}, completion: nil)
}
}

// MARK: - ImportControllerDelegate

func importController(_ controller: ImportController, didStartImport: Bool, settingsCount: Int) {
importLabelController.view.alphaValue = 0.0
performBatchUpdates({ (_) in
body {
importLabelController.view.frame.size.height = 75
importLabelController.view.animator().alphaValue = 1.0
}, completion: nil)
}
}

func importController(_ controller: ImportController,
Expand All @@ -80,9 +79,9 @@ class MainContainerViewController: FamilyViewController,
}

func importController(_ controller: ImportController, didFinishImport: Bool, settingsCount: Int) {
performBatchUpdates({ (_) in
body {
importLabelController.view.animator().alphaValue = 0.0
}, completion: nil)
}
applicationsViewController.logicController.load()
}

Expand All @@ -99,7 +98,7 @@ class MainContainerViewController: FamilyViewController,
UserDefaults.standard.featureViewControllerMode = mode
applicationsViewController.mode = mode
applicationsViewController.removeFromParent()
addChild(applicationsViewController)
add(applicationsViewController)
}

// MARK: - ApplicationCollectionViewControllerDelegate
Expand Down
5 changes: 5 additions & 0 deletions Sources/Features/Views/OpaqueView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Cocoa

class OpaqueView: NSView {
override var isOpaque: Bool { return true }
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated using Sourcery 0.16.2 — https://github.com/krzysztofzablocki/Sourcery
// Generated using Sourcery 0.17.0 — https://github.com/krzysztofzablocki/Sourcery
// DO NOT EDIT

import Cocoa
Expand Down
2 changes: 1 addition & 1 deletion Voodoo/Output/StatefulItem-macOS.generated.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated using Sourcery 0.16.2 — https://github.com/krzysztofzablocki/Sourcery
// Generated using Sourcery 0.17.0 — https://github.com/krzysztofzablocki/Sourcery
// DO NOT EDIT

import Cocoa
Expand Down
2 changes: 1 addition & 1 deletion Voodoo/Output/ViewControllerFactory-macOS.generated.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated using Sourcery 0.16.2 — https://github.com/krzysztofzablocki/Sourcery
// Generated using Sourcery 0.17.0 — https://github.com/krzysztofzablocki/Sourcery
// DO NOT EDIT

import Cocoa
Expand Down

0 comments on commit d9c40bf

Please sign in to comment.