From 62cc40c46017de6ea1a640b527aae992505ebef4 Mon Sep 17 00:00:00 2001
From: Lammert Westerhoff <westerhoff@gmail.com>
Date: Tue, 28 Aug 2018 13:20:59 +0200
Subject: [PATCH 01/29] Add basic watchOS support

---
 R.swift.Library.podspec                   |   5 +-
 R.swift.Library.xcodeproj/project.pbxproj | 174 ++++++++++++++++++++++
 Rswift-watchOS/Info.plist                 |  22 +++
 Rswift-watchOS/Rswift_watchOS.h           |  19 +++
 4 files changed, 219 insertions(+), 1 deletion(-)
 create mode 100644 Rswift-watchOS/Info.plist
 create mode 100644 Rswift-watchOS/Rswift_watchOS.h

diff --git a/R.swift.Library.podspec b/R.swift.Library.podspec
index cdecc5e..abd2e33 100644
--- a/R.swift.Library.podspec
+++ b/R.swift.Library.podspec
@@ -19,9 +19,12 @@ Pod::Spec.new do |spec|
   spec.source          = { :git => "https://github.com/mac-cain13/R.swift.Library.git", :tag => "v#{spec.version}" }
 
   spec.ios.deployment_target     = '8.0'
+  spec.ios.source_files  = "Library/**/*.swift"
   spec.tvos.deployment_target    = '9.0'
+  spec.tvos.source_files  = "Library/**/*.swift"
+  spec.watchos.deployment_target = '2.2'
+  spec.watchos.source_files  = ["Library/Core/*.swift", "Library/Foundation/*.swift"]
 
   spec.module_name   = "Rswift"
-  spec.source_files  = "Library/**/*.swift"
 
 end
diff --git a/R.swift.Library.xcodeproj/project.pbxproj b/R.swift.Library.xcodeproj/project.pbxproj
index 8c5a44d..92ae2c8 100644
--- a/R.swift.Library.xcodeproj/project.pbxproj
+++ b/R.swift.Library.xcodeproj/project.pbxproj
@@ -7,6 +7,24 @@
 	objects = {
 
 /* Begin PBXBuildFile section */
+		2F5FBC4421355A1400A83A69 /* Rswift_watchOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 2F5FBC4221355A1400A83A69 /* Rswift_watchOS.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		2F5FBC4821355AC400A83A69 /* ColorResource.swift in Sources */ = {isa = PBXBuildFile; fileRef = E22D43661C95EEA100692FFF /* ColorResource.swift */; };
+		2F5FBC4A21355ADB00A83A69 /* Bundle+FileResource.swift in Sources */ = {isa = PBXBuildFile; fileRef = D56DC7721C42B65C00623437 /* Bundle+FileResource.swift */; };
+		2F5FBC4B21355ADB00A83A69 /* Data+FileResource.swift in Sources */ = {isa = PBXBuildFile; fileRef = E20F34A61C92B44100338F81 /* Data+FileResource.swift */; };
+		2F5FBC4C21355ADF00A83A69 /* FileResource.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5E435AC1C3D00770091090C /* FileResource.swift */; };
+		2F5FBC4D21355ADF00A83A69 /* FontResource.swift in Sources */ = {isa = PBXBuildFile; fileRef = D57E1EB21C3D762300DDA68F /* FontResource.swift */; };
+		2F5FBC4E21355ADF00A83A69 /* Identifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = D543F9BA1C1497EB00D16A0C /* Identifier.swift */; };
+		2F5FBC4F21355ADF00A83A69 /* ImageResource.swift in Sources */ = {isa = PBXBuildFile; fileRef = D553F5841C44157000885232 /* ImageResource.swift */; };
+		2F5FBC5021355ADF00A83A69 /* NibResource.swift in Sources */ = {isa = PBXBuildFile; fileRef = D543F9C01C14984300D16A0C /* NibResource.swift */; };
+		2F5FBC5121355ADF00A83A69 /* ReuseIdentifierProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = D543F9BC1C14980600D16A0C /* ReuseIdentifierProtocol.swift */; };
+		2F5FBC5221355ADF00A83A69 /* StoryboardResource.swift in Sources */ = {isa = PBXBuildFile; fileRef = D57E1EB61C3E482A00DDA68F /* StoryboardResource.swift */; };
+		2F5FBC5321355ADF00A83A69 /* StoryboardSegueIdentifierProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = D543F9BE1C14983100D16A0C /* StoryboardSegueIdentifierProtocol.swift */; };
+		2F5FBC5421355ADF00A83A69 /* StoryboardViewControllerResource.swift in Sources */ = {isa = PBXBuildFile; fileRef = D51335261C959DF20014C9D4 /* StoryboardViewControllerResource.swift */; };
+		2F5FBC5521355ADF00A83A69 /* StringResource.swift in Sources */ = {isa = PBXBuildFile; fileRef = E250BE961CCBF60300CC71DE /* StringResource.swift */; };
+		2F5FBC5621355ADF00A83A69 /* Validatable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D53F19231C229D7200AE2FAD /* Validatable.swift */; };
+		2F5FBC5821355B0200A83A69 /* UIColor+ColorResource.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2CA68EE1EE75992009C4DB4 /* UIColor+ColorResource.swift */; };
+		2F5FBC5921355B0200A83A69 /* UIFont+FontResource.swift in Sources */ = {isa = PBXBuildFile; fileRef = D57E1EB41C3D774000DDA68F /* UIFont+FontResource.swift */; };
+		2F5FBC5A21355B0200A83A69 /* UIImage+ImageResource.swift in Sources */ = {isa = PBXBuildFile; fileRef = D553F5861C44170E00885232 /* UIImage+ImageResource.swift */; };
 		806E699C1C42BD9C00DE3A8B /* Rswift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 806E69921C42BD9C00DE3A8B /* Rswift.framework */; };
 		806E69A91C42BDDA00DE3A8B /* FileResource.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5E435AC1C3D00770091090C /* FileResource.swift */; };
 		806E69AA1C42BDDA00DE3A8B /* FontResource.swift in Sources */ = {isa = PBXBuildFile; fileRef = D57E1EB21C3D762300DDA68F /* FontResource.swift */; };
@@ -87,6 +105,9 @@
 /* End PBXContainerItemProxy section */
 
 /* Begin PBXFileReference section */
