Skip to content
Permalink
Browse files

Support for Xcode 10, iOS 12, tvOS 12, macOS 10.14 (Mojave) and Swift…

… 5 (#80)

* Update Ruby dependencies

* Migrate iOS and macOS

* Migrate tvOS

* Update linting

* Update travis

* Update swift-version

* Update readme

* Ensure the correct version of Bundler is installed
  • Loading branch information
aamctustwo committed Apr 24, 2019
1 parent 814deaf commit 996a5722d22e67609b938be54c49e960fc5e576c
@@ -1 +1 @@
ruby-2.3.3
ruby-2.4.3
@@ -1 +1 @@
4.1
5.0
@@ -2,12 +2,18 @@ disabled_rules:
- line_length
- nesting
opt_in_rules:
- anyobject_protocol
- array_init
- attributes
- closure_end_indentation
- closure_spacing
- conditional_returns_on_newline
- contains_over_first_not_nil
- convenience_type
- empty_count
- empty_string
- explicit_init
- fallthrough
- fatal_error_message
- file_header
- first_where
@@ -21,6 +27,7 @@ opt_in_rules:
- redundant_nil_coalescing
- sorted_imports
- switch_case_on_newline
- unneeded_parentheses_in_closure_argument
- yoda_condition

excluded:
@@ -1,16 +1,17 @@
osx_image: xcode9.3
osx_image: xcode10.2
language: objective-c

env:
global:
- LC_CTYPE=en_US.UTF-8
- LANG=en_US.UTF-8
- LC_CTYPE=en_US.UTF-8
- LANG=en_US.UTF-8

before_install:
- rvm list
- rvm install $(cat .ruby-version)
- brew update
- brew outdated swiftlint || brew upgrade swiftlint
- gem install bundler -v 2.0.1

# Test using Fastlane
script:
@@ -19,7 +19,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

// MARK: - UIApplicationDelegate
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
let viewController = FormViewController()
let navigationController = UINavigationController(rootViewController: viewController)
navigationController.navigationBar.isTranslucent = false
@@ -9,9 +9,9 @@
import Foundation


struct FormAccessibility {
enum FormAccessibility {

struct Identifiers {
enum Identifiers {
static let EmailLabel = "EMAIL_LABEL"
static let EmailTextField = "EMAIL_TEXTFIELD"

@@ -40,17 +40,17 @@ final class FormEntryView<V: Validator>: UIView, ValidatorControlDelegate, UITex
stackView.alignment = .fill
addSubview(stackView)

textLabel.font = UIFont.preferredFont(forTextStyle: UIFontTextStyle.headline)
textLabel.font = UIFont.preferredFont(forTextStyle: UIFont.TextStyle.headline)
textLabel.textAlignment = .center
stackView.addArrangedSubview(textLabel)

textField.autocorrectionType = .no
textField.borderStyle = .line
textField.font = UIFont.preferredFont(forTextStyle: UIFontTextStyle.body)
textField.font = UIFont.preferredFont(forTextStyle: UIFont.TextStyle.body)
textField.setValidatorDelegate(self)
stackView.addArrangedSubview(textField)

errorLabel.font = UIFont.preferredFont(forTextStyle: UIFontTextStyle.headline)
errorLabel.font = UIFont.preferredFont(forTextStyle: UIFont.TextStyle.headline)
errorLabel.isHidden = true
errorLabel.lineBreakMode = .byWordWrapping
errorLabel.numberOfLines = 0
@@ -56,8 +56,8 @@ final class FormView: UIView {
emailEntry.textField.validateOnFocusLossOnly = true
stackView.addArrangedSubview(emailEntry)

submitButton.titleLabel?.font = UIFont.preferredFont(forTextStyle: UIFontTextStyle.body)
submitButton.setTitle(NSLocalizedString("Submit", comment: ""), for: UIControlState())
submitButton.titleLabel?.font = UIFont.preferredFont(forTextStyle: UIFont.TextStyle.body)
submitButton.setTitle(NSLocalizedString("Submit", comment: ""), for: UIControl.State())
stackView.addArrangedSubview(submitButton)

bottomBufferView.setContentCompressionResistancePriority(UILayoutPriority.defaultLow, for: stackView.axis)
@@ -34,6 +34,12 @@ class AppDelegate: NSObject, NSApplicationDelegate {


// MARK: - NSApplicationDelegate
func applicationWillFinishLaunching(_ notification: Notification) {
if #available(macOS 10.14, *) {
NSApp.appearance = NSAppearance(named: .aqua)
}
}

func applicationDidFinishLaunching(_ notification: Notification) {
let viewController = FormViewController()
@@ -8,9 +8,9 @@
import Foundation

struct FormAccessibility {
enum FormAccessibility {

struct Identifiers {
enum Identifiers {
static let EmailLabel = "EMAIL_LABEL"
static let EmailTextField = "EMAIL_TEXTFIELD"

@@ -16,7 +16,7 @@ final class FormView: NSView {

// MARK: - Types
private struct Constants {
private enum Constants {

static let minimumTextFieldWidth: CGFloat = 300.0

@@ -842,29 +842,29 @@
};
0062E9CF1C45493E00021C0A = {
CreatedOnToolsVersion = 7.2;
LastSwiftMigration = 0910;
LastSwiftMigration = 1020;
};
0062E9D91C45493E00021C0A = {
CreatedOnToolsVersion = 7.2;
LastSwiftMigration = 0910;
LastSwiftMigration = 1020;
ProvisioningStyle = Manual;
};
00AC81E71E1FB69200A184BB = {
CreatedOnToolsVersion = 8.2.1;
LastSwiftMigration = 0910;
LastSwiftMigration = 1020;
ProvisioningStyle = Manual;
};
00AC81EF1E1FB69200A184BB = {
CreatedOnToolsVersion = 8.2.1;
DevelopmentTeam = 4JC5M8RR29;
LastSwiftMigration = 0910;
LastSwiftMigration = 1020;
ProvisioningStyle = Automatic;
};
};
};
buildConfigurationList = 0062E9CA1C45493E00021C0A /* Build configuration list for PBXProject "FormValidatorSwift" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
@@ -882,6 +882,7 @@
ru,
tr,
es,
Base,
);
mainGroup = 0062E9C61C45493E00021C0A;
productRefGroup = 0062E9D11C45493E00021C0A /* Products */;
@@ -959,7 +960,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "${SRCROOT}/Scripts/swiftlint_xcode.sh";
shellScript = "${SRCROOT}/Scripts/swiftlint_xcode.sh\n";
};
003E91A61E37633100CEC946 /* SwiftLint */ = {
isa = PBXShellScriptBuildPhase;
@@ -1334,7 +1335,7 @@
PRODUCT_NAME = FormValidatorSwift;
SDKROOT = appletvos;
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.0;
};
@@ -1357,7 +1358,7 @@
PRODUCT_NAME = FormValidatorSwift;
SDKROOT = appletvos;
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.0;
};
@@ -1372,7 +1373,8 @@
PRODUCT_BUNDLE_IDENTIFIER = com.ustwo.FormValidatorSwiftTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.1;
};
name = Debug;
@@ -1386,7 +1388,8 @@
PRODUCT_BUNDLE_IDENTIFIER = com.ustwo.FormValidatorSwiftTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.1;
};
name = Release;
@@ -1525,7 +1528,7 @@
PRODUCT_NAME = FormValidatorSwift;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
@@ -1546,7 +1549,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.ustwo.FormValidatorSwift;
PRODUCT_NAME = FormValidatorSwift;
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
@@ -1558,7 +1561,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.ustwo.FormValidatorSwiftTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
@@ -1570,7 +1573,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.ustwo.FormValidatorSwiftTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
@@ -1597,7 +1600,7 @@
SDKROOT = macosx;
SKIP_INSTALL = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
@@ -1623,7 +1626,7 @@
PRODUCT_NAME = FormValidatorSwift;
SDKROOT = macosx;
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
@@ -1643,7 +1646,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
@@ -1662,7 +1665,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.ustwo.FormValidatorSwiftTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
@@ -2,7 +2,7 @@ source "https://rubygems.org"

gem 'fastlane'
gem 'jazzy'
gem 'cocoapods', '~> 1.4.0'
gem 'cocoapods', '~> 1.6.1'

plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)

0 comments on commit 996a572

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