Skip to content
This repository has been archived by the owner on Oct 11, 2021. It is now read-only.

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Makeeyaf committed May 12, 2019
0 parents commit 33122ff
Show file tree
Hide file tree
Showing 41 changed files with 3,407 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.DS_Store
build/
release/
Pods/
xcode-settings-sync/Environment.swift
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2019 Makeeyaf

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.
10 changes: 10 additions & 0 deletions Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'Xcode Sync' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
# use_frameworks!
pod 'Alamofire', '4.8.2'
# Pods for xcode-settings-sync

end
16 changes: 16 additions & 0 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
PODS:
- Alamofire (4.8.2)

DEPENDENCIES:
- Alamofire (= 4.8.2)

SPEC REPOS:
https://github.com/cocoapods/specs.git:
- Alamofire

SPEC CHECKSUMS:
Alamofire: ae5c501addb7afdbb13687d7f2f722c78734c2d3

PODFILE CHECKSUM: 26167d78d6d6a8b934847fa256a60f5d3eda7668

COCOAPODS: 1.6.1
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<p align="center">
<img src="https://github.com/Makeeyaf/Xcode-Sync/blob/master/xcode-settings-sync/Assets.xcassets/AppIcon.appiconset/mac_appicon-256%401x.png" />
</p>

<h1 align="center">Xcode Sync</h1>

<p align="center">Sync themes, snippets and template of Xcode via Gist</p>

<p align=center>
<a href="https://github.com/Makeeyaf/Xcode-Sync/releases">Download</a>
</p>

---

## Installation
1. [Download latest Xcode-Sync.zip](https://github.com/Makeeyaf/Xcode-Sync/releases)
1. Unzip the downloaded zip file.
1. Move Xcode Sync.app into your Application directory.

## License
[MIT License](https://github.com/Makeeyaf/Xcode-Sync/blob/master/LICENSE)
44 changes: 44 additions & 0 deletions XcodeSyncLauncher/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Copyright © 2019 Makeeyaf. All rights reserved

import Cocoa

@NSApplicationMain
class AppDelegate: NSObject {

@objc func terminate() {
NSApp.terminate(nil)
}
}

extension AppDelegate: NSApplicationDelegate {

func applicationDidFinishLaunching(_ aNotification: Notification) {

let mainAppIdentifier = "io.github.makeeyaf.xcode-sync"
let runningApps = NSWorkspace.shared.runningApplications
let isRunning = !runningApps.filter { $0.bundleIdentifier == mainAppIdentifier }.isEmpty

if !isRunning {
DistributedNotificationCenter.default().addObserver(self,
selector: #selector(self.terminate),
name: Notification.Name("killXcodeSyncLauncher"),
object: mainAppIdentifier)

let path = Bundle.main.bundlePath as NSString
var components = path.pathComponents
components.removeLast()
components.removeLast()
components.removeLast()
components.append("MacOS")
components.append("Xcode Sync") //main app name

let newPath = NSString.path(withComponents: components)

NSWorkspace.shared.launchApplication(newPath)
}
else {
self.terminate()
}
}
}

58 changes: 58 additions & 0 deletions XcodeSyncLauncher/Assets.xcassets/AppIcon.appiconset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"images" : [
{
"idiom" : "mac",
"size" : "16x16",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "16x16",
"scale" : "2x"
},
{
"idiom" : "mac",
"size" : "32x32",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "32x32",
"scale" : "2x"
},
{
"idiom" : "mac",
"size" : "128x128",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "128x128",
"scale" : "2x"
},
{
"idiom" : "mac",
"size" : "256x256",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "256x256",
"scale" : "2x"
},
{
"idiom" : "mac",
"size" : "512x512",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "512x512",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
6 changes: 6 additions & 0 deletions XcodeSyncLauncher/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading

0 comments on commit 33122ff

Please sign in to comment.