Skip to content

Commit

Permalink
🎉 Xcode 8
Browse files Browse the repository at this point in the history
  • Loading branch information
qfish committed Nov 10, 2016
1 parent 080505e commit 33fc9c7
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 78 deletions.
85 changes: 18 additions & 67 deletions README.md
@@ -1,15 +1,15 @@
XAlign
XAlign (Ready for Xcode 8+ 🚀)
======

An amazing Xcode plugin to align regular code. It can align anything by using custom alignment patterns.

## What's XAlign

Here are some example alignment patterns. Of course you can make your own. The pattern file is here: `XAlign/patterns.plist`, and the patterns are based on regular expression.
Here are some example alignment patterns. Of course you can make your own. The pattern file is here: `/Source/Patterns.bundle/default.plist`, and the patterns are based on regular expression.

**Tips**:

* _You may not like the alignment style below, **try it yourself** or **tell me at the [[Issues]](https://github.com/qfish/XAlign/issues?state=open)**._ :)
* _You may not like the alignment style below, **try it yourself** or **tell me at the [Issues](https://github.com/qfish/XAlign/issues?state=open)**._ :)
* There is no need to align all codes at a time when they are complicated, try to align by group which the codes are more similar in.
* 对齐不需要一次全部对齐,可以分组多对几次,那些等号差的太远的就别让它参与对齐了。
* 默认对齐的风格不是你喜欢的,可以自定义,或者提个 [Issues](https://github.com/qfish/XAlign/issues?state=open)
Expand All @@ -27,74 +27,26 @@ Here are some example alignment patterns. Of course you can make your own. The p

- [x] Much easier to customize alignment patterns.

## Install & Update
## Install on Xcode 8
1. Download the [XAlign.dmg 📎](https://github.com/qfish/XAlign/releases/download/untagged-37425b5c3153fd315072/XAlign.1.0.dmg)
2. Open and copy `XAlign.app` to `/Applications` folder
3. Run it then close it.

### Via source

1. Clone this repo

2. Then build the `XAlign` target in the Xcode project and the plug-in will automatically be installed in `~/Library/Application Support/Developer/Shared/Xcode/Plug-ins`

3. Restart Xcode.

### Via command-line

```shell
curl -fsSL http://qfi.sh/XAlign/build/install.sh | sh
```

### Manually

1. Download this package [XAlign.tar.gz](http://qfi.sh/XAlign/build/XAlign.tar.gz)
2. Unpack it, copy or move the `XAlign.xcplugin` to the following path:
```
~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/
```
Tips: To quickly go to Finder type `Shift + Cmd + G`. If there is no `Plug-ins` directory, you should make one.
## Usage
### 1. Enable XAlign
Check <kbd>System Preferences</kbd> -> <kbd>Extensions</kbd> -> <kbd>Xocde Source Editor</kbd> -> <kbd>XAlign</kbd>

3. Restart Xcode.
![help-1](https://cloud.githubusercontent.com/assets/679824/20145614/b86f6742-a6db-11e6-846b-771447ec0933.png)

## Uninstall
```shell
curl -fsSL http://qfi.sh/XAlign/build/uninstall.sh | sh
```
### 2. Setting Shortcut in Xocde
<kbd>Preferences</kbd> -> <kbd>Key bindings</kbd> -> <kbd>Filter: xalign</kbd>

or Delete the following directory:
![help-2](https://cloud.githubusercontent.com/assets/679824/20146079/735244ca-a6dd-11e6-83a9-069fd489b0f6.png)

```
~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/XAlign.xcplugin
```
## Trouble Shooting
* Please `run sudo /usr/libexec/xpccachectl` and **restart your Mac** before running the extension if you are on macOS 10.11 El Capitan.
* If you are looking for the version supporting Xcode 7, check this branch;

## Usage
### In Xcode
```
Xcode -> Edit -> XAlign
```

### Auto Align Shortcut (default)
```
Shift + Cmd + X
```
You can choose the shortcut in the Settings panel, `Xcode -> Edit -> XAlign -> Setting`.

## Trouble-Shooting

* [wiki](https://github.com/qfish/XAlign/wiki)

### New version Xcode ? Try this in your terminal :

1. Get current Xcode UUID

```shell
XCODEUUID=`defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID`
```
2. Write it into the Plug-ins's plist

```shell
for f in ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/*; do defaults write "$f/Contents/Info" DVTPlugInCompatibilityUUIDs -array-add $XCODEUUID; done
```
3. Restart your Xcode, and select <kbd>Load Bundles</kbd> on the alert

## Want to help

* [Star this repository](https://github.com/qfish/XAlign/)
Expand All @@ -103,12 +55,11 @@ You can choose the shortcut in the Settings panel, `Xcode -> Edit -> XAlign -> S

## Special thanks to

* [![Geek-Zoo](http://geek-zoo.com/img/images/logo_2.png)](http://www.geek-zoo.com)
* <img src="http://geek-zoo.com/img/logo-dark.png" alt="Geek Zoo Studio" height="20px" /> <a href="http://www.geek-zoo.com" target="_blank">Geek Zoo Studio</a>

They provide awesome design and development works continues to help the open-source community even better.


* [BeeFramework](https://github.com/gavinkwoe/BeeFramework)

BeeFramework is a new generation of development framework which makes faster and easier app development, Build your app by geek's way.

2 changes: 0 additions & 2 deletions XAlign.xcodeproj/project.pbxproj
Expand Up @@ -19,7 +19,6 @@
E93E2AC21DCB914400F7BEA4 /* NSString+XAlign.m in Sources */ = {isa = PBXBuildFile; fileRef = E93E2ABF1DCB914400F7BEA4 /* NSString+XAlign.m */; };
E93E2AC31DCB914400F7BEA4 /* XAlignPattern.m in Sources */ = {isa = PBXBuildFile; fileRef = E93E2AC11DCB914400F7BEA4 /* XAlignPattern.m */; };
E93E2AC51DCB93FA00F7BEA4 /* Patterns.bundle in Resources */ = {isa = PBXBuildFile; fileRef = E93E2AC41DCB93FA00F7BEA4 /* Patterns.bundle */; };
E93E2AC61DCB93FA00F7BEA4 /* Patterns.bundle in Resources */ = {isa = PBXBuildFile; fileRef = E93E2AC41DCB93FA00F7BEA4 /* Patterns.bundle */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -268,7 +267,6 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
E93E2AC61DCB93FA00F7BEA4 /* Patterns.bundle in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
30 changes: 21 additions & 9 deletions XAlign/Base.lproj/Main.storyboard
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="11134" systemVersion="15F34" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS">
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="11542" systemVersion="16A323" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11134"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11542"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Application-->
Expand Down Expand Up @@ -653,7 +654,7 @@
<outlet property="delegate" destination="Voe-Tx-rLC" id="PrD-fu-P6m"/>
</connections>
</application>
<customObject id="Voe-Tx-rLC" customClass="AppDelegate" customModuleProvider=""/>
<customObject id="Voe-Tx-rLC" customClass="AppDelegate"/>
<customObject id="Ady-hI-5gd" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="75" y="0.0"/>
Expand All @@ -665,7 +666,7 @@
<window key="window" title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" showsToolbarButton="NO" visibleAtLaunch="NO" animationBehavior="default" id="IQv-IB-iLA">
<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="480" height="270"/>
<rect key="contentRect" x="196" y="240" width="232" height="115"/>
<rect key="screenRect" x="0.0" y="0.0" width="1680" height="1027"/>
</window>
<connections>
Expand All @@ -674,20 +675,31 @@
</windowController>
<customObject id="Oky-zY-oP4" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="75" y="250"/>
<point key="canvasLocation" x="-49" y="172.5"/>
</scene>
<!--View Controller-->
<scene sceneID="hIz-AP-VOD">
<objects>
<viewController id="XfG-lQ-9wD" customClass="ViewController" customModuleProvider="" sceneMemberID="viewController">
<viewController id="XfG-lQ-9wD" customClass="ViewController" sceneMemberID="viewController">
<view key="view" wantsLayer="YES" id="m2S-Jp-Qdl">
<rect key="frame" x="0.0" y="0.0" width="480" height="270"/>
<rect key="frame" x="0.0" y="0.0" width="232" height="144"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ZGh-qz-b10">
<rect key="frame" x="41" y="63" width="150" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Made by QFish with ❤️." id="d4S-YN-NQ8">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
</view>
</viewController>
<customObject id="rPt-NT-nkU" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="75" y="655"/>
<point key="canvasLocation" x="-49" y="444"/>
</scene>
</scenes>
</document>

0 comments on commit 33fc9c7

Please sign in to comment.