Skip to content

Commit

Permalink
build fixed for app store settings.
Browse files Browse the repository at this point in the history
  • Loading branch information
markohlebar committed Sep 30, 2018
1 parent bcd78ba commit db45b41
Show file tree
Hide file tree
Showing 10 changed files with 62 additions and 36 deletions.
12 changes: 8 additions & 4 deletions Import.xcodeproj/project.pbxproj
Expand Up @@ -17,8 +17,9 @@
9624F56A1DA43CBD005B57F4 /* SourceEditorExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9624F5691DA43CBD005B57F4 /* SourceEditorExtension.swift */; };
9624F56C1DA43CBD005B57F4 /* SourceEditorCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9624F56B1DA43CBD005B57F4 /* SourceEditorCommand.swift */; };
9624F5701DA43CBD005B57F4 /* ImportExtension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 9624F5621DA43CBD005B57F4 /* ImportExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
96514D1B1DA532CC0061F17B /* usage.mov in Resources */ = {isa = PBXBuildFile; fileRef = 96514D1A1DA532CC0061F17B /* usage.mov */; };
965BF2721DA4F3DF00A43900 /* Default.idekeybindings in Resources */ = {isa = PBXBuildFile; fileRef = 965BF2711DA4F3DF00A43900 /* Default.idekeybindings */; };
96A47E7B215CDF860016E62D /* installation.mp4 in Resources */ = {isa = PBXBuildFile; fileRef = 96A47E79215CDF860016E62D /* installation.mp4 */; };
96A47E7C215CDF860016E62D /* usage.mp4 in Resources */ = {isa = PBXBuildFile; fileRef = 96A47E7A215CDF860016E62D /* usage.mp4 */; };
96BFA7D71DA4B9CE005B37E2 /* AddImportOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96BFA7D61DA4B9CE005B37E2 /* AddImportOperation.swift */; };
96E7A0F61DA4E82C0069F088 /* RootWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96E7A0F41DA4E82C0069F088 /* RootWindowController.swift */; };
96E7A0F71DA4E82C0069F088 /* RootWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 96E7A0F51DA4E82C0069F088 /* RootWindowController.xib */; };
Expand Down Expand Up @@ -76,8 +77,9 @@
9624F5691DA43CBD005B57F4 /* SourceEditorExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SourceEditorExtension.swift; sourceTree = "<group>"; };
9624F56B1DA43CBD005B57F4 /* SourceEditorCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SourceEditorCommand.swift; sourceTree = "<group>"; };
9624F56D1DA43CBD005B57F4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
96514D1A1DA532CC0061F17B /* usage.mov */ = {isa = PBXFileReference; lastKnownFileType = video.quicktime; path = usage.mov; sourceTree = "<group>"; };
965BF2711DA4F3DF00A43900 /* Default.idekeybindings */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = Default.idekeybindings; sourceTree = "<group>"; };
96A47E79215CDF860016E62D /* installation.mp4 */ = {isa = PBXFileReference; lastKnownFileType = file; path = installation.mp4; sourceTree = "<group>"; };
96A47E7A215CDF860016E62D /* usage.mp4 */ = {isa = PBXFileReference; lastKnownFileType = file; path = usage.mp4; sourceTree = "<group>"; };
96BFA7D61DA4B9CE005B37E2 /* AddImportOperation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AddImportOperation.swift; sourceTree = "<group>"; };
96E7A0F41DA4E82C0069F088 /* RootWindowController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = RootWindowController.swift; path = Windows/RootWindowController.swift; sourceTree = "<group>"; };
96E7A0F51DA4E82C0069F088 /* RootWindowController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = RootWindowController.xib; path = Windows/RootWindowController.xib; sourceTree = "<group>"; };
Expand Down Expand Up @@ -190,8 +192,9 @@
965BF2701DA4F3DF00A43900 /* Resources */ = {
isa = PBXGroup;
children = (
96A47E79215CDF860016E62D /* installation.mp4 */,
96A47E7A215CDF860016E62D /* usage.mp4 */,
961F64411DB67A6F00F7E05A /* open_system_preferences.scpt */,
96514D1A1DA532CC0061F17B /* usage.mov */,
965BF2711DA4F3DF00A43900 /* Default.idekeybindings */,
);
path = Resources;
Expand Down Expand Up @@ -341,11 +344,12 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
96514D1B1DA532CC0061F17B /* usage.mov in Resources */,
96A47E7B215CDF860016E62D /* installation.mp4 in Resources */,
961F64421DB67A6F00F7E05A /* open_system_preferences.scpt in Resources */,
96F9FF631DEED081009A0AE6 /* RootWindowController_Sandbox.xib in Resources */,
96E7A0F71DA4E82C0069F088 /* RootWindowController.xib in Resources */,
9624F5461DA43C9B005B57F4 /* Assets.xcassets in Resources */,
96A47E7C215CDF860016E62D /* usage.mp4 in Resources */,
965BF2721DA4F3DF00A43900 /* Default.idekeybindings in Resources */,
9624F5491DA43C9B005B57F4 /* MainMenu.xib in Resources */,
);
Expand Down
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Expand Up @@ -26,7 +26,6 @@
buildConfiguration = "Debug AppStore"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
Expand All @@ -46,7 +45,6 @@
buildConfiguration = "Debug AppStore"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
4 changes: 2 additions & 2 deletions Import/Info.plist
Expand Up @@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.7</string>
<string>1.0.8</string>
<key>CFBundleVersion</key>
<string>10</string>
<string>11</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSMinimumSystemVersion</key>
Expand Down
23 changes: 18 additions & 5 deletions Import/Windows/RootWindowController.swift
Expand Up @@ -13,7 +13,8 @@ import AVKit
fileprivate enum Resources {
static let keyBindingsPath = "/Library/Developer/Xcode/UserData/KeyBindings/Default.idekeybindings"
static let systemPrefsScript = (name: "open_system_preferences", extension:"scpt")
static let usageMovie = (name: "usage", extension: "mov")
static let usageMovie = (name: "usage", extension: "mp4")
static let installationMovie = (name: "installation", extension: "mp4")
}

