Skip to content

Commit

Permalink
Add Launch on Login
Browse files Browse the repository at this point in the history
  • Loading branch information
LinusSkucas committed Nov 26, 2021
1 parent 2cb7244 commit 9d2a2e9
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 1 deletion.
53 changes: 53 additions & 0 deletions SLAM.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
1551EB4E274F4BC400A0BFA2 /* Persistance.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1551EB4D274F4BC400A0BFA2 /* Persistance.swift */; };
1551EB54274F4E2500A0BFA2 /* Song+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1551EB53274F4E2500A0BFA2 /* Song+CoreDataProperties.swift */; };
1551EB56274F734200A0BFA2 /* SongList.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1551EB55274F734200A0BFA2 /* SongList.swift */; };
1551EB592750583300A0BFA2 /* LaunchAtLogin in Frameworks */ = {isa = PBXBuildFile; productRef = 1551EB582750583300A0BFA2 /* LaunchAtLogin */; };
1551EB742750A9D600A0BFA2 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 1551EB732750A9D500A0BFA2 /* Credits.rtf */; };
15F9A0FC274F164400ECAD62 /* IntroViewInstruction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15F9A0FB274F164400ECAD62 /* IntroViewInstruction.swift */; };
/* End PBXBuildFile section */

Expand All @@ -32,6 +34,7 @@
1551EB4D274F4BC400A0BFA2 /* Persistance.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Persistance.swift; sourceTree = "<group>"; };
1551EB53274F4E2500A0BFA2 /* Song+CoreDataProperties.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Song+CoreDataProperties.swift"; sourceTree = "<group>"; };
1551EB55274F734200A0BFA2 /* SongList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SongList.swift; sourceTree = "<group>"; };
1551EB732750A9D500A0BFA2 /* Credits.rtf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.rtf; path = Credits.rtf; sourceTree = "<group>"; };
15F9A0FB274F164400ECAD62 /* IntroViewInstruction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IntroViewInstruction.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand All @@ -40,6 +43,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
1551EB592750583300A0BFA2 /* LaunchAtLogin in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -65,6 +69,7 @@
1533FB712748A61200C6527A /* SLAM */ = {
isa = PBXGroup;
children = (
1551EB732750A9D500A0BFA2 /* Credits.rtf */,
1533FB832749F8A800C6527A /* Info.plist */,
1533FB722748A61200C6527A /* SLAMApp.swift */,
1551EB55274F734200A0BFA2 /* SongList.swift */,
Expand Down Expand Up @@ -99,12 +104,16 @@
1533FB6B2748A61200C6527A /* Sources */,
1533FB6C2748A61200C6527A /* Frameworks */,
1533FB6D2748A61200C6527A /* Resources */,
1551EB5A2750585000A0BFA2 /* Copy "Launch at Login Helper" */,
);
buildRules = (
);
dependencies = (
);
name = SLAM;
packageProductDependencies = (
1551EB582750583300A0BFA2 /* LaunchAtLogin */,
);
productName = SLAM;
productReference = 1533FB6F2748A61200C6527A /* SLAM.app */;
productType = "com.apple.product-type.application";
Expand Down Expand Up @@ -133,6 +142,9 @@
Base,
);
mainGroup = 1533FB662748A61200C6527A;
packageReferences = (
1551EB572750583200A0BFA2 /* XCRemoteSwiftPackageReference "LaunchAtLogin" */,
);
productRefGroup = 1533FB702748A61200C6527A /* Products */;
projectDirPath = "";
projectRoot = "";
Expand All @@ -148,12 +160,34 @@
buildActionMask = 2147483647;
files = (
1533FB7A2748A61600C6527A /* Preview Assets.xcassets in Resources */,
1551EB742750A9D600A0BFA2 /* Credits.rtf in Resources */,
1533FB772748A61600C6527A /* Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
1551EB5A2750585000A0BFA2 /* Copy "Launch at Login Helper" */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = "Copy \"Launch at Login Helper\"";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "# Type a script or drag a script file from your workspace to insert its path.\n\"${BUILT_PRODUCTS_DIR}/LaunchAtLogin_LaunchAtLogin.bundle/Contents/Resources/copy-helper-swiftpm.sh\"\n";
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
1533FB6B2748A61200C6527A /* Sources */ = {
isa = PBXSourcesBuildPhase;
Expand Down Expand Up @@ -371,6 +405,25 @@
};
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
1551EB572750583200A0BFA2 /* XCRemoteSwiftPackageReference "LaunchAtLogin" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/sindresorhus/LaunchAtLogin";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 4.0.0;
};
};
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
1551EB582750583300A0BFA2 /* LaunchAtLogin */ = {
isa = XCSwiftPackageProductDependency;
package = 1551EB572750583200A0BFA2 /* XCRemoteSwiftPackageReference "LaunchAtLogin" */;
productName = LaunchAtLogin;
};
/* End XCSwiftPackageProductDependency section */

/* Begin XCVersionGroup section */
1551EB26274F493900A0BFA2 /* SLAM.xcdatamodeld */ = {
isa = XCVersionGroup;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"object": {
"pins": [
{
"package": "LaunchAtLogin",
"repositoryURL": "https://github.com/sindresorhus/LaunchAtLogin",
"state": {
"branch": null,
"revision": "e8171b3e38a2816f579f58f3dac1522aa39efe41",
"version": "4.2.0"
}
}
]
},
"version": 1
}
34 changes: 34 additions & 0 deletions SLAM/Credits.rtf
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{\rtf1\ansi\ansicpg1252\cocoartf2636
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fnil\fcharset0 SFPro-Regular;}
{\colortbl;\red255\green255\blue255;\red33\green254\blue6;\red0\green0\blue254;}
{\*\expandedcolortbl;;\csgenericrgb\c12941\c99608\c2353;\csgenericrgb\c0\c0\c99608;}
{\info
{\author Linus Skucas}}\margl1440\margr1440\margb1800\margt1800\viewkind1
\deftab720
\pard\pardeftab720\pardirnatural\qc\partightenfactor0

\f0\fs24 \cf0 Developer:\
\cf2 Linus Skucas\
\pard\pardeftab720\pardirnatural\qc\partightenfactor0
{\field{\*\fldinst{HYPERLINK "https://linus.sh"}}{\fldrslt \cf3 \ul \ulc3 linus.sh}}\cf0 \
\
App Icon:\
??\
\pard\pardeftab720\pardirnatural\partightenfactor0
\cf0 \
Credits:\
\pard\pardeftab720\pardirnatural\partightenfactor0
{\field{\*\fldinst{HYPERLINK "https://github.com/sindresorhus/LaunchAtLogin"}}{\fldrslt \cf3 \ul \ulc3 LaunchAtLogin}}\
\
\pard\pardeftab720\pardirnatural\partightenfactor0

\fs14 \cf0 MIT License\
\
Copyright (c) Sindre Sorhus <[email protected]> (sindresorhus.com)\
\
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\
\
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\
\
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\
}
3 changes: 2 additions & 1 deletion SLAM/IntroView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import SwiftUI
import AVFoundation

import LaunchAtLogin

struct IntroView: View {
@State private var step: IntroStep = .welcome
Expand All @@ -27,6 +27,7 @@ struct IntroView: View {
AVCaptureDevice.requestAccess(for: .audio) { granted in
guard granted else { fatalError("Did not agree") }
step = .instructions
LaunchAtLogin.isEnabled = true
}
}
.padding()
Expand Down
2 changes: 2 additions & 0 deletions SLAM/SongList.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import SwiftUI
import LaunchAtLogin

struct SongList: View {
@Environment(\.managedObjectContext) var viewContext
Expand Down Expand Up @@ -94,6 +95,7 @@ struct SongList: View {
}
}
}
LaunchAtLogin.Toggle()
}
}
}
Expand Down

0 comments on commit 9d2a2e9

Please sign in to comment.