Skip to content
Permalink
Browse files

Update syntax and project to Swift 4.

  • Loading branch information...
frankrausch committed Nov 5, 2017
1 parent 3bca0e2 commit c86439d8e80046c297f20dd5b08b6db3fcf83d1f
@@ -307,7 +307,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0830;
LastUpgradeCheck = 0830;
LastUpgradeCheck = 0910;
ORGANIZATIONNAME = "Frank Rausch";
TargetAttributes = {
275F69AE1FA0D9E0009F9BE7 = {
@@ -327,11 +327,12 @@
};
BF3D89121ECDCBD000E1AC1B = {
CreatedOnToolsVersion = 8.3.2;
LastSwiftMigration = 0910;
ProvisioningStyle = Manual;
};
BF3D89211ECDCC8100E1AC1B = {
CreatedOnToolsVersion = 8.3.2;
LastSwiftMigration = 0830;
LastSwiftMigration = 0910;
ProvisioningStyle = Manual;
};
};
@@ -465,6 +466,7 @@
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
@@ -501,6 +503,7 @@
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
@@ -682,15 +685,21 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -731,15 +740,21 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -773,7 +788,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.raureif.TypographizerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
@@ -787,7 +802,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.raureif.TypographizerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
};
name = Release;
};
@@ -814,7 +829,7 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
@@ -842,7 +857,7 @@
PRODUCT_NAME = Typographizer;
PROVISIONING_PROFILE_SPECIFIER = "";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0830"
LastUpgradeVersion = "0910"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="12120" systemVersion="16E195" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS">
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="13529" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="12120"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="13529"/>
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
@@ -671,6 +671,9 @@
<rect key="contentRect" x="196" y="240" width="600" height="400"/>
<rect key="screenRect" x="0.0" y="0.0" width="1680" height="1027"/>
<value key="minSize" type="size" width="600" height="400"/>
<connections>
<outlet property="delegate" destination="B8D-0N-5wS" id="GWi-6z-sY7"/>
</connections>
</window>
<connections>
<segue destination="XfG-lQ-9wD" kind="relationship" relationship="window.shadowedContentViewController" id="cq2-FE-JQM"/>
@@ -694,7 +697,7 @@
<rect key="frame" x="1" y="1" width="298" height="374"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textView importsGraphics="NO" richText="NO" findStyle="panel" allowsUndo="YES" usesRuler="YES" allowsNonContiguousLayout="YES" id="q5N-RU-lBE">
<textView importsGraphics="NO" richText="NO" verticallyResizable="YES" findStyle="panel" allowsUndo="YES" usesRuler="YES" allowsNonContiguousLayout="YES" id="q5N-RU-lBE">
<rect key="frame" x="0.0" y="-0.5" width="298" height="374"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
@@ -720,7 +723,7 @@
<rect key="frame" x="1" y="1" width="298" height="374"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textView editable="NO" importsGraphics="NO" richText="NO" usesFontPanel="YES" findStyle="panel" allowsUndo="YES" usesRuler="YES" allowsNonContiguousLayout="YES" id="l4H-i9-tOW">
<textView editable="NO" importsGraphics="NO" richText="NO" verticallyResizable="YES" usesFontPanel="YES" findStyle="panel" allowsUndo="YES" usesRuler="YES" allowsNonContiguousLayout="YES" id="l4H-i9-tOW">
<rect key="frame" x="0.0" y="-0.5" width="298" height="374"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" name="windowBackgroundColor" catalog="System" colorSpace="catalog"/>
@@ -771,7 +774,7 @@
<action selector="htmlCheckboxDidChange:" target="XfG-lQ-9wD" id="r4u-iQ-vMf"/>
</connections>
</button>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="NO" translatesAutoresizingMaskIntoConstraints="NO" id="aa8-7W-hH8">
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="aa8-7W-hH8">
<rect key="frame" x="454" y="5" width="68" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Language:" id="BD1-xm-fG2">
<font key="font" metaFont="system"/>
@@ -28,6 +28,27 @@
remoteGlobalIDString = BF3D89131ECDCBD000E1AC1B;
remoteInfo = TypographizerTests;
};
2760EA461FAF89C000DAB2F6 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 2743A5271ECF3409007B030B /* Typographizer.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 275F69AF1FA0D9E0009F9BE7;
remoteInfo = "Typographizer-iOS";
};
2760EA481FAF89C000DAB2F6 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 2743A5271ECF3409007B030B /* Typographizer.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 275F69C51FA0DB3E009F9BE7;
remoteInfo = "Typographizer-watchOS";
};
2760EA4A1FAF89C000DAB2F6 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 2743A5271ECF3409007B030B /* Typographizer.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 275F69D21FA0DB69009F9BE7;
remoteInfo = "Typographizer-tvOS";
};
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
@@ -55,6 +76,9 @@
isa = PBXGroup;
children = (
2743A52D1ECF3409007B030B /* Typographizer.framework */,
2760EA471FAF89C000DAB2F6 /* Typographizer.framework */,
2760EA491FAF89C000DAB2F6 /* Typographizer.framework */,
2760EA4B1FAF89C000DAB2F6 /* Typographizer.framework */,
2743A52F1ECF3409007B030B /* TypographizerTests.xctest */,
);
name = Products;
@@ -115,13 +139,13 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0820;
LastUpgradeCheck = 0820;
LastUpgradeCheck = 0910;
ORGANIZATIONNAME = "Frank Rausch";
TargetAttributes = {
2778DEBD1E79AFB2001078C0 = {
CreatedOnToolsVersion = 8.2.1;
DevelopmentTeam = 9KYFX28EJA;
LastSwiftMigration = 0830;
LastSwiftMigration = 0910;
ProvisioningStyle = Automatic;
};
};
@@ -165,6 +189,27 @@
remoteRef = 2743A52E1ECF3409007B030B /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
2760EA471FAF89C000DAB2F6 /* Typographizer.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = Typographizer.framework;
remoteRef = 2760EA461FAF89C000DAB2F6 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
2760EA491FAF89C000DAB2F6 /* Typographizer.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = Typographizer.framework;
remoteRef = 2760EA481FAF89C000DAB2F6 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
2760EA4B1FAF89C000DAB2F6 /* Typographizer.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = Typographizer.framework;
remoteRef = 2760EA4A1FAF89C000DAB2F6 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy section */