class RootWindowController: NSWindowController {
Expand All @@ -29,6 +30,15 @@ class RootWindowController: NSWindowController {
inserter.insertBindings()
}

@IBAction func switchInstructions(_ sender: NSSegmentedControl) {
playItem(atUrl: movieUrl(for: sender.selectedSegment))
}

func movieUrl(for segment: Int) -> URL {
let file = segment == 0 ? Resources.installationMovie : Resources.usageMovie
return Bundle.main.url(forResource: file.name, withExtension: file.extension)!
}

@IBAction func openSystemPreferences(_ sender: AnyObject) {
let file = Resources.systemPrefsScript
let url = Bundle.main.url(forResource: file.name, withExtension: file.extension)!
Expand All @@ -39,14 +49,17 @@ class RootWindowController: NSWindowController {
override func windowDidLoad() {
super.windowDidLoad()

let file = Resources.usageMovie
let url = Bundle.main.url(forResource: file.name, withExtension: file.extension)!
let url = movieUrl(for: 0)
playItem(atUrl: url);
}

func playItem(atUrl url: URL) {
let player = AVPlayer(url: url)
player.actionAtItemEnd = .none
player.play()

playerView.player = player

NotificationCenter.default.addObserver(self,
selector: #selector(loop(with:)),
name: Notification.Name.AVPlayerItemDidPlayToEndTime,
Expand Down
47 changes: 25 additions & 22 deletions Import/Windows/RootWindowController_Sandbox.xib
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11542" systemVersion="16C41b" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14313.18" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.AVKitIBPlugin" version="11542"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11542"/>
<plugIn identifier="com.apple.AVKitIBPlugin" version="14313.18"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14313.18"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
Expand All @@ -15,40 +15,43 @@
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<window title="Import ☝️" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" animationBehavior="default" id="F0z-JX-Cv5">
<window title="Import ☝️" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="F0z-JX-Cv5">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="196" y="240" width="456" height="385"/>
<rect key="screenRect" x="0.0" y="0.0" width="1280" height="777"/>
<value key="minSize" type="size" width="456" height="385"/>
<value key="maxSize" type="size" width="456" height="385"/>
<view key="contentView" wantsLayer="YES" id="se5-gp-TjO">
<rect key="frame" x="0.0" y="0.0" width="456" height="385"/>
<view key="contentView" wantsLayer="YES" misplaced="YES" id="se5-gp-TjO">
<rect key="frame" x="0.0" y="0.0" width="1020" height="621"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="VOL-kt-VV6" userLabel="Install Key Bindings">
<rect key="frame" x="14" y="337" width="428" height="32"/>
<buttonCell key="cell" type="push" title="Install Key Bindings (⌘ + ctrl + P)" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="wn8-lI-Bpu">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="installKeyBindings:" target="-2" id="KTN-gj-mhJ"/>
</connections>
</button>
<avPlayerView controlsStyle="none" translatesAutoresizingMaskIntoConstraints="NO" id="8ZN-wE-bYO">
<rect key="frame" x="20" y="20" width="416" height="304"/>
<rect key="frame" x="20" y="20" width="960" height="540"/>
<constraints>
<constraint firstAttribute="width" constant="416" id="8TS-7d-Ywn"/>
<constraint firstAttribute="height" constant="304" id="gei-zp-aMm"/>
<constraint firstAttribute="width" constant="960" id="8TS-7d-Ywn"/>
<constraint firstAttribute="height" constant="540" id="gei-zp-aMm"/>
</constraints>
</avPlayerView>
<segmentedControl verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="2Fg-CS-ulZ">
<rect key="frame" x="359" y="578" width="282" height="24"/>
<segmentedCell key="cell" borderStyle="border" alignment="left" style="rounded" trackingMode="selectOne" id="S3a-rK-9zm">
<font key="font" metaFont="system"/>
<segments>
<segment label="Install Key Bindings" width="138" selected="YES"/>
<segment label="Usage" width="137" tag="1"/>
</segments>
</segmentedCell>
<connections>
<action selector="switchInstructions:" target="-2" id="4wx-nt-h80"/>
</connections>
</segmentedControl>
</subviews>
<constraints>
<constraint firstItem="VOL-kt-VV6" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" constant="20" id="1ak-9G-DyU"/>
<constraint firstItem="8ZN-wE-bYO" firstAttribute="top" secondItem="VOL-kt-VV6" secondAttribute="bottom" constant="20" id="Cd4-jC-FQp"/>
<constraint firstItem="2Fg-CS-ulZ" firstAttribute="centerX" secondItem="se5-gp-TjO" secondAttribute="centerX" id="3T8-a0-LlD"/>
<constraint firstItem="2Fg-CS-ulZ" firstAttribute="top" secondItem="se5-gp-TjO" secondAttribute="top" constant="20" id="9fL-c0-mFP"/>
<constraint firstAttribute="trailing" secondItem="8ZN-wE-bYO" secondAttribute="trailing" constant="20" id="Emr-WE-EcG"/>
<constraint firstAttribute="trailing" secondItem="VOL-kt-VV6" secondAttribute="trailing" constant="20" id="MhM-sz-pPZ"/>
<constraint firstItem="8ZN-wE-bYO" firstAttribute="top" secondItem="2Fg-CS-ulZ" secondAttribute="bottom" constant="20" id="Gej-xh-vBK"/>
<constraint firstAttribute="bottom" secondItem="8ZN-wE-bYO" secondAttribute="bottom" constant="20" id="f5i-yk-gps"/>
<constraint firstItem="8ZN-wE-bYO" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" constant="20" id="mQA-gw-gXj"/>
</constraints>
Expand Down
2 changes: 1 addition & 1 deletion ImportTests/ImportTests.swift
Expand Up @@ -15,7 +15,7 @@ class ImportTests: XCTestCase {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}

override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
Expand Down
Binary file added Resources/installation.mp4
Binary file not shown.
Binary file removed Resources/usage.mov
Binary file not shown.
Binary file added Resources/usage.mp4
Binary file not shown.

0 comments on commit db45b41

Please sign in to comment.