Skip to content

Commit ab37752

Browse files
authored
Merge pull request #50 from funkenstrahlen/swift5
update to swift 5 and update project settings to xcode recommended settings
2 parents 54811b4 + ddc8e49 commit ab37752

File tree

8 files changed

+28
-14
lines changed

8 files changed

+28
-14
lines changed

.swift-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.0
1+
5.0

Example.xcodeproj/project.pbxproj

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@
349349
isa = PBXProject;
350350
attributes = {
351351
LastSwiftUpdateCheck = 0830;
352-
LastUpgradeCheck = 0920;
352+
LastUpgradeCheck = 1020;
353353
ORGANIZATIONNAME = "Rudd Fawcett";
354354
TargetAttributes = {
355355
504B6FFF1F21D051002F9D8E = {
@@ -376,7 +376,7 @@
376376
};
377377
buildConfigurationList = F1730EAF1DAEA6BE00E2BB0B /* Build configuration list for PBXProject "Example" */;
378378
compatibilityVersion = "Xcode 3.2";
379-
developmentRegion = English;
379+
developmentRegion = en;
380380
hasScannedForEncodings = 0;
381381
knownRegions = (
382382
en,
@@ -553,6 +553,7 @@
553553
PRODUCT_NAME = "$(TARGET_NAME)";
554554
SDKROOT = macosx;
555555
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
556+
SWIFT_VERSION = 5.0;
556557
};
557558
name = Debug;
558559
};
@@ -572,6 +573,7 @@
572573
PRODUCT_BUNDLE_IDENTIFIER = "com.ruddfawcett.Example-macOS";
573574
PRODUCT_NAME = "$(TARGET_NAME)";
574575
SDKROOT = macosx;
576+
SWIFT_VERSION = 5.0;
575577
};
576578
name = Release;
577579
};
@@ -598,6 +600,7 @@
598600
SDKROOT = macosx;
599601
SKIP_INSTALL = YES;
600602
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
603+
SWIFT_VERSION = 5.0;
601604
VERSIONING_SYSTEM = "apple-generic";
602605
VERSION_INFO_PREFIX = "";
603606
};
@@ -625,6 +628,7 @@
625628
PRODUCT_NAME = Notepad;
626629
SDKROOT = macosx;
627630
SKIP_INSTALL = YES;
631+
SWIFT_VERSION = 5.0;
628632
VERSIONING_SYSTEM = "apple-generic";
629633
VERSION_INFO_PREFIX = "";
630634
};
@@ -643,12 +647,14 @@
643647
CLANG_WARN_BOOL_CONVERSION = YES;
644648
CLANG_WARN_COMMA = YES;
645649
CLANG_WARN_CONSTANT_CONVERSION = YES;
650+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
646651
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
647652
CLANG_WARN_EMPTY_BODY = YES;
648653
CLANG_WARN_ENUM_CONVERSION = YES;
649654
CLANG_WARN_INFINITE_RECURSION = YES;
650655
CLANG_WARN_INT_CONVERSION = YES;
651656
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
657+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
652658
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
653659
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
654660
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -698,12 +704,14 @@
698704
CLANG_WARN_BOOL_CONVERSION = YES;
699705
CLANG_WARN_COMMA = YES;
700706
CLANG_WARN_CONSTANT_CONVERSION = YES;
707+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
701708
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
702709
CLANG_WARN_EMPTY_BODY = YES;
703710
CLANG_WARN_ENUM_CONVERSION = YES;
704711
CLANG_WARN_INFINITE_RECURSION = YES;
705712
CLANG_WARN_INT_CONVERSION = YES;
706713
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
714+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
707715
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
708716
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
709717
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -744,6 +752,7 @@
744752
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
745753
PRODUCT_BUNDLE_IDENTIFIER = com.ruddfawcett.Example;
746754
PRODUCT_NAME = "$(TARGET_NAME)";
755+
SWIFT_VERSION = 5.0;
747756
TARGETED_DEVICE_FAMILY = "1,2";
748757
};
749758
name = Debug;
@@ -758,6 +767,7 @@
758767
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
759768
PRODUCT_BUNDLE_IDENTIFIER = com.ruddfawcett.Example;
760769
PRODUCT_NAME = "$(TARGET_NAME)";
770+
SWIFT_VERSION = 5.0;
761771
TARGETED_DEVICE_FAMILY = "1,2";
762772
};
763773
name = Release;
@@ -781,6 +791,7 @@
781791
PRODUCT_NAME = "$(TARGET_NAME)";
782792
SKIP_INSTALL = YES;
783793
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
794+
SWIFT_VERSION = 5.0;
784795
VERSIONING_SYSTEM = "apple-generic";
785796
VERSION_INFO_PREFIX = "";
786797
};
@@ -804,6 +815,7 @@
804815
PRODUCT_BUNDLE_IDENTIFIER = com.ruddfawcett.Notepad;
805816
PRODUCT_NAME = "$(TARGET_NAME)";
806817
SKIP_INSTALL = YES;
818+
SWIFT_VERSION = 5.0;
807819
VERSIONING_SYSTEM = "apple-generic";
808820
VERSION_INFO_PREFIX = "";
809821
};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

Example.xcodeproj/xcshareddata/xcschemes/Notepad-macOS.xcscheme

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0920"
3+
LastUpgradeVersion = "1020"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,7 +26,6 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
language = ""
3029
shouldUseLaunchSchemeArgsEnv = "YES">
3130
<Testables>
3231
</Testables>
@@ -37,7 +36,6 @@
3736
buildConfiguration = "Debug"
3837
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
3938
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
40-
language = ""
4139
launchStyle = "0"
4240
useCustomWorkingDirectory = "NO"
4341
ignoresPersistentStateOnLaunch = "NO"

Example.xcodeproj/xcshareddata/xcschemes/Notepad.xcscheme

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0920"
3+
LastUpgradeVersion = "1020"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,7 +26,6 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
language = ""
3029
shouldUseLaunchSchemeArgsEnv = "YES">
3130
<Testables>
3231
</Testables>
@@ -37,7 +36,6 @@
3736
buildConfiguration = "Debug"
3837
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
3938
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
40-
language = ""
4139
launchStyle = "0"
4240
useCustomWorkingDirectory = "NO"
4341
ignoresPersistentStateOnLaunch = "NO"

Example/AppDelegate.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
1313

1414
var window: UIWindow?
1515

16-
17-
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
18-
// Override point for customization after application launch.
16+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
1917
return true
2018
}
2119

Example/ViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class ViewController: UIViewController {
2424
print(error)
2525
}
2626

27-
editor.textContainerInset = UIEdgeInsetsMake(40, 20, 40, 20)
27+
editor.textContainerInset = UIEdgeInsets(top: 40, left: 20, bottom: 40, right: 20)
2828
self.view.addSubview(editor)
2929
}
3030

Notepad/UniversalTypes.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
public typealias UniversalColor = UIColor
1212
public typealias UniversalFont = UIFont
1313
public typealias UniversalFontDescriptor = UIFontDescriptor
14-
public typealias UniversalTraits = UIFontDescriptorSymbolicTraits
14+
public typealias UniversalTraits = UIFontDescriptor.SymbolicTraits
1515
#elseif os(macOS)
1616
import AppKit
1717
public typealias UniversalColor = NSColor

0 commit comments

Comments
 (0)