/* Begin PBXResourcesBuildPhase section */
@@ -211,15 +256,21 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -260,15 +311,21 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -305,7 +362,8 @@
PRODUCT_BUNDLE_IDENTIFIER = com.frankrausch.TypographizerDemo;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
@@ -321,7 +379,8 @@
MACOSX_DEPLOYMENT_TARGET = 10.11;
PRODUCT_BUNDLE_IDENTIFIER = com.frankrausch.TypographizerDemo;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
};
name = Release;
};
@@ -70,12 +70,12 @@ class ViewController: NSViewController, NSTextViewDelegate {
}

private func refresh() {
var s: String = self.beforeTextView.string!
var s: String = self.beforeTextView.string

let language = self.languageCodePopUpButton.titleOfSelectedItem ?? "en"
let isHTML: Bool = self.htmlCheckbox.state == 1
let debug: Bool = self.debugCheckbox.state == 1
let measurePerformance: Bool = self.measurePerformanceCheckbox.state == 1
let isHTML: Bool = self.htmlCheckbox.state == .on
let debug: Bool = self.debugCheckbox.state == .on
let measurePerformance: Bool = self.measurePerformanceCheckbox.state == .on

// This is where the magic happens:
s = s.typographized(language: language, isHTML: isHTML, debug: debug, measurePerformance: measurePerformance)

0 comments on commit c86439d

Please sign in to comment.
You can’t perform that action at this time.