+		2F5FBC4021355A1400A83A69 /* Rswift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Rswift.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+		2F5FBC4221355A1400A83A69 /* Rswift_watchOS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Rswift_watchOS.h; sourceTree = "<group>"; };
+		2F5FBC4321355A1400A83A69 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
 		806E69921C42BD9C00DE3A8B /* Rswift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Rswift.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 		806E699B1C42BD9C00DE3A8B /* RswiftTests-tvOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "RswiftTests-tvOS.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
 		D51335261C959DF20014C9D4 /* StoryboardViewControllerResource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StoryboardViewControllerResource.swift; sourceTree = "<group>"; };
@@ -125,6 +146,13 @@
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
+		2F5FBC3D21355A1400A83A69 /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
 		806E698E1C42BD9C00DE3A8B /* Frameworks */ = {
 			isa = PBXFrameworksBuildPhase;
 			buildActionMask = 2147483647;
@@ -158,6 +186,15 @@
 /* End PBXFrameworksBuildPhase section */
 
 /* Begin PBXGroup section */
+		2F5FBC4121355A1400A83A69 /* Rswift-watchOS */ = {
+			isa = PBXGroup;
+			children = (
+				2F5FBC4221355A1400A83A69 /* Rswift_watchOS.h */,
+				2F5FBC4321355A1400A83A69 /* Info.plist */,
+			);
+			path = "Rswift-watchOS";
+			sourceTree = "<group>";
+		};
 		D543F9C21C14987000D16A0C /* UIKit */ = {
 			isa = PBXGroup;
 			children = (
@@ -211,6 +248,7 @@
 			children = (
 				D59246501C117A55007F94C7 /* Library */,
 				D592465C1C117A55007F94C7 /* LibraryTests */,
+				2F5FBC4121355A1400A83A69 /* Rswift-watchOS */,
 				D592464F1C117A55007F94C7 /* Products */,
 			);
 			indentWidth = 2;
@@ -225,6 +263,7 @@
 				D59246581C117A55007F94C7 /* RswiftTests-iOS.xctest */,
 				806E69921C42BD9C00DE3A8B /* Rswift.framework */,
 				806E699B1C42BD9C00DE3A8B /* RswiftTests-tvOS.xctest */,
+				2F5FBC4021355A1400A83A69 /* Rswift.framework */,
 			);
 			name = Products;
 			sourceTree = "<group>";
@@ -253,6 +292,14 @@
 /* End PBXGroup section */
 
 /* Begin PBXHeadersBuildPhase section */
+		2F5FBC3B21355A1400A83A69 /* Headers */ = {
+			isa = PBXHeadersBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				2F5FBC4421355A1400A83A69 /* Rswift_watchOS.h in Headers */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
 		806E698F1C42BD9C00DE3A8B /* Headers */ = {
 			isa = PBXHeadersBuildPhase;
 			buildActionMask = 2147483647;
@@ -272,6 +319,24 @@
 /* End PBXHeadersBuildPhase section */
 
 /* Begin PBXNativeTarget section */
+		2F5FBC3F21355A1400A83A69 /* Rswift-watchOS */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = 2F5FBC4721355A1400A83A69 /* Build configuration list for PBXNativeTarget "Rswift-watchOS" */;
+			buildPhases = (
+				2F5FBC3B21355A1400A83A69 /* Headers */,
+				2F5FBC3C21355A1400A83A69 /* Sources */,
+				2F5FBC3D21355A1400A83A69 /* Frameworks */,
+				2F5FBC3E21355A1400A83A69 /* Resources */,
+			);
+			buildRules = (
+			);
+			dependencies = (
+			);
+			name = "Rswift-watchOS";
+			productName = "Rswift-watchOS";
+			productReference = 2F5FBC4021355A1400A83A69 /* Rswift.framework */;
+			productType = "com.apple.product-type.framework";
+		};
 		806E69911C42BD9C00DE3A8B /* Rswift-tvOS */ = {
 			isa = PBXNativeTarget;
 			buildConfigurationList = 806E69A31C42BD9C00DE3A8B /* Build configuration list for PBXNativeTarget "Rswift-tvOS" */;
@@ -354,6 +419,10 @@
 				LastUpgradeCheck = 1000;
 				ORGANIZATIONNAME = "Mathijs Kadijk";
 				TargetAttributes = {
+					2F5FBC3F21355A1400A83A69 = {
+						CreatedOnToolsVersion = 10.0;
+						ProvisioningStyle = Automatic;
+					};
 					806E69911C42BD9C00DE3A8B = {
 						CreatedOnToolsVersion = 7.2;
 						LastSwiftMigration = 0900;
@@ -388,11 +457,19 @@
 				D59246571C117A55007F94C7 /* RswiftTests-iOS */,
 				806E69911C42BD9C00DE3A8B /* Rswift-tvOS */,
 				806E699A1C42BD9C00DE3A8B /* RswiftTests-tvOS */,
+				2F5FBC3F21355A1400A83A69 /* Rswift-watchOS */,
 			);
 		};
 /* End PBXProject section */
 
 /* Begin PBXResourcesBuildPhase section */
+		2F5FBC3E21355A1400A83A69 /* Resources */ = {
+			isa = PBXResourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
 		806E69901C42BD9C00DE3A8B /* Resources */ = {
 			isa = PBXResourcesBuildPhase;
 			buildActionMask = 2147483647;
@@ -424,6 +501,30 @@
 /* End PBXResourcesBuildPhase section */
 
 /* Begin PBXSourcesBuildPhase section */
+		2F5FBC3C21355A1400A83A69 /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				2F5FBC4F21355ADF00A83A69 /* ImageResource.swift in Sources */,
+				2F5FBC5421355ADF00A83A69 /* StoryboardViewControllerResource.swift in Sources */,
+				2F5FBC4D21355ADF00A83A69 /* FontResource.swift in Sources */,
+				2F5FBC5A21355B0200A83A69 /* UIImage+ImageResource.swift in Sources */,
+				2F5FBC5921355B0200A83A69 /* UIFont+FontResource.swift in Sources */,
+				2F5FBC4821355AC400A83A69 /* ColorResource.swift in Sources */,
+				2F5FBC4C21355ADF00A83A69 /* FileResource.swift in Sources */,
+				2F5FBC5221355ADF00A83A69 /* StoryboardResource.swift in Sources */,
+				2F5FBC5521355ADF00A83A69 /* StringResource.swift in Sources */,
+				2F5FBC4B21355ADB00A83A69 /* Data+FileResource.swift in Sources */,
+				2F5FBC5021355ADF00A83A69 /* NibResource.swift in Sources */,
+				2F5FBC5321355ADF00A83A69 /* StoryboardSegueIdentifierProtocol.swift in Sources */,
+				2F5FBC4E21355ADF00A83A69 /* Identifier.swift in Sources */,
+				2F5FBC4A21355ADB00A83A69 /* Bundle+FileResource.swift in Sources */,
+				2F5FBC5821355B0200A83A69 /* UIColor+ColorResource.swift in Sources */,
+				2F5FBC5121355ADF00A83A69 /* ReuseIdentifierProtocol.swift in Sources */,
+				2F5FBC5621355ADF00A83A69 /* Validatable.swift in Sources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
 		806E698D1C42BD9C00DE3A8B /* Sources */ = {
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 2147483647;
@@ -524,6 +625,70 @@
 /* End PBXTargetDependency section */
 
 /* Begin XCBuildConfiguration section */
+		2F5FBC4521355A1400A83A69 /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				APPLICATION_EXTENSION_API_ONLY = YES;
+				CLANG_ANALYZER_NONNULL = YES;
+				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+				CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+				CLANG_ENABLE_OBJC_WEAK = YES;
+				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+				CODE_SIGN_IDENTITY = "";
+				CODE_SIGN_STYLE = Automatic;
+				DEFINES_MODULE = YES;
+				DYLIB_COMPATIBILITY_VERSION = 1;
+				DYLIB_CURRENT_VERSION = 1;
+				DYLIB_INSTALL_NAME_BASE = "@rpath";
+				GCC_C_LANGUAGE_STANDARD = gnu11;
+				INFOPLIST_FILE = "Rswift-watchOS/Info.plist";
+				INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
+				MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
+				MTL_FAST_MATH = YES;
+				PRODUCT_BUNDLE_IDENTIFIER = nl.mathijskadijk.rswift.library;
+				PRODUCT_NAME = Rswift;
+				SDKROOT = watchos;
+				SKIP_INSTALL = YES;
+				SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
+				SWIFT_VERSION = 4.2;
+				TARGETED_DEVICE_FAMILY = 4;
+				WATCHOS_DEPLOYMENT_TARGET = 2.2;
+			};
+			name = Debug;
+		};
+		2F5FBC4621355A1400A83A69 /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				APPLICATION_EXTENSION_API_ONLY = YES;
+				CLANG_ANALYZER_NONNULL = YES;
+				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+				CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+				CLANG_ENABLE_OBJC_WEAK = YES;
+				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+				CODE_SIGN_IDENTITY = "";
+				CODE_SIGN_STYLE = Automatic;
+				DEFINES_MODULE = YES;
+				DYLIB_COMPATIBILITY_VERSION = 1;
+				DYLIB_CURRENT_VERSION = 1;
+				DYLIB_INSTALL_NAME_BASE = "@rpath";
+				GCC_C_LANGUAGE_STANDARD = gnu11;
+				INFOPLIST_FILE = "Rswift-watchOS/Info.plist";
+				INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
+				MTL_FAST_MATH = YES;
+				PRODUCT_BUNDLE_IDENTIFIER = nl.mathijskadijk.rswift.library;
+				PRODUCT_NAME = Rswift;
+				SDKROOT = watchos;
+				SKIP_INSTALL = YES;
+				SWIFT_VERSION = 4.2;
+				TARGETED_DEVICE_FAMILY = 4;
+				WATCHOS_DEPLOYMENT_TARGET = 2.2;
+			};
+			name = Release;
+		};
 		806E69A41C42BD9C00DE3A8B /* Debug */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
@@ -772,6 +937,15 @@
 /* End XCBuildConfiguration section */
 
 /* Begin XCConfigurationList section */
+		2F5FBC4721355A1400A83A69 /* Build configuration list for PBXNativeTarget "Rswift-watchOS" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				2F5FBC4521355A1400A83A69 /* Debug */,
+				2F5FBC4621355A1400A83A69 /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
 		806E69A31C42BD9C00DE3A8B /* Build configuration list for PBXNativeTarget "Rswift-tvOS" */ = {
 			isa = XCConfigurationList;
 			buildConfigurations = (
diff --git a/Rswift-watchOS/Info.plist b/Rswift-watchOS/Info.plist
new file mode 100644
index 0000000..e1fe4cf
--- /dev/null
+++ b/Rswift-watchOS/Info.plist
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>CFBundleDevelopmentRegion</key>
+	<string>$(DEVELOPMENT_LANGUAGE)</string>
+	<key>CFBundleExecutable</key>
+	<string>$(EXECUTABLE_NAME)</string>
+	<key>CFBundleIdentifier</key>
+	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
+	<key>CFBundleInfoDictionaryVersion</key>
+	<string>6.0</string>
+	<key>CFBundleName</key>
+	<string>$(PRODUCT_NAME)</string>
+	<key>CFBundlePackageType</key>
+	<string>FMWK</string>
+	<key>CFBundleShortVersionString</key>
+	<string>1.0</string>
+	<key>CFBundleVersion</key>
+	<string>$(CURRENT_PROJECT_VERSION)</string>
+</dict>
+</plist>
diff --git a/Rswift-watchOS/Rswift_watchOS.h b/Rswift-watchOS/Rswift_watchOS.h
new file mode 100644
index 0000000..5b0a159
--- /dev/null
+++ b/Rswift-watchOS/Rswift_watchOS.h
@@ -0,0 +1,19 @@
+//
+//  Rswift_watchOS.h
+//  Rswift-watchOS
+//
+//  Created by Lammert Westerhoff on 28/08/2018.
+//  Copyright © 2018 Mathijs Kadijk. All rights reserved.
+//
+
+#import <WatchKit/WatchKit.h>
+
+//! Project version number for Rswift_watchOS.
+FOUNDATION_EXPORT double Rswift_watchOSVersionNumber;
+
+//! Project version string for Rswift_watchOS.
+FOUNDATION_EXPORT const unsigned char Rswift_watchOSVersionString[];
+
+// In this header, you should import all the public headers of your framework using statements like #import <Rswift_watchOS/PublicHeader.h>
+
+

From d6eba6f7f42ac5a10c73309f1ed63f43f42af38c Mon Sep 17 00:00:00 2001
From: Lammert Westerhoff <westerhoff@gmail.com>
Date: Mon, 14 Jan 2019 16:37:08 +0100
Subject: [PATCH 02/29] Fix code for different platforms

---
 Library/UIKit/UIColor+ColorResource.swift | 17 +++++++++++++++++
 Library/UIKit/UIImage+ImageResource.swift | 16 ++++++++++++++++
 2 files changed, 33 insertions(+)

diff --git a/Library/UIKit/UIColor+ColorResource.swift b/Library/UIKit/UIColor+ColorResource.swift
index 800d338..f585de0 100644
--- a/Library/UIKit/UIColor+ColorResource.swift
+++ b/Library/UIKit/UIColor+ColorResource.swift
@@ -12,6 +12,8 @@ import UIKit
 @available(iOS 11.0, *)
 @available(tvOS 11.0, *)
 public extension UIColor {
+
+  #if os(iOS) || os(tvOS)
   /**
    Returns the color from this resource (R.color.*) that is compatible with the trait collection.
 
@@ -23,4 +25,19 @@ public extension UIColor {
   public convenience init?(resource: ColorResourceType, compatibleWith traitCollection: UITraitCollection? = nil) {
     self.init(named: resource.name, in: resource.bundle, compatibleWith: traitCollection)
   }
+  #endif
+
+  #if os(watchOS)
+  /**
+   Returns the color from this resource (R.color.*) that is compatible with the trait collection.
+
+   - parameter resource: The resource you want the image of (R.color.*)
+
+   - returns: A color that exactly or best matches the desired traits with the given resource (R.color.*), or nil if no suitable color was found.
+   */
+  @available(watchOSApplicationExtension 4.0, *)
+  public convenience init?(resource: ColorResourceType) {
+    self.init(named: resource.name)
+  }
+  #endif
 }
diff --git a/Library/UIKit/UIImage+ImageResource.swift b/Library/UIKit/UIImage+ImageResource.swift
index 6037b4f..5f3daa9 100644
--- a/Library/UIKit/UIImage+ImageResource.swift
+++ b/Library/UIKit/UIImage+ImageResource.swift
@@ -10,6 +10,8 @@
 import UIKit
 
 public extension UIImage {
+
+  #if os(iOS) || os(tvOS)
   /**
    Returns the image from this resource (R.image.*) that is compatible with the trait collection.
 
@@ -21,4 +23,18 @@ public extension UIImage {
   public convenience init?(resource: ImageResourceType, compatibleWith traitCollection: UITraitCollection? = nil) {
     self.init(named: resource.name, in: resource.bundle, compatibleWith: traitCollection)
   }
+  #endif
+
+  #if os(watchOS)
+  /**
+   Returns the image from this resource (R.image.*) that is compatible with the trait collection.
+
+   - parameter resource: The resource you want the image of (R.image.*)
+
+   - returns: An image that exactly or best matches the desired traits with the given resource (R.image.*), or nil if no suitable image was found.
+   */
+  public convenience init?(resource: ImageResourceType) {
+    self.init(named: resource.name)
+  }
+  #endif
 }

From c6ba2bced38a235aaae53066a898e5580000f767 Mon Sep 17 00:00:00 2001
From: Tom Lokhorst <tom@lokhorst.eu>
Date: Mon, 14 Jan 2019 17:36:22 +0100
Subject: [PATCH 03/29] Remove Rswift-watchOS target files, use shared
 Info.plist file

---
 R.swift.Library.xcodeproj/project.pbxproj | 18 ++----------------
 Rswift-watchOS/Info.plist                 | 22 ----------------------
 Rswift-watchOS/Rswift_watchOS.h           | 19 -------------------
 3 files changed, 2 insertions(+), 57 deletions(-)
 delete mode 100644 Rswift-watchOS/Info.plist
 delete mode 100644 Rswift-watchOS/Rswift_watchOS.h

diff --git a/R.swift.Library.xcodeproj/project.pbxproj b/R.swift.Library.xcodeproj/project.pbxproj
index 92ae2c8..bd72db7 100644
--- a/R.swift.Library.xcodeproj/project.pbxproj
+++ b/R.swift.Library.xcodeproj/project.pbxproj
@@ -7,7 +7,6 @@
 	objects = {
 
 /* Begin PBXBuildFile section */
-		2F5FBC4421355A1400A83A69 /* Rswift_watchOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 2F5FBC4221355A1400A83A69 /* Rswift_watchOS.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		2F5FBC4821355AC400A83A69 /* ColorResource.swift in Sources */ = {isa = PBXBuildFile; fileRef = E22D43661C95EEA100692FFF /* ColorResource.swift */; };
 		2F5FBC4A21355ADB00A83A69 /* Bundle+FileResource.swift in Sources */ = {isa = PBXBuildFile; fileRef = D56DC7721C42B65C00623437 /* Bundle+FileResource.swift */; };
 		2F5FBC4B21355ADB00A83A69 /* Data+FileResource.swift in Sources */ = {isa = PBXBuildFile; fileRef = E20F34A61C92B44100338F81 /* Data+FileResource.swift */; };
@@ -106,8 +105,6 @@
 
 /* Begin PBXFileReference section */
 		2F5FBC4021355A1400A83A69 /* Rswift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Rswift.framework; sourceTree = BUILT_PRODUCTS_DIR; };
-		2F5FBC4221355A1400A83A69 /* Rswift_watchOS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Rswift_watchOS.h; sourceTree = "<group>"; };
-		2F5FBC4321355A1400A83A69 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
 		806E69921C42BD9C00DE3A8B /* Rswift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Rswift.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 		806E699B1C42BD9C00DE3A8B /* RswiftTests-tvOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "RswiftTests-tvOS.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
 		D51335261C959DF20014C9D4 /* StoryboardViewControllerResource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StoryboardViewControllerResource.swift; sourceTree = "<group>"; };
@@ -186,15 +183,6 @@
 /* End PBXFrameworksBuildPhase section */
 
 /* Begin PBXGroup section */
-		2F5FBC4121355A1400A83A69 /* Rswift-watchOS */ = {
-			isa = PBXGroup;
-			children = (
-				2F5FBC4221355A1400A83A69 /* Rswift_watchOS.h */,
-				2F5FBC4321355A1400A83A69 /* Info.plist */,
-			);
-			path = "Rswift-watchOS";
-			sourceTree = "<group>";
-		};
 		D543F9C21C14987000D16A0C /* UIKit */ = {
 			isa = PBXGroup;
 			children = (
@@ -248,7 +236,6 @@
 			children = (
 				D59246501C117A55007F94C7 /* Library */,
 				D592465C1C117A55007F94C7 /* LibraryTests */,
-				2F5FBC4121355A1400A83A69 /* Rswift-watchOS */,
 				D592464F1C117A55007F94C7 /* Products */,
 			);
 			indentWidth = 2;
@@ -296,7 +283,6 @@
 			isa = PBXHeadersBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				2F5FBC4421355A1400A83A69 /* Rswift_watchOS.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -642,7 +628,7 @@
 				DYLIB_CURRENT_VERSION = 1;
 				DYLIB_INSTALL_NAME_BASE = "@rpath";
 				GCC_C_LANGUAGE_STANDARD = gnu11;
-				INFOPLIST_FILE = "Rswift-watchOS/Info.plist";
+				INFOPLIST_FILE = Library/Info.plist;
 				INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
 				MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
@@ -675,7 +661,7 @@
 				DYLIB_CURRENT_VERSION = 1;
 				DYLIB_INSTALL_NAME_BASE = "@rpath";
 				GCC_C_LANGUAGE_STANDARD = gnu11;
-				INFOPLIST_FILE = "Rswift-watchOS/Info.plist";
+				INFOPLIST_FILE = Library/Info.plist;
 				INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
 				MTL_FAST_MATH = YES;
diff --git a/Rswift-watchOS/Info.plist b/Rswift-watchOS/Info.plist
deleted file mode 100644
index e1fe4cf..0000000
--- a/Rswift-watchOS/Info.plist
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>CFBundleDevelopmentRegion</key>
-	<string>$(DEVELOPMENT_LANGUAGE)</string>
-	<key>CFBundleExecutable</key>
-	<string>$(EXECUTABLE_NAME)</string>
-	<key>CFBundleIdentifier</key>
-	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
-	<key>CFBundleInfoDictionaryVersion</key>
-	<string>6.0</string>
-	<key>CFBundleName</key>
-	<string>$(PRODUCT_NAME)</string>
-	<key>CFBundlePackageType</key>
-	<string>FMWK</string>
-	<key>CFBundleShortVersionString</key>
-	<string>1.0</string>
-	<key>CFBundleVersion</key>
-	<string>$(CURRENT_PROJECT_VERSION)</string>
-</dict>
-</plist>
diff --git a/Rswift-watchOS/Rswift_watchOS.h b/Rswift-watchOS/Rswift_watchOS.h
deleted file mode 100644
index 5b0a159..0000000
--- a/Rswift-watchOS/Rswift_watchOS.h
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-//  Rswift_watchOS.h
-//  Rswift-watchOS
-//
-//  Created by Lammert Westerhoff on 28/08/2018.
-//  Copyright © 2018 Mathijs Kadijk. All rights reserved.
-//
-
-#import <WatchKit/WatchKit.h>
-
-//! Project version number for Rswift_watchOS.
-FOUNDATION_EXPORT double Rswift_watchOSVersionNumber;
-
-//! Project version string for Rswift_watchOS.
-FOUNDATION_EXPORT const unsigned char Rswift_watchOSVersionString[];
-
-// In this header, you should import all the public headers of your framework using statements like #import <Rswift_watchOS/PublicHeader.h>
-
-

From 1a51317652f3b6e116de41ff06f74a2745f05b7b Mon Sep 17 00:00:00 2001
From: Eduard Sergeev <devsedo@gmail.com>
Date: Tue, 5 Mar 2019 16:58:22 +0700
Subject: [PATCH 04/29] Typo

Fixing typo.
---
 Library/Core/Validatable.swift | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Library/Core/Validatable.swift b/Library/Core/Validatable.swift
index 3467513..f965a6c 100644
--- a/Library/Core/Validatable.swift
+++ b/Library/Core/Validatable.swift
@@ -21,7 +21,7 @@ public struct ValidationError: Error, CustomStringConvertible {
 
 public protocol Validatable {
   /**
-   Validates this entity and throws if it encounters a invalid situation, a validatable should also validate it sub-validatables if it has any.
+   Validates this entity and throws if it encounters an invalid situation, a validatable should also validate it sub-validatables if it has any.
 
    - throws: If there the configuration error a ValidationError is thrown
    */

From 84e1ab256c3863c29c6458b64c45c6e4c7127d78 Mon Sep 17 00:00:00 2001
From: watanave <susan.se3p@gmail.com>
Date: Tue, 26 Mar 2019 17:27:27 +0900
Subject: [PATCH 05/29] Fix warnnings

'public' modifier is redundant for instance method declared in a public extension
---
 Library/Foundation/Bundle+FileResource.swift           |  4 ++--
 Library/Foundation/Data+FileResource.swift             |  2 +-
 Library/UIKit/NibResource+UIKit.swift                  |  2 +-
 ...StoryboardResourceWithInitialController+UIKit.swift |  2 +-
 .../UICollectionView+ReuseIdentifierProtocol.swift     |  8 ++++----
 Library/UIKit/UIColor+ColorResource.swift              |  2 +-
 Library/UIKit/UIFont+FontResource.swift                |  2 +-
 Library/UIKit/UIImage+ImageResource.swift              |  2 +-
 Library/UIKit/UINib+NibResource.swift                  |  2 +-
 Library/UIKit/UIStoryboard+StoryboardResource.swift    |  2 +-
 ...UIStoryboard+StoryboardViewControllerResource.swift |  2 +-
 .../UIKit/UITableView+ReuseIdentifierProtocol.swift    | 10 +++++-----
 Library/UIKit/UIViewController+NibResource.swift       |  2 +-
 ...wController+StoryboardSegueIdentifierProtocol.swift |  4 ++--
 14 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/Library/Foundation/Bundle+FileResource.swift b/Library/Foundation/Bundle+FileResource.swift
index 83af4ff..d632c8d 100644
--- a/Library/Foundation/Bundle+FileResource.swift
+++ b/Library/Foundation/Bundle+FileResource.swift
@@ -17,7 +17,7 @@ public extension Bundle {
 
    - returns: The file URL for the resource file (R.file.*) or nil if the file could not be located.
    */
-  public func url(forResource resource: FileResourceType) -> URL? {
+  func url(forResource resource: FileResourceType) -> URL? {
     return url(forResource: resource.name, withExtension: resource.pathExtension)
   }
 
@@ -28,7 +28,7 @@ public extension Bundle {
 
    - returns: The full pathname for the resource file (R.file.*) or nil if the file could not be located.
    */
-  public func path(forResource resource: FileResourceType) -> String? {
+  func path(forResource resource: FileResourceType) -> String? {
     return path(forResource: resource.name, ofType: resource.pathExtension)
   }
 }
diff --git a/Library/Foundation/Data+FileResource.swift b/Library/Foundation/Data+FileResource.swift
index 2f612bd..36a0a36 100644
--- a/Library/Foundation/Data+FileResource.swift
+++ b/Library/Foundation/Data+FileResource.swift
@@ -20,7 +20,7 @@ public extension Data {
 
    - returns: A NSData object with the contents of the specified file.
    */
-  public init(resource: FileResourceType) throws {
+  init(resource: FileResourceType) throws {
     guard let url = resource.url() else { throw NoUrlForResourceError() }
     try self.init(contentsOf: url)
   }
diff --git a/Library/UIKit/NibResource+UIKit.swift b/Library/UIKit/NibResource+UIKit.swift
index eada71d..4339d3f 100644
--- a/Library/UIKit/NibResource+UIKit.swift
+++ b/Library/UIKit/NibResource+UIKit.swift
@@ -19,7 +19,7 @@ public extension NibResourceType {
 
    - returns: An array containing the top-level objects from the NIB
    */
-  public func instantiate(withOwner ownerOrNil: Any?, options optionsOrNil: [UINib.OptionsKey : Any]? = [:]) -> [Any] {
+  func instantiate(withOwner ownerOrNil: Any?, options optionsOrNil: [UINib.OptionsKey : Any]? = [:]) -> [Any] {
     return UINib(resource: self).instantiate(withOwner: ownerOrNil, options: optionsOrNil)
   }
 }
diff --git a/Library/UIKit/StoryboardResourceWithInitialController+UIKit.swift b/Library/UIKit/StoryboardResourceWithInitialController+UIKit.swift
index 23f4f46..b5b114c 100644
--- a/Library/UIKit/StoryboardResourceWithInitialController+UIKit.swift
+++ b/Library/UIKit/StoryboardResourceWithInitialController+UIKit.swift
@@ -16,7 +16,7 @@ public extension StoryboardResourceWithInitialControllerType {
 
    - returns: The initial view controller in the storyboard.
    */
-  public func instantiateInitialViewController() -> InitialController? {
+  func instantiateInitialViewController() -> InitialController? {
     return UIStoryboard(resource: self).instantiateInitialViewController() as? InitialController
   }
 }
diff --git a/Library/UIKit/UICollectionView+ReuseIdentifierProtocol.swift b/Library/UIKit/UICollectionView+ReuseIdentifierProtocol.swift
index aabcf14..bf68fa1 100644
--- a/Library/UIKit/UICollectionView+ReuseIdentifierProtocol.swift
+++ b/Library/UIKit/UICollectionView+ReuseIdentifierProtocol.swift
@@ -19,7 +19,7 @@ public extension UICollectionView {
    
    - returns: A subclass of UICollectionReusableView or nil if the cast fails.
   */
-  public func dequeueReusableCell<Identifier: ReuseIdentifierType>(withReuseIdentifier identifier: Identifier, for indexPath: IndexPath) -> Identifier.ReusableType?
+  func dequeueReusableCell<Identifier: ReuseIdentifierType>(withReuseIdentifier identifier: Identifier, for indexPath: IndexPath) -> Identifier.ReusableType?
     where Identifier.ReusableType: UICollectionReusableView
   {
     return dequeueReusableCell(withReuseIdentifier: identifier.identifier, for: indexPath) as? Identifier.ReusableType
@@ -34,7 +34,7 @@ public extension UICollectionView {
    
    - returns: A subclass of UICollectionReusableView or nil if the cast fails.
   */
-  public func dequeueReusableSupplementaryView<Identifier: ReuseIdentifierType>(ofKind elementKind: String, withReuseIdentifier identifier: Identifier, for indexPath: IndexPath) -> Identifier.ReusableType?
+  func dequeueReusableSupplementaryView<Identifier: ReuseIdentifierType>(ofKind elementKind: String, withReuseIdentifier identifier: Identifier, for indexPath: IndexPath) -> Identifier.ReusableType?
     where Identifier.ReusableType: UICollectionReusableView
   {
     return dequeueReusableSupplementaryView(ofKind: elementKind, withReuseIdentifier: identifier.identifier, for: indexPath) as? Identifier.ReusableType
@@ -45,7 +45,7 @@ public extension UICollectionView {
 
    - parameter nibResource: A nib resource (R.nib.*) containing a object of type UICollectionViewCell that has a reuse identifier
    */
-  public func register<Resource: NibResourceType & ReuseIdentifierType>(_ nibResource: Resource)
+  func register<Resource: NibResourceType & ReuseIdentifierType>(_ nibResource: Resource)
     where Resource.ReusableType: UICollectionViewCell
   {
     register(UINib(resource: nibResource), forCellWithReuseIdentifier: nibResource.identifier)
@@ -56,7 +56,7 @@ public extension UICollectionView {
 
    - parameter nibResource: A nib resource (R.nib.*) containing a object of type UICollectionReusableView. that has a reuse identifier
    */
-  public func register<Resource: NibResourceType & ReuseIdentifierType>(_ nibResource: Resource, forSupplementaryViewOfKind kind: String)
+  func register<Resource: NibResourceType & ReuseIdentifierType>(_ nibResource: Resource, forSupplementaryViewOfKind kind: String)
     where Resource.ReusableType: UICollectionReusableView
   {
     register(UINib(resource: nibResource), forSupplementaryViewOfKind: kind, withReuseIdentifier: nibResource.identifier)
diff --git a/Library/UIKit/UIColor+ColorResource.swift b/Library/UIKit/UIColor+ColorResource.swift
index 800d338..3bd7313 100644
--- a/Library/UIKit/UIColor+ColorResource.swift
+++ b/Library/UIKit/UIColor+ColorResource.swift
@@ -20,7 +20,7 @@ public extension UIColor {
 
    - returns: A color that exactly or best matches the desired traits with the given resource (R.color.*), or nil if no suitable color was found.
    */
-  public convenience init?(resource: ColorResourceType, compatibleWith traitCollection: UITraitCollection? = nil) {
+  convenience init?(resource: ColorResourceType, compatibleWith traitCollection: UITraitCollection? = nil) {
     self.init(named: resource.name, in: resource.bundle, compatibleWith: traitCollection)
   }
 }
diff --git a/Library/UIKit/UIFont+FontResource.swift b/Library/UIKit/UIFont+FontResource.swift
index 237d9cf..cadc6c9 100644
--- a/Library/UIKit/UIFont+FontResource.swift
+++ b/Library/UIKit/UIFont+FontResource.swift
@@ -19,7 +19,7 @@ public extension UIFont {
 
    - returns: A font object of the specified font resource and size.
    */
-  public convenience init?(resource: FontResourceType, size: CGFloat) {
+  convenience init?(resource: FontResourceType, size: CGFloat) {
     self.init(name: resource.fontName, size: size)
   }
 }
diff --git a/Library/UIKit/UIImage+ImageResource.swift b/Library/UIKit/UIImage+ImageResource.swift
index 6037b4f..f96fa14 100644
--- a/Library/UIKit/UIImage+ImageResource.swift
+++ b/Library/UIKit/UIImage+ImageResource.swift
@@ -18,7 +18,7 @@ public extension UIImage {
 
    - returns: An image that exactly or best matches the desired traits with the given resource (R.image.*), or nil if no suitable image was found.
   */
-  public convenience init?(resource: ImageResourceType, compatibleWith traitCollection: UITraitCollection? = nil) {
+  convenience init?(resource: ImageResourceType, compatibleWith traitCollection: UITraitCollection? = nil) {
     self.init(named: resource.name, in: resource.bundle, compatibleWith: traitCollection)
   }
 }
diff --git a/Library/UIKit/UINib+NibResource.swift b/Library/UIKit/UINib+NibResource.swift
index 70cba8a..73bb048 100644
--- a/Library/UIKit/UINib+NibResource.swift
+++ b/Library/UIKit/UINib+NibResource.swift
@@ -17,7 +17,7 @@ public extension UINib {
 
    - returns: The initialized UINib object. An exception is thrown if there were errors during initialization or the nib file could not be located.
    */
-  public convenience init(resource: NibResourceType) {
+  convenience init(resource: NibResourceType) {
     self.init(nibName: resource.name, bundle: resource.bundle)
   }
 }
diff --git a/Library/UIKit/UIStoryboard+StoryboardResource.swift b/Library/UIKit/UIStoryboard+StoryboardResource.swift
index bc03c2e..8848be0 100644
--- a/Library/UIKit/UIStoryboard+StoryboardResource.swift
+++ b/Library/UIKit/UIStoryboard+StoryboardResource.swift
@@ -17,7 +17,7 @@ public extension UIStoryboard {
 
    - returns: A storyboard object for the specified file. If no storyboard resource file matching name exists, an exception is thrown with description: `Could not find a storyboard named 'XXXXXX' in bundle....`
    */
-  public convenience init(resource: StoryboardResourceType) {
+  convenience init(resource: StoryboardResourceType) {
     self.init(name: resource.name, bundle: resource.bundle)
   }
 }
diff --git a/Library/UIKit/UIStoryboard+StoryboardViewControllerResource.swift b/Library/UIKit/UIStoryboard+StoryboardViewControllerResource.swift
index f816d62..59adab3 100644
--- a/Library/UIKit/UIStoryboard+StoryboardViewControllerResource.swift
+++ b/Library/UIKit/UIStoryboard+StoryboardViewControllerResource.swift
@@ -18,7 +18,7 @@ public extension UIStoryboard {
 
    - returns: The view controller corresponding to the specified resource (R.storyboard.*.*). If no view controller is associated, this method throws an exception.
    */
-  public func instantiateViewController<ViewControllerResource: StoryboardViewControllerResourceType>(withResource resource: ViewControllerResource) -> ViewControllerResource.ViewControllerType?  {
+  func instantiateViewController<ViewControllerResource: StoryboardViewControllerResourceType>(withResource resource: ViewControllerResource) -> ViewControllerResource.ViewControllerType?  {
     return self.instantiateViewController(withIdentifier: resource.identifier) as? ViewControllerResource.ViewControllerType
   }
 }
diff --git a/Library/UIKit/UITableView+ReuseIdentifierProtocol.swift b/Library/UIKit/UITableView+ReuseIdentifierProtocol.swift
index c5202ee..10d4b4f 100644
--- a/Library/UIKit/UITableView+ReuseIdentifierProtocol.swift
+++ b/Library/UIKit/UITableView+ReuseIdentifierProtocol.swift
@@ -21,14 +21,14 @@ public extension UITableView {
    
    - precondition: You must register a class or nib file using the registerNib: or registerClass:forCellReuseIdentifier: method before calling this method.
   */
-  public func dequeueReusableCell<Identifier: ReuseIdentifierType>(withIdentifier identifier: Identifier, for indexPath: IndexPath) -> Identifier.ReusableType?
+  func dequeueReusableCell<Identifier: ReuseIdentifierType>(withIdentifier identifier: Identifier, for indexPath: IndexPath) -> Identifier.ReusableType?
     where Identifier.ReusableType: UITableViewCell
   {
     return dequeueReusableCell(withIdentifier: identifier.identifier, for: indexPath) as? Identifier.ReusableType
   }
 
   @available(*, unavailable, message: "Use dequeueReusableCell(withIdentifier:for:) instead")
-  public func dequeueReusableCell<Identifier: ReuseIdentifierType>(withIdentifier identifier: Identifier) -> Identifier.ReusableType?
+  func dequeueReusableCell<Identifier: ReuseIdentifierType>(withIdentifier identifier: Identifier) -> Identifier.ReusableType?
     where Identifier.ReusableType: UITableViewCell
   {
     fatalError()
@@ -41,7 +41,7 @@ public extension UITableView {
    
    - returns: A UITableViewHeaderFooterView object with the associated identifier or nil if no such object exists in the reusable view queue or if it couldn't be cast correctly.
    */
-  public func dequeueReusableHeaderFooterView<Identifier: ReuseIdentifierType>(withIdentifier identifier: Identifier) -> Identifier.ReusableType?
+  func dequeueReusableHeaderFooterView<Identifier: ReuseIdentifierType>(withIdentifier identifier: Identifier) -> Identifier.ReusableType?
     where Identifier.ReusableType: UITableViewHeaderFooterView
   {
     return dequeueReusableHeaderFooterView(withIdentifier: identifier.identifier) as? Identifier.ReusableType
@@ -52,7 +52,7 @@ public extension UITableView {
    
    - parameter nibResource: A nib resource (R.nib.*) containing a table view cell that has a reuse identifier
   */
-  public func register<Resource: NibResourceType & ReuseIdentifierType>(_ nibResource: Resource) where Resource.ReusableType: UITableViewCell {
+  func register<Resource: NibResourceType & ReuseIdentifierType>(_ nibResource: Resource) where Resource.ReusableType: UITableViewCell {
     register(UINib(resource: nibResource), forCellReuseIdentifier: nibResource.identifier)
   }
 
@@ -61,7 +61,7 @@ public extension UITableView {
 
    - parameter nibResource: A nib resource (R.nib.*) containing a view that has a reuse identifier
    */
-  public func registerHeaderFooterView<Resource: NibResourceType>(_ nibResource: Resource) where Resource: ReuseIdentifierType, Resource.ReusableType: UIView {
+  func registerHeaderFooterView<Resource: NibResourceType>(_ nibResource: Resource) where Resource: ReuseIdentifierType, Resource.ReusableType: UIView {
     register(UINib(resource: nibResource), forHeaderFooterViewReuseIdentifier: nibResource.identifier)
   }
 }
diff --git a/Library/UIKit/UIViewController+NibResource.swift b/Library/UIKit/UIViewController+NibResource.swift
index 38c24ca..dbef8ce 100644
--- a/Library/UIKit/UIViewController+NibResource.swift
+++ b/Library/UIKit/UIViewController+NibResource.swift
@@ -18,7 +18,7 @@ public extension UIViewController {
    
    - returns: A newly initialized UIViewController object.
   */
-  public convenience init(nib: NibResourceType) {
+  convenience init(nib: NibResourceType) {
     self.init(nibName: nib.name, bundle: nib.bundle)
   }
 }
diff --git a/Library/UIKit/UIViewController+StoryboardSegueIdentifierProtocol.swift b/Library/UIKit/UIViewController+StoryboardSegueIdentifierProtocol.swift
index 6c886b4..27364a4 100644
--- a/Library/UIKit/UIViewController+StoryboardSegueIdentifierProtocol.swift
+++ b/Library/UIKit/UIViewController+StoryboardSegueIdentifierProtocol.swift
@@ -23,7 +23,7 @@ public extension SeguePerformerType {
    - parameter sender: The object that you want to use to initiate the segue. This object is made available for informational purposes during the actual segue.
    - SeeAlso: Library for typed block based segues: [tomlokhorst/SegueManager](https://github.com/tomlokhorst/SegueManager)
    */
-  public func performSegue<Segue, Destination>(withIdentifier identifier: StoryboardSegueIdentifier<Segue, Self, Destination>, sender: Any?) {
+  func performSegue<Segue, Destination>(withIdentifier identifier: StoryboardSegueIdentifier<Segue, Self, Destination>, sender: Any?) {
     performSegue(withIdentifier: identifier.identifier, sender: sender)
   }
 }
@@ -33,7 +33,7 @@ public extension StoryboardSegue where Source : UIViewController {
    Performs this segue on the source view controller
    - parameter sender: The object that you want to use to initiate the segue. This object is made available for informational purposes during the actual segue.
    */
-  public func performSegue(sender: Any? = nil) {
+  func performSegue(sender: Any? = nil) {
     source.performSegue(withIdentifier: identifier.identifier, sender: sender)
   }
 }

From 49e64419840d2d66b37b57b8a68de4f42407a0e0 Mon Sep 17 00:00:00 2001
From: watanave <susan.se3p@gmail.com>
Date: Tue, 26 Mar 2019 17:47:58 +0900
Subject: [PATCH 06/29] Bump swift version file to 4

---
 .swift-version | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.swift-version b/.swift-version
index 9f55b2c..5186d07 100644
--- a/.swift-version
+++ b/.swift-version
@@ -1 +1 @@
-3.0
+4.0

From ae88152aab915b35acd333c23836e22ea44246f4 Mon Sep 17 00:00:00 2001
From: Mathijs Kadijk <mkadijk@gmail.com>
Date: Sun, 31 Mar 2019 15:34:18 +0200
Subject: [PATCH 07/29] Preparing for the 5.0.1 release

---
 R.swift.Library.podspec | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/R.swift.Library.podspec b/R.swift.Library.podspec
index d906e95..1e5a9ab 100644
--- a/R.swift.Library.podspec
+++ b/R.swift.Library.podspec
@@ -1,7 +1,7 @@
 Pod::Spec.new do |spec|
 
   spec.name         = "R.swift.Library"
-  spec.version      = "5.0.0"
+  spec.version      = "5.0.1"
   spec.license      = "MIT"
 
   spec.summary      = "Companion library for R.swift, featuring types used to type resources"

From 997b6e5e80991de0556ba28e3d5c06b317bffe95 Mon Sep 17 00:00:00 2001
From: Tom Lokhorst <tom@lokhorst.eu>
Date: Mon, 10 Jun 2019 22:04:53 +0200
Subject: [PATCH 08/29] Update to Swift 5

---
 Library/UIKit/UIColor+ColorResource.swift     |  2 +-
 Library/UIKit/UIImage+ImageResource.swift     |  2 +-
 R.swift.Library.xcodeproj/project.pbxproj     | 34 +++++++++++--------
 .../xcschemes/Rswift-iOS.xcscheme             | 24 ++++++-------
 .../xcschemes/Rswift-tvOS.xcscheme            | 24 ++++++-------
 5 files changed, 41 insertions(+), 45 deletions(-)

diff --git a/Library/UIKit/UIColor+ColorResource.swift b/Library/UIKit/UIColor+ColorResource.swift
index 4df3f15..6ee764d 100644
--- a/Library/UIKit/UIColor+ColorResource.swift
+++ b/Library/UIKit/UIColor+ColorResource.swift
@@ -36,7 +36,7 @@ public extension UIColor {
    - returns: A color that exactly or best matches the desired traits with the given resource (R.color.*), or nil if no suitable color was found.
    */
   @available(watchOSApplicationExtension 4.0, *)
-  public convenience init?(resource: ColorResourceType) {
+  convenience init?(resource: ColorResourceType) {
     self.init(named: resource.name)
   }
   #endif
diff --git a/Library/UIKit/UIImage+ImageResource.swift b/Library/UIKit/UIImage+ImageResource.swift
index ec8b3d7..c764814 100644
--- a/Library/UIKit/UIImage+ImageResource.swift
+++ b/Library/UIKit/UIImage+ImageResource.swift
@@ -33,7 +33,7 @@ public extension UIImage {
 
    - returns: An image that exactly or best matches the desired traits with the given resource (R.image.*), or nil if no suitable image was found.
    */
-  public convenience init?(resource: ImageResourceType) {
+  convenience init?(resource: ImageResourceType) {
     self.init(named: resource.name)
   }
   #endif
diff --git a/R.swift.Library.xcodeproj/project.pbxproj b/R.swift.Library.xcodeproj/project.pbxproj
index bd72db7..b1ea7f0 100644
--- a/R.swift.Library.xcodeproj/project.pbxproj
+++ b/R.swift.Library.xcodeproj/project.pbxproj
@@ -402,28 +402,29 @@
 			isa = PBXProject;
 			attributes = {
 				LastSwiftUpdateCheck = 0720;
-				LastUpgradeCheck = 1000;
+				LastUpgradeCheck = 1100;
 				ORGANIZATIONNAME = "Mathijs Kadijk";
 				TargetAttributes = {
 					2F5FBC3F21355A1400A83A69 = {
 						CreatedOnToolsVersion = 10.0;
+						LastSwiftMigration = 1100;
 						ProvisioningStyle = Automatic;
 					};
 					806E69911C42BD9C00DE3A8B = {
 						CreatedOnToolsVersion = 7.2;
-						LastSwiftMigration = 0900;
+						LastSwiftMigration = 1020;
 					};
 					806E699A1C42BD9C00DE3A8B = {
 						CreatedOnToolsVersion = 7.2;
-						LastSwiftMigration = 0900;
+						LastSwiftMigration = 1020;
 					};
 					D592464D1C117A55007F94C7 = {
 						CreatedOnToolsVersion = 7.1.1;
-						LastSwiftMigration = 0900;
+						LastSwiftMigration = 1020;
 					};
 					D59246571C117A55007F94C7 = {
 						CreatedOnToolsVersion = 7.1.1;
-						LastSwiftMigration = 0900;
+						LastSwiftMigration = 1020;
 					};
 				};
 			};
@@ -432,6 +433,7 @@
 			developmentRegion = English;
 			hasScannedForEncodings = 0;
 			knownRegions = (
+				English,
 				en,
 			);
 			mainGroup = D59246441C117A54007F94C7;
@@ -638,7 +640,7 @@
 				SDKROOT = watchos;
 				SKIP_INSTALL = YES;
 				SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
-				SWIFT_VERSION = 4.2;
+				SWIFT_VERSION = 5.0;
 				TARGETED_DEVICE_FAMILY = 4;
 				WATCHOS_DEPLOYMENT_TARGET = 2.2;
 			};
@@ -669,7 +671,7 @@
 				PRODUCT_NAME = Rswift;
 				SDKROOT = watchos;
 				SKIP_INSTALL = YES;
-				SWIFT_VERSION = 4.2;
+				SWIFT_VERSION = 5.0;
 				TARGETED_DEVICE_FAMILY = 4;
 				WATCHOS_DEPLOYMENT_TARGET = 2.2;
 			};
@@ -691,7 +693,7 @@
 				PRODUCT_NAME = Rswift;
 				SDKROOT = appletvos;
 				SKIP_INSTALL = YES;
-				SWIFT_VERSION = 4.2;
+				SWIFT_VERSION = 5.0;
 				TARGETED_DEVICE_FAMILY = 3;
 				TVOS_DEPLOYMENT_TARGET = 9.0;
 			};
@@ -713,7 +715,7 @@
 				PRODUCT_NAME = Rswift;
 				SDKROOT = appletvos;
 				SKIP_INSTALL = YES;
-				SWIFT_VERSION = 4.2;
+				SWIFT_VERSION = 5.0;
 				TARGETED_DEVICE_FAMILY = 3;
 				TVOS_DEPLOYMENT_TARGET = 9.0;
 			};
@@ -727,7 +729,7 @@
 				PRODUCT_BUNDLE_IDENTIFIER = nl.mathijskadijk.RswiftTests;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SDKROOT = appletvos;
-				SWIFT_VERSION = 4.2;
+				SWIFT_VERSION = 5.0;
 				TVOS_DEPLOYMENT_TARGET = 9.1;
 			};
 			name = Debug;
@@ -740,7 +742,7 @@
 				PRODUCT_BUNDLE_IDENTIFIER = nl.mathijskadijk.RswiftTests;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SDKROOT = appletvos;
-				SWIFT_VERSION = 4.2;
+				SWIFT_VERSION = 5.0;
 				TVOS_DEPLOYMENT_TARGET = 9.1;
 			};
 			name = Release;
@@ -749,6 +751,7 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				ALWAYS_SEARCH_USER_PATHS = NO;
+				CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
 				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
 				CLANG_CXX_LIBRARY = "libc++";
 				CLANG_ENABLE_MODULES = YES;
@@ -807,6 +810,7 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				ALWAYS_SEARCH_USER_PATHS = NO;
+				CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
 				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
 				CLANG_CXX_LIBRARY = "libc++";
 				CLANG_ENABLE_MODULES = YES;
@@ -873,7 +877,7 @@
 				PRODUCT_NAME = Rswift;
 				SKIP_INSTALL = YES;
 				SWIFT_OPTIMIZATION_LEVEL = "-Onone";
-				SWIFT_VERSION = 4.2;
+				SWIFT_VERSION = 5.0;
 			};
 			name = Debug;
 		};
@@ -894,7 +898,7 @@
 				PRODUCT_BUNDLE_IDENTIFIER = nl.mathijskadijk.rswift.library;
 				PRODUCT_NAME = Rswift;
 				SKIP_INSTALL = YES;
-				SWIFT_VERSION = 4.2;
+				SWIFT_VERSION = 5.0;
 			};
 			name = Release;
 		};
@@ -905,7 +909,7 @@
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
 				PRODUCT_BUNDLE_IDENTIFIER = nl.mathijskadijk.RswiftTests;
 				PRODUCT_NAME = "$(TARGET_NAME)";
-				SWIFT_VERSION = 4.2;
+				SWIFT_VERSION = 5.0;
 			};
 			name = Debug;
 		};
@@ -916,7 +920,7 @@
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
 				PRODUCT_BUNDLE_IDENTIFIER = nl.mathijskadijk.RswiftTests;
 				PRODUCT_NAME = "$(TARGET_NAME)";
-				SWIFT_VERSION = 4.2;
+				SWIFT_VERSION = 5.0;
 			};
 			name = Release;
 		};
diff --git a/R.swift.Library.xcodeproj/xcshareddata/xcschemes/Rswift-iOS.xcscheme b/R.swift.Library.xcodeproj/xcshareddata/xcschemes/Rswift-iOS.xcscheme
index d317290..5d6d23f 100644
--- a/R.swift.Library.xcodeproj/xcshareddata/xcschemes/Rswift-iOS.xcscheme
+++ b/R.swift.Library.xcodeproj/xcshareddata/xcschemes/Rswift-iOS.xcscheme
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Scheme
-   LastUpgradeVersion = "1000"
+   LastUpgradeVersion = "1100"
    version = "1.3">
    <BuildAction
       parallelizeBuildables = "YES"
@@ -27,6 +27,15 @@
       selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
       selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
       shouldUseLaunchSchemeArgsEnv = "YES">
+      <MacroExpansion>
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "D592464D1C117A55007F94C7"
+            BuildableName = "Rswift.framework"
+            BlueprintName = "Rswift-iOS"
+            ReferencedContainer = "container:R.swift.Library.xcodeproj">
+         </BuildableReference>
+      </MacroExpansion>
       <Testables>
          <TestableReference
             skipped = "NO">
@@ -39,17 +48,6 @@
             </BuildableReference>
          </TestableReference>
       </Testables>
-      <MacroExpansion>
-         <BuildableReference
-            BuildableIdentifier = "primary"
-            BlueprintIdentifier = "D592464D1C117A55007F94C7"
-            BuildableName = "Rswift.framework"
-            BlueprintName = "Rswift-iOS"
-            ReferencedContainer = "container:R.swift.Library.xcodeproj">
-         </BuildableReference>
-      </MacroExpansion>
-      <AdditionalOptions>
-      </AdditionalOptions>
    </TestAction>
    <LaunchAction
       buildConfiguration = "Debug"
@@ -70,8 +68,6 @@
             ReferencedContainer = "container:R.swift.Library.xcodeproj">
          </BuildableReference>
       </MacroExpansion>
-      <AdditionalOptions>
-      </AdditionalOptions>
    </LaunchAction>
    <ProfileAction
       buildConfiguration = "Release"
diff --git a/R.swift.Library.xcodeproj/xcshareddata/xcschemes/Rswift-tvOS.xcscheme b/R.swift.Library.xcodeproj/xcshareddata/xcschemes/Rswift-tvOS.xcscheme
index 934b0e2..7e458d0 100644
--- a/R.swift.Library.xcodeproj/xcshareddata/xcschemes/Rswift-tvOS.xcscheme
+++ b/R.swift.Library.xcodeproj/xcshareddata/xcschemes/Rswift-tvOS.xcscheme
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Scheme
-   LastUpgradeVersion = "1000"
+   LastUpgradeVersion = "1100"
    version = "1.3">
    <BuildAction
       parallelizeBuildables = "YES"
@@ -27,6 +27,15 @@
       selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
       selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
       shouldUseLaunchSchemeArgsEnv = "YES">
+      <MacroExpansion>
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "806E69911C42BD9C00DE3A8B"
+            BuildableName = "Rswift.framework"
+            BlueprintName = "Rswift-tvOS"
+            ReferencedContainer = "container:R.swift.Library.xcodeproj">
+         </BuildableReference>
+      </MacroExpansion>
       <Testables>
          <TestableReference
             skipped = "NO">
@@ -39,17 +48,6 @@
             </BuildableReference>
          </TestableReference>
       </Testables>
-      <MacroExpansion>
-         <BuildableReference
-            BuildableIdentifier = "primary"
-            BlueprintIdentifier = "806E69911C42BD9C00DE3A8B"
-            BuildableName = "Rswift.framework"
-            BlueprintName = "Rswift-tvOS"
-            ReferencedContainer = "container:R.swift.Library.xcodeproj">
-         </BuildableReference>
-      </MacroExpansion>
-      <AdditionalOptions>
-      </AdditionalOptions>
    </TestAction>
    <LaunchAction
       buildConfiguration = "Debug"
@@ -70,8 +68,6 @@
             ReferencedContainer = "container:R.swift.Library.xcodeproj">
          </BuildableReference>
       </MacroExpansion>
-      <AdditionalOptions>
-      </AdditionalOptions>
    </LaunchAction>
    <ProfileAction
       buildConfiguration = "Release"

From aea06ee1d120d5ec548b92d818b93c6ff91d53cc Mon Sep 17 00:00:00 2001
From: takka <m@iladdr.es>
Date: Wed, 12 Jun 2019 18:10:22 +0900
Subject: [PATCH 09/29] Add support for Swift Package Manager

---
 Package.swift | 16 ++++++++++++++++
 Readme.md     |  9 +++++++++
 2 files changed, 25 insertions(+)
 create mode 100644 Package.swift

diff --git a/Package.swift b/Package.swift
new file mode 100644
index 0000000..5061087
--- /dev/null
+++ b/Package.swift
@@ -0,0 +1,16 @@
+// swift-tools-version:5.0
+
+import PackageDescription
+
+let package = Package(
+    name: "R.swift.Library",
+    platforms: [
+        .iOS(.v8)
+    ],
+    products: [
+        .library(name: "Rswift", targets: ["Rswift"])
+    ],
+    targets: [
+        .target(name: "Rswift", path: "Library")
+    ]
+)
diff --git a/Readme.md b/Readme.md
index 45bde32..e79efb8 100644
--- a/Readme.md
+++ b/Readme.md
@@ -20,6 +20,15 @@ _**Be aware:** If you just want to use R.swift follow the [installation instruct
 1. Add `github "mac-cain13/R.swift.Library"` to your [Cartfile](https://github.com/Carthage/Carthage/blob/master/Documentation/Artifacts.md#cartfile)
 2. Run `carthage`
 
+### Swift Package Manager (Requires Xcode 11)
+
+1. Open your Xcode project.
+2. Select `File > Swift Packages > Add Package Dependency...`
+3. Paste `https://github.com/mac-cain13/R.swift.Library` to the text field and click on the `Next` button.
+4. Choose appropriate version and click on the `Next` button. (If you need latest one, just click on the `Next` button.)
+5. Confirm that `Rswift` in the Package Product column is checked and your app's name is selected in the Add to Target column.
+6. Click on the `Next` button.
+
 ### Manually
 
 _As an embedded framework using git submodules._

From 2a7872dd772b00fe2ccd9d052d7a15703cb516ee Mon Sep 17 00:00:00 2001
From: Mathijs Kadijk <mkadijk@gmail.com>
Date: Thu, 4 Jul 2019 12:49:51 +0200
Subject: [PATCH 10/29] Preparing for the 5.1.0.alpha.1 release

---
 R.swift.Library.podspec | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/R.swift.Library.podspec b/R.swift.Library.podspec
index 10e7e44..a43329d 100644
--- a/R.swift.Library.podspec
+++ b/R.swift.Library.podspec
@@ -1,7 +1,7 @@
 Pod::Spec.new do |spec|
 
   spec.name         = "R.swift.Library"
-  spec.version      = "5.0.1"
+  spec.version      = "5.1.0.alpha.1"
   spec.license      = "MIT"
 
   spec.summary      = "Companion library for R.swift, featuring types used to type resources"

From 2390c803098b31ce657759b58376a846e4ef44d5 Mon Sep 17 00:00:00 2001
From: Rob Feldmann <me@robfeldmann.com>
Date: Sun, 28 Jul 2019 15:49:27 -0400
Subject: [PATCH 11/29] Add Additional Platforms to Package.swift

---
 Package.swift | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Package.swift b/Package.swift
index 5061087..cf94adc 100644
--- a/Package.swift
+++ b/Package.swift
@@ -5,7 +5,9 @@ import PackageDescription
 let package = Package(
     name: "R.swift.Library",
     platforms: [
-        .iOS(.v8)
+        .iOS(.v8),
+        .tvOS(.v9),
+        .watchOS(.v2),
     ],
     products: [
         .library(name: "Rswift", targets: ["Rswift"])

From 631e80fdec4719d997111f754328282a1e25ca97 Mon Sep 17 00:00:00 2001
From: Rob Feldmann <me@robfeldmann.com>
Date: Sun, 28 Jul 2019 15:49:51 -0400
Subject: [PATCH 12/29] Add .swiftpm to .gitignore

---
 .gitignore | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.gitignore b/.gitignore
index 8d04a5f..53a07cc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,3 +7,4 @@ fastlane/test_output
 fastlane/settoken.sh
 /build
 Carthage/Build
+.swiftpm
\ No newline at end of file

From 5c3d8de6aaf3a5207634811201fca7f339cca66c Mon Sep 17 00:00:00 2001
From: Tagayasu <ig7dpop0kbz6@gmail.com>
Date: Thu, 8 Aug 2019 16:14:31 +0900
Subject: [PATCH 13/29] Add WatchOS xcscheme

---
 .../xcschemes/Rswift-watchOS.xcscheme         | 80 +++++++++++++++++++
 1 file changed, 80 insertions(+)
 create mode 100644 R.swift.Library.xcodeproj/xcshareddata/xcschemes/Rswift-watchOS.xcscheme

diff --git a/R.swift.Library.xcodeproj/xcshareddata/xcschemes/Rswift-watchOS.xcscheme b/R.swift.Library.xcodeproj/xcshareddata/xcschemes/Rswift-watchOS.xcscheme
new file mode 100644
index 0000000..a5cfc2b
--- /dev/null
+++ b/R.swift.Library.xcodeproj/xcshareddata/xcschemes/Rswift-watchOS.xcscheme
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+   LastUpgradeVersion = "1030"
+   version = "1.3">
+   <BuildAction
+      parallelizeBuildables = "YES"
+      buildImplicitDependencies = "YES">
+      <BuildActionEntries>
+         <BuildActionEntry
+            buildForTesting = "YES"
+            buildForRunning = "YES"
+            buildForProfiling = "YES"
+            buildForArchiving = "YES"
+            buildForAnalyzing = "YES">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "2F5FBC3F21355A1400A83A69"
+               BuildableName = "Rswift.framework"
+               BlueprintName = "Rswift-watchOS"
+               ReferencedContainer = "container:R.swift.Library.xcodeproj">
+            </BuildableReference>
+         </BuildActionEntry>
+      </BuildActionEntries>
+   </BuildAction>
+   <TestAction
+      buildConfiguration = "Debug"
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      shouldUseLaunchSchemeArgsEnv = "YES">
+      <Testables>
+      </Testables>
+      <AdditionalOptions>
+      </AdditionalOptions>
+   </TestAction>
+   <LaunchAction
+      buildConfiguration = "Debug"
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      launchStyle = "0"
+      useCustomWorkingDirectory = "NO"
+      ignoresPersistentStateOnLaunch = "NO"
+      debugDocumentVersioning = "YES"
+      debugServiceExtension = "internal"
+      allowLocationSimulation = "YES">
+      <MacroExpansion>
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "2F5FBC3F21355A1400A83A69"
+            BuildableName = "Rswift.framework"
+            BlueprintName = "Rswift-watchOS"
+            ReferencedContainer = "container:R.swift.Library.xcodeproj">
+         </BuildableReference>
+      </MacroExpansion>
+      <AdditionalOptions>
+      </AdditionalOptions>
+   </LaunchAction>
+   <ProfileAction
+      buildConfiguration = "Release"
+      shouldUseLaunchSchemeArgsEnv = "YES"
+      savedToolIdentifier = ""
+      useCustomWorkingDirectory = "NO"
+      debugDocumentVersioning = "YES">
+      <MacroExpansion>
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "2F5FBC3F21355A1400A83A69"
+            BuildableName = "Rswift.framework"
+            BlueprintName = "Rswift-watchOS"
+            ReferencedContainer = "container:R.swift.Library.xcodeproj">
+         </BuildableReference>
+      </MacroExpansion>
+   </ProfileAction>
+   <AnalyzeAction
+      buildConfiguration = "Debug">
+   </AnalyzeAction>
+   <ArchiveAction
+      buildConfiguration = "Release"
+      revealArchiveInOrganizer = "YES">
+   </ArchiveAction>
+</Scheme>

From 398f0544f2382b8edb522eed079d31722d0f6ae4 Mon Sep 17 00:00:00 2001
From: Tom Lokhorst <tom@lokhorst.eu>
Date: Thu, 22 Aug 2019 11:08:43 +0200
Subject: [PATCH 14/29] Add swift_version to podspec

---
 .swift-version          | 1 -
 R.swift.Library.podspec | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)
 delete mode 100644 .swift-version

diff --git a/.swift-version b/.swift-version
deleted file mode 100644
index 5186d07..0000000
--- a/.swift-version
+++ /dev/null
@@ -1 +0,0 @@
-4.0
diff --git a/R.swift.Library.podspec b/R.swift.Library.podspec
index a43329d..98fcd8e 100644
--- a/R.swift.Library.podspec
+++ b/R.swift.Library.podspec
@@ -17,6 +17,7 @@ Pod::Spec.new do |spec|
 
   spec.requires_arc = true
   spec.source          = { :git => "https://github.com/mac-cain13/R.swift.Library.git", :tag => "v#{spec.version}" }
+  spec.swift_version   = "5.1"
 
   spec.pod_target_xcconfig = { 'APPLICATION_EXTENSION_API_ONLY' => 'YES' }
 

From 4a09ece7d0a30edcd95462ce7d252dd4d3a49843 Mon Sep 17 00:00:00 2001
From: Mathijs Kadijk <mkadijk@gmail.com>
Date: Tue, 22 Oct 2019 09:51:00 +0200
Subject: [PATCH 15/29] Preparing for the 5.1.0 release

---
 R.swift.Library.podspec | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/R.swift.Library.podspec b/R.swift.Library.podspec
index 98fcd8e..e899e61 100644
--- a/R.swift.Library.podspec
+++ b/R.swift.Library.podspec
@@ -1,7 +1,7 @@
 Pod::Spec.new do |spec|
 
   spec.name         = "R.swift.Library"
-  spec.version      = "5.1.0.alpha.1"
+  spec.version      = "5.1.0"
   spec.license      = "MIT"
 
   spec.summary      = "Companion library for R.swift, featuring types used to type resources"

From 0e05a90ef5ede3eef9e929b726c5f5dd73b5eac9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alex=20Rup=C3=A9rez?= <me@alexruperez.com>
Date: Sat, 29 Feb 2020 12:12:02 +0100
Subject: [PATCH 16/29] Alternative for SPM dynamic linking

We need [dynamic linking](https://github.com/apple/swift-package-manager/blob/master/Documentation/PackageDescription.md#methods-2) for this dependence.
---
 Package.swift | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Package.swift b/Package.swift
index cf94adc..eb962a0 100644
--- a/Package.swift
+++ b/Package.swift
@@ -10,7 +10,8 @@ let package = Package(
         .watchOS(.v2),
     ],
     products: [
-        .library(name: "Rswift", targets: ["Rswift"])
+        .library(name: "Rswift", targets: ["Rswift"]),
+        .library(name: "RswiftDynamic", type: .dynamic, targets: ["Rswift"])
     ],
     targets: [
         .target(name: "Rswift", path: "Library")

From 5a54805e3d08077e46edb2274ff27b20b700f568 Mon Sep 17 00:00:00 2001
From: Mathijs Kadijk <mkadijk@gmail.com>
Date: Wed, 22 Apr 2020 23:47:28 +0200
Subject: [PATCH 17/29] Preparing for the 5.2.0 release

---
 R.swift.Library.podspec | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/R.swift.Library.podspec b/R.swift.Library.podspec
index e899e61..502715c 100644
--- a/R.swift.Library.podspec
+++ b/R.swift.Library.podspec
@@ -1,7 +1,7 @@
 Pod::Spec.new do |spec|
 
   spec.name         = "R.swift.Library"
-  spec.version      = "5.1.0"
+  spec.version      = "5.2.0"
   spec.license      = "MIT"
 
   spec.summary      = "Companion library for R.swift, featuring types used to type resources"

From 68bdb3b5c6d156b941baa310a9b5f068353af7f7 Mon Sep 17 00:00:00 2001
From: Mathijs Kadijk <mkadijk@gmail.com>
Date: Sun, 26 Apr 2020 20:23:36 +0200
Subject: [PATCH 18/29] Create checks.yml

---
 .github/workflows/checks.yml | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 .github/workflows/checks.yml

diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml
new file mode 100644
index 0000000..aacf37f
--- /dev/null
+++ b/.github/workflows/checks.yml
@@ -0,0 +1,15 @@
+name: Checks
+
+on:
+  push:
+    branches: [ master ]
+  pull_request:
+    branches: '*'
+
+jobs:
+  build:
+    runs-on: macos-latest
+    steps:
+    - uses: actions/checkout@v2
+    - name: Build
+      run: swift build -v

From 426e902989e1eb51a0a8ab021f05c84a805be71f Mon Sep 17 00:00:00 2001
From: Mathijs Kadijk <mkadijk@gmail.com>
Date: Sun, 26 Apr 2020 20:36:39 +0200
Subject: [PATCH 19/29] Build all 3 schemes

---
 .github/workflows/checks.yml | 26 ++++++++++++++++++++++----
 1 file changed, 22 insertions(+), 4 deletions(-)

diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml
index aacf37f..c429dfa 100644
--- a/.github/workflows/checks.yml
+++ b/.github/workflows/checks.yml
@@ -1,4 +1,4 @@
-name: Checks
+name: Build
 
 on:
   push:
@@ -6,10 +6,28 @@ on:
   pull_request:
     branches: '*'
 
+env:
+  DEVELOPER_DIR: /Applications/Xcode_11.4.app/Contents/Developer
+
 jobs:
-  build:
+  iOS:
+    runs-on: macos-latest
+    steps:
+    - name: Checkout
+      uses: actions/checkout@v2
+    - name: Build
+      run: xcodebuild -scheme "Rswift-iOS"
+  tvOS:
+    runs-on: macos-latest
+    steps:
+    - name: Checkout
+      uses: actions/checkout@v2
+    - name: Build
+      run: xcodebuild -scheme "Rswift-tvOS"
+  watchOS:
     runs-on: macos-latest
     steps:
-    - uses: actions/checkout@v2
+    - name: Checkout
+      uses: actions/checkout@v2
     - name: Build
-      run: swift build -v
+      run: xcodebuild -scheme "Rswift-watchOS"
\ No newline at end of file

From ae47cf3a6fc03b44e178c5e2409d39ff473a6399 Mon Sep 17 00:00:00 2001
From: Mathijs Kadijk <mkadijk@gmail.com>
Date: Sun, 26 Apr 2020 20:48:27 +0200
Subject: [PATCH 20/29] Add Github Action for releases

---
 .github/workflows/release.yml                |  18 +++
 R.swift.Library.podspec                      |   2 +-
 fastlane/Fastfile                            |  98 ------------
 fastlane/actions/af_create_github_release.rb | 157 -------------------
 fastlane/actions/version_get_podspec.rb      | 107 -------------
 5 files changed, 19 insertions(+), 363 deletions(-)
 create mode 100644 .github/workflows/release.yml
 delete mode 100644 fastlane/Fastfile
 delete mode 100644 fastlane/actions/af_create_github_release.rb
 delete mode 100644 fastlane/actions/version_get_podspec.rb

diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..5e99626
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,18 @@
+name: Release
+
+on:
+  release:
+    types: created
+
+env:
+  DEVELOPER_DIR: /Applications/Xcode_11.4.app/Contents/Developer
+
+jobs:
+  publish:
+    - name: Publish to Cocoapods
+      run: |
+        export POD_VERSION=$(echo $TAG_NAME | cut -c2-)
+        pod trunk push
+      env:
+        TAG_NAME: ${{ github.event.release.tag_name }}
+        COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
diff --git a/R.swift.Library.podspec b/R.swift.Library.podspec
index 502715c..04fee50 100644
--- a/R.swift.Library.podspec
+++ b/R.swift.Library.podspec
@@ -1,7 +1,7 @@
 Pod::Spec.new do |spec|
 
   spec.name         = "R.swift.Library"
-  spec.version      = "5.2.0"
+  spec.version      = ENV['POD_VERSION']
   spec.license      = "MIT"
 
   spec.summary      = "Companion library for R.swift, featuring types used to type resources"
diff --git a/fastlane/Fastfile b/fastlane/Fastfile
deleted file mode 100644
index 5c2bb3b..0000000
--- a/fastlane/Fastfile
+++ /dev/null
@@ -1,98 +0,0 @@
-fastlane_version "1.86.0"
-
-lane :release do |options|
-  if options[:skip_branch_check] != true
-    ensure_git_branch(branch: "master")
-  end
-
-  if options[:allow_dirty_branch] != true
-    ensure_git_status_clean
-  else
-    UI.message "Skipping the 'git status clean' check!".yellow
-  end
-
-  git_pull
-
-  runalltests
-
-  unless is_ci
-    notification(
-      title: "R.swift.Library release",
-      message: "💡 Needs your attention."
-    )
-  end
-
-  currentVersion = version_get_podspec()
-  UI.message "Current R.swift.Library podspec version is #{currentVersion}"
-
-  bumpType = prompt(text: "What kind of release is this? (major/minor/patch/custom)".green, boolean: false, ci_input: "")
-  isPrerelease = false
-  case bumpType
-  when "major", "minor", "patch"
-    version_bump_podspec(bump_type: bumpType)
-  when "custom"
-    newVersion = prompt(text: "What is the new custom version number?".green, boolean: false, ci_input: "")
-    version_bump_podspec(version_number: newVersion)
-
-    isPrerelease = prompt(text: "Is this a prerelease version?".green, boolean: true, ci_input: "")
-  else
-    raise "Invalid release type: #{bumpType}".red
-  end
-
-  changelog = prompt(text: "Please provide release notes:".green, boolean: false, ci_input: "", multi_line_end_keyword: "FIN")
-
-  newVersion = version_get_podspec()
-  unless prompt(text: "#{newVersion} has been prepped for release. If you have any additional changes you would like to make, please do those before continuing. Would you like to commit, tag, push and release #{newVersion} including all uncommitted changes?".green, boolean: true, ci_input:"y")
-    raise "Aborted by user".red
-  end
-
-  git_commit(
-    path: ".",
-    message: "Preparing for the #{newVersion} release"
-  )
-
-  push_to_git_remote
-
-  af_create_github_release(
-    owner: "mac-cain13",
-    repository: "r.swift.library",
-    tag_name: "v#{newVersion}",
-    target_commitish: "master",
-    name: "#{newVersion}",
-    body: "#{changelog}",
-    prerelease: isPrerelease
-  )
-
-  pod_push
-
-  unless is_ci
-    notification(
-      title: "R.swift.Library release",
-      message: "🎉 Version #{newVersion} is released."
-    )
-  end
-end
-
-lane :runalltests do
-  scan(
-    project: "R.swift.Library.xcodeproj",
-    scheme: "Rswift-iOS",
-    device: "iPhone 8",
-    clean: true
-  )
-  scan(
-    project: "R.swift.Library.xcodeproj",
-    scheme: "Rswift-tvOS",
-    device: "Apple TV 4K",
-    clean: true
-  )
-end
-
-error do |lane, exception|
-  unless is_ci
-    notification(
-      title: "R.swift.Library #{lane}",
-      message: "❌ Failed with an exception."
-    )
-  end
-end
diff --git a/fastlane/actions/af_create_github_release.rb b/fastlane/actions/af_create_github_release.rb
deleted file mode 100644
index 55a6b5f..0000000
--- a/fastlane/actions/af_create_github_release.rb
+++ /dev/null
@@ -1,157 +0,0 @@
-# From: https://github.com/AFNetworking/fastlane/blob/master/fastlane/actions/af_create_github_release.rb
-module Fastlane
-  module Actions
-    module SharedValues
-      GITHUB_RELEASE_ID = :GITHUB_RELEASE_ID
-      GITHUB_RELEASE_HTML_URL = :GITHUB_RELEASE_HTML_URL
-      GITHUB_RELEASE_UPLOAD_URL_TEMPLATE = :GITHUB_RELEASE_UPLOAD_URL_TEMPLATE
-    end
-
-    # To share this integration with the other fastlane users:
-    # - Fork https://github.com/KrauseFx/fastlane
-    # - Clone the forked repository
-    # - Move this integration into lib/fastlane/actions
-    # - Commit, push and submit the pull request
-
-    class AfCreateGithubReleaseAction < Action
-      def self.run(params)
-        require 'net/http'
-        require 'net/https'
-        require 'json'
-        require 'base64'
-
-        begin
-          uri = URI("https://api.github.com/repos/#{params[:owner]}/#{params[:repository]}/releases")
-
-          # Create client
-          http = Net::HTTP.new(uri.host, uri.port)
-          http.use_ssl = true
-          http.verify_mode = OpenSSL::SSL::VERIFY_PEER
-          
-          dict = Hash.new
-          dict["draft"] = params[:draft] 
-          dict["prerelease"] = params[:prerelease]
-          dict["body"] = params[:body] if params[:body]
-          dict["tag_name"] = params[:tag_name] if params[:tag_name]
-          dict["name"] = params[:name] if params[:name]
-          body = JSON.dump(dict)
-
-          # Create Request
-          req =  Net::HTTP::Post.new(uri)
-          # Add headers
-          req.add_field "Content-Type", "application/json"
-          # Add headers
-          api_token = params[:api_token]
-          req.add_field "Authorization", "Basic #{Base64.strict_encode64(api_token)}"
-          # Add headers
-          req.add_field "Accept", "application/vnd.github.v3+json"
-          # Set header and body
-          req.add_field "Content-Type", "application/json"
-          req.body = body
-
-          # Fetch Request
-          res = http.request(req)
-        rescue StandardError => e
-          UI.message "HTTP Request failed (#{e.message})".red
-        end
-        
-        case res.code.to_i
-          when 201
-          json = JSON.parse(res.body)
-          UI.message "Github Release Created (#{json["id"]})".green
-          UI.message "#{json["html_url"]}".green
-          
-          Actions.lane_context[SharedValues::GITHUB_RELEASE_ID] = json["id"]
-          Actions.lane_context[SharedValues::GITHUB_RELEASE_HTML_URL] = json["html_url"]
-          Actions.lane_context[SharedValues::GITHUB_RELEASE_UPLOAD_URL_TEMPLATE] = json["upload_url"]
-          return json
-          when 400..499 
-          json = JSON.parse(res.body)
-          raise "Error Creating Github Release (#{res.code}): #{json}".red
-          else
-            UI.message "Status Code: #{res.code} Body: #{res.body}"
-          raise "Error Creating Github Release".red
-        end
-      end
-
-      #####################################################
-      # @!group Documentation
-      #####################################################
-
-      def self.description
-        "Create a Github Release"
-      end
-      
-      def self.available_options
-        [
-          FastlaneCore::ConfigItem.new(key: :owner,
-                                       env_name: "GITHUB_OWNER",
-                                       description: "The Github Owner",
-                                       is_string:true,
-                                       optional:false),
-           FastlaneCore::ConfigItem.new(key: :repository,
-                                        env_name: "GITHUB_REPOSITORY",
-                                        description: "The Github Repository",
-                                        is_string:true,
-                                        optional:false),
-          FastlaneCore::ConfigItem.new(key: :api_token,
-                                       env_name: "GITHUB_API_TOKEN",
-                                       description: "Personal API Token for GitHub - generate one at https://github.com/settings/tokens",
-                                       is_string: true,
-                                       optional: false),
-          FastlaneCore::ConfigItem.new(key: :tag_name,
-                                       env_name: "GITHUB_RELEASE_TAG_NAME",
-                                       description: "Pass in the tag name",
-                                       is_string: true,
-                                       optional: false),
-          FastlaneCore::ConfigItem.new(key: :target_commitish,
-                                       env_name: "GITHUB_TARGET_COMMITISH",
-                                       description: "Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists",
-                                       is_string: true,
-                                       optional: true),
-          FastlaneCore::ConfigItem.new(key: :name,
-                                       env_name: "GITHUB_RELEASE_NAME",
-                                       description: "The name of the release",
-                                       is_string: true,
-                                       optional: true),
-          FastlaneCore::ConfigItem.new(key: :body,
-                                       env_name: "GITHUB_RELEASE_BODY",
-                                       description: "Text describing the contents of the tag",
-                                       is_string: true,
-                                       optional: true),
-          FastlaneCore::ConfigItem.new(key: :draft,
-                                       env_name: "GITHUB_RELEASE_DRAFT",
-                                       description: "true to create a draft (unpublished) release, false to create a published one",
-                                       is_string: false,
-                                       default_value: false),                                       
-          FastlaneCore::ConfigItem.new(key: :prerelease,
-                                       env_name: "GITHUB_RELEASE_PRERELEASE",
-                                       description: "true to identify the release as a prerelease. false to identify the release as a full release",
-                                       is_string: false,
-                                       default_value: false),                                       
-                                       
-        ]
-      end
-
-      def self.output
-        [
-          ['GITHUB_RELEASE_ID', 'The Github Release ID'],
-          ['GITHUB_RELEASE_HTML_URL', 'The Github Release URL'],
-          ['GITHUB_RELEASE_UPLOAD_URL_TEMPLATE', 'The Github Release Upload URL']
-        ]
-      end
-
-      def self.return_value
-        "The Hash representing the API response"
-      end
-
-      def self.authors
-        ["kcharwood"]
-      end
-
-      def self.is_supported?(platform)
-        return true
-      end
-    end
-  end
-end
\ No newline at end of file
diff --git a/fastlane/actions/version_get_podspec.rb b/fastlane/actions/version_get_podspec.rb
deleted file mode 100644
index b2d82f1..0000000
--- a/fastlane/actions/version_get_podspec.rb
+++ /dev/null
@@ -1,107 +0,0 @@
-module Fastlane
-  module Actions
-    class VersionGetPodspecAction < Action
-      def self.run(params)
-        podspec_path = params[:path]
-
-        UI.user_error!("Could not find podspec file at path '#{podspec_path}'") unless File.exist? podspec_path
-
-        version_podspec_file = PodspecHelper.new(podspec_path)
-
-        Actions.lane_context[SharedValues::PODSPEC_VERSION_NUMBER] = version_podspec_file.version_value
-      end
-
-      #####################################################
-      # @!group Documentation
-      #####################################################
-
-      def self.description
-        "Receive the version number from a podspec file"
-      end
-
-      def self.available_options
-        [
-          FastlaneCore::ConfigItem.new(key: :path,
-                                       env_name: "FL_VERSION_PODSPEC_PATH",
-                                       description: "You must specify the path to the podspec file",
-                                       is_string: true,
-                                       default_value: Dir["*.podspec"].last,
-                                       verify_block: proc do |value|
-                                         UI.user_error!("Please pass a path to the `version_get_podspec` action") if value.length == 0
-                                       end)
-        ]
-      end
-
-      def self.output
-        [
-          ['PODSPEC_VERSION_NUMBER', 'The podspec version number']
-        ]
-      end
-
-      def self.authors
-        ["Liquidsoul", "KrauseFx"]
-      end
-
-      def self.is_supported?(platform)
-        true
-      end
-    end
-
-    class PodspecHelper
-      attr_accessor :path
-      attr_accessor :podspec_content
-      attr_accessor :version_regex
-      attr_accessor :version_match
-      attr_accessor :version_value
-
-      def initialize(path = nil)
-        version_var_name = 'version'
-        @version_regex = /^(?<begin>[^#]*#{version_var_name}\s*=\s*['"])(?<value>(?<major>[0-9]+)(\.(?<minor>[0-9]+))?(\.(?<patch>[0-9]+))?(\.(?<type>[a-z]+))?(\.(?<buildnumber>[0-9]+))?)(?<end>['"])/i
-
-        return unless (path || '').length > 0
-        UI.user_error!("Could not find podspec file at path '#{path}'") unless File.exist?(path)
-
-        @path = File.expand_path(path)
-        podspec_content = File.read(path)
-
-        parse(podspec_content)
-      end
-
-      def parse(podspec_content)
-        @podspec_content = podspec_content
-        @version_match = @version_regex.match(@podspec_content)
-        UI.user_error!("AAAAAH!!! Could not find version in podspec content '#{@podspec_content}'") if @version_match.nil?
-        @version_value = @version_match[:value]
-      end
-
-      def bump_version(bump_type)
-        major = version_match[:major].to_i
-        minor = version_match[:minor].to_i || 0
-        patch = version_match[:patch].to_i || 0
-
-        case bump_type
-        when 'patch'
-          patch += 1
-        when 'minor'
-          minor += 1
-          patch = 0
-        when 'major'
-          major += 1
-          minor = 0
-          patch = 0
-        end
-
-        @version_value = "#{major}.#{minor}.#{patch}"
-      end
-
-      def update_podspec(version = nil)
-        new_version = version || @version_value
-        updated_podspec_content = @podspec_content.gsub(@version_regex, "#{@version_match[:begin]}#{new_version}#{@version_match[:end]}")
-
-        File.open(@path, "w") { |file| file.puts updated_podspec_content } unless Helper.test?
-
-        updated_podspec_content
-      end
-    end
-  end
-end

From 6d6d67dd7230bfff810ebf8f1a4b0670e8532e3e Mon Sep 17 00:00:00 2001
From: Filip Bajanik <filip.bajanik@gmail.com>
Date: Fri, 30 Oct 2020 15:30:38 +0100
Subject: [PATCH 21/29] Add support for SPM with WatchOS platform

---
 Library/UIKit/NibResource+UIKit.swift                           | 2 ++
 .../UIKit/StoryboardResourceWithInitialController+UIKit.swift   | 2 ++
 Library/UIKit/TypedStoryboardSegueInfo+UIStoryboardSegue.swift  | 2 ++
 Library/UIKit/UICollectionView+ReuseIdentifierProtocol.swift    | 2 ++
 Library/UIKit/UINib+NibResource.swift                           | 2 ++
 Library/UIKit/UIStoryboard+StoryboardResource.swift             | 2 ++
 .../UIKit/UIStoryboard+StoryboardViewControllerResource.swift   | 2 ++
 Library/UIKit/UITableView+ReuseIdentifierProtocol.swift         | 2 ++
 Library/UIKit/UIViewController+NibResource.swift                | 2 ++
 .../UIViewController+StoryboardSegueIdentifierProtocol.swift    | 2 ++
 10 files changed, 20 insertions(+)

diff --git a/Library/UIKit/NibResource+UIKit.swift b/Library/UIKit/NibResource+UIKit.swift
index 4339d3f..2875cc5 100644
--- a/Library/UIKit/NibResource+UIKit.swift
+++ b/Library/UIKit/NibResource+UIKit.swift
@@ -7,6 +7,7 @@
 //  License: MIT License
 //
 
+#if !os(watchOS)
 import Foundation
 import UIKit
 
@@ -23,3 +24,4 @@ public extension NibResourceType {
     return UINib(resource: self).instantiate(withOwner: ownerOrNil, options: optionsOrNil)
   }
 }
+#endif
diff --git a/Library/UIKit/StoryboardResourceWithInitialController+UIKit.swift b/Library/UIKit/StoryboardResourceWithInitialController+UIKit.swift
index b5b114c..4ba1902 100644
--- a/Library/UIKit/StoryboardResourceWithInitialController+UIKit.swift
+++ b/Library/UIKit/StoryboardResourceWithInitialController+UIKit.swift
@@ -7,6 +7,7 @@
 //  License: MIT License
 //
 
+#if !os(watchOS)
 import Foundation
 import UIKit
 
@@ -20,3 +21,4 @@ public extension StoryboardResourceWithInitialControllerType {
     return UIStoryboard(resource: self).instantiateInitialViewController() as? InitialController
   }
 }
+#endif
diff --git a/Library/UIKit/TypedStoryboardSegueInfo+UIStoryboardSegue.swift b/Library/UIKit/TypedStoryboardSegueInfo+UIStoryboardSegue.swift
index 5edd9be..894c8c2 100644
--- a/Library/UIKit/TypedStoryboardSegueInfo+UIStoryboardSegue.swift
+++ b/Library/UIKit/TypedStoryboardSegueInfo+UIStoryboardSegue.swift
@@ -7,6 +7,7 @@
 //  License: MIT License
 //
 
+#if !os(watchOS)
 import Foundation
 import UIKit
 
@@ -33,3 +34,4 @@ extension TypedStoryboardSegueInfo {
     self.destination = destination
   }
 }
+#endif
diff --git a/Library/UIKit/UICollectionView+ReuseIdentifierProtocol.swift b/Library/UIKit/UICollectionView+ReuseIdentifierProtocol.swift
index bf68fa1..ebac685 100644
--- a/Library/UIKit/UICollectionView+ReuseIdentifierProtocol.swift
+++ b/Library/UIKit/UICollectionView+ReuseIdentifierProtocol.swift
@@ -7,6 +7,7 @@
 //  License: MIT License
 //
 
+#if !os(watchOS)
 import Foundation
 import UIKit
 
@@ -62,3 +63,4 @@ public extension UICollectionView {
     register(UINib(resource: nibResource), forSupplementaryViewOfKind: kind, withReuseIdentifier: nibResource.identifier)
   }
 }
+#endif
diff --git a/Library/UIKit/UINib+NibResource.swift b/Library/UIKit/UINib+NibResource.swift
index 73bb048..8aaa0fd 100644
--- a/Library/UIKit/UINib+NibResource.swift
+++ b/Library/UIKit/UINib+NibResource.swift
@@ -7,6 +7,7 @@
 //  License: MIT License
 //
 
+#if !os(watchOS)
 import UIKit
 
 public extension UINib {
@@ -21,3 +22,4 @@ public extension UINib {
     self.init(nibName: resource.name, bundle: resource.bundle)
   }
 }
+#endif
diff --git a/Library/UIKit/UIStoryboard+StoryboardResource.swift b/Library/UIKit/UIStoryboard+StoryboardResource.swift
index 8848be0..1ed8015 100644
--- a/Library/UIKit/UIStoryboard+StoryboardResource.swift
+++ b/Library/UIKit/UIStoryboard+StoryboardResource.swift
@@ -7,6 +7,7 @@
 //  License: MIT License
 //
 
+#if !os(watchOS)
 import UIKit
 
 public extension UIStoryboard {
@@ -21,3 +22,4 @@ public extension UIStoryboard {
     self.init(name: resource.name, bundle: resource.bundle)
   }
 }
+#endif
diff --git a/Library/UIKit/UIStoryboard+StoryboardViewControllerResource.swift b/Library/UIKit/UIStoryboard+StoryboardViewControllerResource.swift
index 59adab3..75c61f0 100644
--- a/Library/UIKit/UIStoryboard+StoryboardViewControllerResource.swift
+++ b/Library/UIKit/UIStoryboard+StoryboardViewControllerResource.swift
@@ -7,6 +7,7 @@
 //  License: MIT License
 //
 
+#if !os(watchOS)
 import Foundation
 import UIKit
 
@@ -22,3 +23,4 @@ public extension UIStoryboard {
     return self.instantiateViewController(withIdentifier: resource.identifier) as? ViewControllerResource.ViewControllerType
   }
 }
+#endif
diff --git a/Library/UIKit/UITableView+ReuseIdentifierProtocol.swift b/Library/UIKit/UITableView+ReuseIdentifierProtocol.swift
index 10d4b4f..aa6589e 100644
--- a/Library/UIKit/UITableView+ReuseIdentifierProtocol.swift
+++ b/Library/UIKit/UITableView+ReuseIdentifierProtocol.swift
@@ -7,6 +7,7 @@
 //  License: MIT License
 //
 
+#if !os(watchOS)
 import Foundation
 import UIKit
 
@@ -65,3 +66,4 @@ public extension UITableView {
     register(UINib(resource: nibResource), forHeaderFooterViewReuseIdentifier: nibResource.identifier)
   }
 }
+#endif
diff --git a/Library/UIKit/UIViewController+NibResource.swift b/Library/UIKit/UIViewController+NibResource.swift
index dbef8ce..717bd09 100644
--- a/Library/UIKit/UIViewController+NibResource.swift
+++ b/Library/UIKit/UIViewController+NibResource.swift
@@ -7,6 +7,7 @@
 //  License: MIT License
 //
 
+#if !os(watchOS)
 import Foundation
 import UIKit
 
@@ -22,3 +23,4 @@ public extension UIViewController {
     self.init(nibName: nib.name, bundle: nib.bundle)
   }
 }
+#endif
diff --git a/Library/UIKit/UIViewController+StoryboardSegueIdentifierProtocol.swift b/Library/UIKit/UIViewController+StoryboardSegueIdentifierProtocol.swift
index 27364a4..e7aff99 100644
--- a/Library/UIKit/UIViewController+StoryboardSegueIdentifierProtocol.swift
+++ b/Library/UIKit/UIViewController+StoryboardSegueIdentifierProtocol.swift
@@ -7,6 +7,7 @@
 //  License: MIT License
 //
 
+#if !os(watchOS)
 import Foundation
 import UIKit
 
@@ -37,3 +38,4 @@ public extension StoryboardSegue where Source : UIViewController {
     source.performSegue(withIdentifier: identifier.identifier, sender: sender)
   }
 }
+#endif

From 9c5bfffdd25017a46db73fa9130a7f8cdd19355b Mon Sep 17 00:00:00 2001
From: Tom Lokhorst <tom@lokhorst.eu>
Date: Sun, 8 Nov 2020 13:52:24 +0100
Subject: [PATCH 22/29] Update to iOS 9 mimimum deployment target

---
 R.swift.Library.podspec | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/R.swift.Library.podspec b/R.swift.Library.podspec
index 04fee50..deb7a79 100644
--- a/R.swift.Library.podspec
+++ b/R.swift.Library.podspec
@@ -21,7 +21,7 @@ Pod::Spec.new do |spec|
 
   spec.pod_target_xcconfig = { 'APPLICATION_EXTENSION_API_ONLY' => 'YES' }
 
-  spec.ios.deployment_target     = '8.0'
+  spec.ios.deployment_target     = '9.0'
   spec.ios.source_files  = "Library/**/*.swift"
   spec.tvos.deployment_target    = '9.0'
   spec.tvos.source_files  = "Library/**/*.swift"

From f035187047cd6d80394b55ede2d6ff7e24509e07 Mon Sep 17 00:00:00 2001
From: Tom Lokhorst <tom@lokhorst.eu>
Date: Sun, 8 Nov 2020 13:58:37 +0100
Subject: [PATCH 23/29] Update Package.swift

---
 Package.swift | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Package.swift b/Package.swift
index eb962a0..a7e2267 100644
--- a/Package.swift
+++ b/Package.swift
@@ -5,7 +5,7 @@ import PackageDescription
 let package = Package(
     name: "R.swift.Library",
     platforms: [
-        .iOS(.v8),
+        .iOS(.v9),
         .tvOS(.v9),
         .watchOS(.v2),
     ],

From 033c150e8a0fd209f0801b7e3753c89a5ac2bbf9 Mon Sep 17 00:00:00 2001
From: Mathijs Kadijk <mkadijk@gmail.com>
Date: Sun, 8 Nov 2020 14:02:32 +0100
Subject: [PATCH 24/29] Fix syntax error in release action

---
 .github/workflows/release.yml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 5e99626..499eab0 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -9,6 +9,8 @@ env:
 
 jobs:
   publish:
+    runs-on: macos-latest
+    steps:
     - name: Publish to Cocoapods
       run: |
         export POD_VERSION=$(echo $TAG_NAME | cut -c2-)

From 5025163d8f60d3c56124c309db0246ba421aa8c6 Mon Sep 17 00:00:00 2001
From: Mathijs Kadijk <mkadijk@gmail.com>
Date: Sun, 8 Nov 2020 14:11:56 +0100
Subject: [PATCH 25/29] Add checkout step to release

---
 .github/workflows/release.yml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 499eab0..76a27a3 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -11,6 +11,8 @@ jobs:
   publish:
     runs-on: macos-latest
     steps:
+    - name: Checkout
+      uses: actions/checkout@v2
     - name: Publish to Cocoapods
       run: |
         export POD_VERSION=$(echo $TAG_NAME | cut -c2-)

From 3a64127e8113cc33179504dfadc91b361d55a0b1 Mon Sep 17 00:00:00 2001
From: Tom Lokhorst <tom@lokhorst.eu>
Date: Fri, 5 Mar 2021 12:30:22 +0100
Subject: [PATCH 26/29] Update developer dir

---
 .github/workflows/checks.yml  | 4 ++--
 .github/workflows/release.yml | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml
index c429dfa..5eec115 100644
--- a/.github/workflows/checks.yml
+++ b/.github/workflows/checks.yml
@@ -7,7 +7,7 @@ on:
     branches: '*'
 
 env:
-  DEVELOPER_DIR: /Applications/Xcode_11.4.app/Contents/Developer
+  DEVELOPER_DIR: /Applications/Xcode_12.4.app/Contents/Developer
 
 jobs:
   iOS:
@@ -30,4 +30,4 @@ jobs:
     - name: Checkout
       uses: actions/checkout@v2
     - name: Build
-      run: xcodebuild -scheme "Rswift-watchOS"
\ No newline at end of file
+      run: xcodebuild -scheme "Rswift-watchOS"
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 76a27a3..ebf96c1 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -5,7 +5,7 @@ on:
     types: created
 
 env:
-  DEVELOPER_DIR: /Applications/Xcode_11.4.app/Contents/Developer
+  DEVELOPER_DIR: /Applications/Xcode_12.4.app/Contents/Developer
 
 jobs:
   publish:

From 0e49aa2fac18601585cf16fb24c018362ac59b5c Mon Sep 17 00:00:00 2001
From: Tom Lokhorst <tom@lokhorst.eu>
Date: Fri, 28 Oct 2022 18:01:15 +0200
Subject: [PATCH 27/29] Update minimum deployment target

---
 R.swift.Library.podspec | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/R.swift.Library.podspec b/R.swift.Library.podspec
index deb7a79..1059a9d 100644
--- a/R.swift.Library.podspec
+++ b/R.swift.Library.podspec
@@ -17,15 +17,15 @@ Pod::Spec.new do |spec|
 
   spec.requires_arc = true
   spec.source          = { :git => "https://github.com/mac-cain13/R.swift.Library.git", :tag => "v#{spec.version}" }
-  spec.swift_version   = "5.1"
+  spec.swift_version   = "5.7"
 
   spec.pod_target_xcconfig = { 'APPLICATION_EXTENSION_API_ONLY' => 'YES' }
 
-  spec.ios.deployment_target     = '9.0'
+  spec.ios.deployment_target     = '11.0'
   spec.ios.source_files  = "Library/**/*.swift"
-  spec.tvos.deployment_target    = '9.0'
+  spec.tvos.deployment_target    = '11.0'
   spec.tvos.source_files  = "Library/**/*.swift"
-  spec.watchos.deployment_target = '2.2'
+  spec.watchos.deployment_target = '4.0'
   spec.watchos.source_files  = ["Library/Core/*.swift", "Library/Foundation/*.swift"]
 
   spec.module_name   = "Rswift"

From 4d9815250b2da7ded94ba3936a83d88f5ddfdb0e Mon Sep 17 00:00:00 2001
From: Tom Lokhorst <tom@lokhorst.eu>
Date: Fri, 28 Oct 2022 18:02:13 +0200
Subject: [PATCH 28/29] Keep swift version

---
 R.swift.Library.podspec | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/R.swift.Library.podspec b/R.swift.Library.podspec
index 1059a9d..9c9a766 100644
--- a/R.swift.Library.podspec
+++ b/R.swift.Library.podspec
@@ -17,7 +17,7 @@ Pod::Spec.new do |spec|
 
   spec.requires_arc = true
   spec.source          = { :git => "https://github.com/mac-cain13/R.swift.Library.git", :tag => "v#{spec.version}" }
-  spec.swift_version   = "5.7"
+  spec.swift_version   = "5.1"
 
   spec.pod_target_xcconfig = { 'APPLICATION_EXTENSION_API_ONLY' => 'YES' }
 

From bb1ec7e294f7ef6ac0ba072371ae8af5b4342545 Mon Sep 17 00:00:00 2001
From: Tom Lokhorst <tom@lokhorst.eu>
Date: Tue, 29 Nov 2022 00:20:16 +0100
Subject: [PATCH 29/29] Update Readme.md

---
 Readme.md | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Readme.md b/Readme.md
index e79efb8..4180ed7 100644
--- a/Readme.md
+++ b/Readme.md
@@ -1,6 +1,8 @@
 # R.swift.Library [![Version](https://img.shields.io/cocoapods/v/R.swift.Library.svg?style=flat)](https://cocoapods.org/pods/R.swift) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![License](https://img.shields.io/cocoapods/l/R.swift.Library.svg?style=flat)](blob/master/License) ![Platform](https://img.shields.io/cocoapods/p/R.swift.Library.svg?style=flat)
 
-_Library containing types supporting code generated by [R.swift](https://github.com/mac-cain13/R.swift)_
+⚠ As of version 7 of [R.swift](https://github.com/mac-cain13/R.swift), this separate library is no longer needed. R.swift is now a self contained library. 
+
+This repository remains for older versions of R.swift.
 
 ## Why use this?