on master help sign in
Add example
commitbc3546c55b6753a08d20833fe10172e1a6f8ef28 authorLouis D'hauwe <louisdhauwe@silverfox.be> dateMon 2 Apr 2018, 16:53 (9 years ago) parent77bcefa
11 files changed+889
Example/Example.xcodeproj/project.pbxproj+359 Example/Example/AppDelegate.swift+46 Example/Example/Assets.xcassets/AppIcon.appiconset/Contents.json+98 Example/Example/Assets.xcassets/Contents.json+6 Example/Example/Base.lproj/LaunchScreen.storyboard+25 Example/Example/Base.lproj/Main.storyboard+206 Example/Example/Info.plist+45 Example/Example/ViewController.swift+84 HueKit.xcodeproj/project.pbxproj+2 HueKit.xcworkspace/contents.xcworkspacedata+10 HueKit.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist+8
Example/Example.xcodeproj/project.pbxprojnew file+359
@@ -0,0 +1,359 @@
1+// !$*UTF8*$!
2+{
3+ archiveVersion = 1;
4+ classes = {
5+ };
6+ objectVersion = 50;
7+ objects = {
8+
9+/* Begin PBXBuildFile section */
10+ BEB7754C207267E400201EBB /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = BEB7754B207267E400201EBB /* AppDelegate.swift */; };
11+ BEB7754E207267E400201EBB /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BEB7754D207267E400201EBB /* ViewController.swift */; };
12+ BEB77551207267E400201EBB /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BEB7754F207267E400201EBB /* Main.storyboard */; };
13+ BEB77553207267E500201EBB /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BEB77552207267E500201EBB /* Assets.xcassets */; };
14+ BEB77556207267E500201EBB /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BEB77554207267E500201EBB /* LaunchScreen.storyboard */; };
15+ BEB7755E207267F800201EBB /* HueKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BEB7755D207267F800201EBB /* HueKit.framework */; };
16+ BEB7755F207267F800201EBB /* HueKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = BEB7755D207267F800201EBB /* HueKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
17+/* End PBXBuildFile section */
18+
19+/* Begin PBXCopyFilesBuildPhase section */
20+ BEB77560207267F800201EBB /* Embed Frameworks */ = {
21+ isa = PBXCopyFilesBuildPhase;
22+ buildActionMask = 2147483647;
23+ dstPath = "";
24+ dstSubfolderSpec = 10;
25+ files = (
26+ BEB7755F207267F800201EBB /* HueKit.framework in Embed Frameworks */,
27+ );
28+ name = "Embed Frameworks";
29+ runOnlyForDeploymentPostprocessing = 0;
30+ };
31+/* End PBXCopyFilesBuildPhase section */
32+
33+/* Begin PBXFileReference section */
34+ BEB77548207267E400201EBB /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
35+ BEB7754B207267E400201EBB /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
36+ BEB7754D207267E400201EBB /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
37+ BEB77550207267E400201EBB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
38+ BEB77552207267E500201EBB /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
39+ BEB77555207267E500201EBB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
40+ BEB77557207267E500201EBB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
41+ BEB7755D207267F800201EBB /* HueKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = HueKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
42+/* End PBXFileReference section */
43+
44+/* Begin PBXFrameworksBuildPhase section */
45+ BEB77545207267E400201EBB /* Frameworks */ = {
46+ isa = PBXFrameworksBuildPhase;
47+ buildActionMask = 2147483647;
48+ files = (
49+ BEB7755E207267F800201EBB /* HueKit.framework in Frameworks */,
50+ );
51+ runOnlyForDeploymentPostprocessing = 0;
52+ };
53+/* End PBXFrameworksBuildPhase section */
54+
55+/* Begin PBXGroup section */
56+ BEB7753F207267E400201EBB = {
57+ isa = PBXGroup;
58+ children = (
59+ BEB7755D207267F800201EBB /* HueKit.framework */,
60+ BEB7754A207267E400201EBB /* Example */,
61+ BEB77549207267E400201EBB /* Products */,
62+ );
63+ sourceTree = "<group>";
64+ };
65+ BEB77549207267E400201EBB /* Products */ = {
66+ isa = PBXGroup;
67+ children = (
68+ BEB77548207267E400201EBB /* Example.app */,
69+ );
70+ name = Products;
71+ sourceTree = "<group>";
72+ };
73+ BEB7754A207267E400201EBB /* Example */ = {
74+ isa = PBXGroup;
75+ children = (
76+ BEB7754B207267E400201EBB /* AppDelegate.swift */,
77+ BEB7754D207267E400201EBB /* ViewController.swift */,
78+ BEB7754F207267E400201EBB /* Main.storyboard */,
79+ BEB77552207267E500201EBB /* Assets.xcassets */,
80+ BEB77554207267E500201EBB /* LaunchScreen.storyboard */,
81+ BEB77557207267E500201EBB /* Info.plist */,
82+ );
83+ path = Example;
84+ sourceTree = "<group>";
85+ };
86+/* End PBXGroup section */
87+
88+/* Begin PBXNativeTarget section */
89+ BEB77547207267E400201EBB /* Example */ = {
90+ isa = PBXNativeTarget;
91+ buildConfigurationList = BEB7755A207267E500201EBB /* Build configuration list for PBXNativeTarget "Example" */;
92+ buildPhases = (
93+ BEB77544207267E400201EBB /* Sources */,
94+ BEB77545207267E400201EBB /* Frameworks */,
95+ BEB77546207267E400201EBB /* Resources */,
96+ BEB77560207267F800201EBB /* Embed Frameworks */,
97+ );
98+ buildRules = (
99+ );
100+ dependencies = (
101+ );
102+ name = Example;
103+ productName = Example;
104+ productReference = BEB77548207267E400201EBB /* Example.app */;
105+ productType = "com.apple.product-type.application";
106+ };
107+/* End PBXNativeTarget section */
108+
109+/* Begin PBXProject section */
110+ BEB77540207267E400201EBB /* Project object */ = {
111+ isa = PBXProject;
112+ attributes = {
113+ LastSwiftUpdateCheck = 0930;
114+ LastUpgradeCheck = 0930;
115+ ORGANIZATIONNAME = "Silver Fox";
116+ TargetAttributes = {
117+ BEB77547207267E400201EBB = {
118+ CreatedOnToolsVersion = 9.3;
119+ };
120+ };
121+ };
122+ buildConfigurationList = BEB77543207267E400201EBB /* Build configuration list for PBXProject "Example" */;
123+ compatibilityVersion = "Xcode 9.3";
124+ developmentRegion = en;
125+ hasScannedForEncodings = 0;
126+ knownRegions = (
127+ en,
128+ Base,
129+ );
130+ mainGroup = BEB7753F207267E400201EBB;
131+ productRefGroup = BEB77549207267E400201EBB /* Products */;
132+ projectDirPath = "";
133+ projectRoot = "";
134+ targets = (
135+ BEB77547207267E400201EBB /* Example */,
136+ );
137+ };
138+/* End PBXProject section */
139+
140+/* Begin PBXResourcesBuildPhase section */
141+ BEB77546207267E400201EBB /* Resources */ = {
142+ isa = PBXResourcesBuildPhase;
143+ buildActionMask = 2147483647;
144+ files = (
145+ BEB77556207267E500201EBB /* LaunchScreen.storyboard in Resources */,
146+ BEB77553207267E500201EBB /* Assets.xcassets in Resources */,
147+ BEB77551207267E400201EBB /* Main.storyboard in Resources */,
148+ );
149+ runOnlyForDeploymentPostprocessing = 0;
150+ };
151+/* End PBXResourcesBuildPhase section */
152+
153+/* Begin PBXSourcesBuildPhase section */
154+ BEB77544207267E400201EBB /* Sources */ = {
155+ isa = PBXSourcesBuildPhase;
156+ buildActionMask = 2147483647;
157+ files = (
158+ BEB7754E207267E400201EBB /* ViewController.swift in Sources */,
159+ BEB7754C207267E400201EBB /* AppDelegate.swift in Sources */,
160+ );
161+ runOnlyForDeploymentPostprocessing = 0;
162+ };
163+/* End PBXSourcesBuildPhase section */
164+
165+/* Begin PBXVariantGroup section */
166+ BEB7754F207267E400201EBB /* Main.storyboard */ = {
167+ isa = PBXVariantGroup;
168+ children = (
169+ BEB77550207267E400201EBB /* Base */,
170+ );
171+ name = Main.storyboard;
172+ sourceTree = "<group>";
173+ };
174+ BEB77554207267E500201EBB /* LaunchScreen.storyboard */ = {
175+ isa = PBXVariantGroup;
176+ children = (
177+ BEB77555207267E500201EBB /* Base */,
178+ );
179+ name = LaunchScreen.storyboard;
180+ sourceTree = "<group>";
181+ };
182+/* End PBXVariantGroup section */
183+
184+/* Begin XCBuildConfiguration section */
185+ BEB77558207267E500201EBB /* Debug */ = {
186+ isa = XCBuildConfiguration;
187+ buildSettings = {
188+ ALWAYS_SEARCH_USER_PATHS = NO;
189+ CLANG_ANALYZER_NONNULL = YES;
190+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
191+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
192+ CLANG_CXX_LIBRARY = "libc++";
193+ CLANG_ENABLE_MODULES = YES;
194+ CLANG_ENABLE_OBJC_ARC = YES;
195+ CLANG_ENABLE_OBJC_WEAK = YES;
196+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
197+ CLANG_WARN_BOOL_CONVERSION = YES;
198+ CLANG_WARN_COMMA = YES;
199+ CLANG_WARN_CONSTANT_CONVERSION = YES;
200+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
201+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
202+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
203+ CLANG_WARN_EMPTY_BODY = YES;
204+ CLANG_WARN_ENUM_CONVERSION = YES;
205+ CLANG_WARN_INFINITE_RECURSION = YES;
206+ CLANG_WARN_INT_CONVERSION = YES;
207+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
208+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
209+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
210+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
211+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
212+ CLANG_WARN_STRICT_PROTOTYPES = YES;
213+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
214+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
215+ CLANG_WARN_UNREACHABLE_CODE = YES;
216+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
217+ CODE_SIGN_IDENTITY = "iPhone Developer";
218+ COPY_PHASE_STRIP = NO;
219+ DEBUG_INFORMATION_FORMAT = dwarf;
220+ ENABLE_STRICT_OBJC_MSGSEND = YES;
221+ ENABLE_TESTABILITY = YES;
222+ GCC_C_LANGUAGE_STANDARD = gnu11;
223+ GCC_DYNAMIC_NO_PIC = NO;
224+ GCC_NO_COMMON_BLOCKS = YES;
225+ GCC_OPTIMIZATION_LEVEL = 0;
226+ GCC_PREPROCESSOR_DEFINITIONS = (
227+ "DEBUG=1",
228+ "$(inherited)",
229+ );
230+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
231+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
232+ GCC_WARN_UNDECLARED_SELECTOR = YES;
233+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
234+ GCC_WARN_UNUSED_FUNCTION = YES;
235+ GCC_WARN_UNUSED_VARIABLE = YES;
236+ IPHONEOS_DEPLOYMENT_TARGET = 11.3;
237+ MTL_ENABLE_DEBUG_INFO = YES;
238+ ONLY_ACTIVE_ARCH = YES;
239+ SDKROOT = iphoneos;
240+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
241+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
242+ };
243+ name = Debug;
244+ };
245+ BEB77559207267E500201EBB /* Release */ = {
246+ isa = XCBuildConfiguration;
247+ buildSettings = {
248+ ALWAYS_SEARCH_USER_PATHS = NO;
249+ CLANG_ANALYZER_NONNULL = YES;
250+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
251+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
252+ CLANG_CXX_LIBRARY = "libc++";
253+ CLANG_ENABLE_MODULES = YES;
254+ CLANG_ENABLE_OBJC_ARC = YES;
255+ CLANG_ENABLE_OBJC_WEAK = YES;
256+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
257+ CLANG_WARN_BOOL_CONVERSION = YES;
258+ CLANG_WARN_COMMA = YES;
259+ CLANG_WARN_CONSTANT_CONVERSION = YES;
260+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
261+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
262+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
263+ CLANG_WARN_EMPTY_BODY = YES;
264+ CLANG_WARN_ENUM_CONVERSION = YES;
265+ CLANG_WARN_INFINITE_RECURSION = YES;
266+ CLANG_WARN_INT_CONVERSION = YES;
267+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
268+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
269+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
270+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
271+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
272+ CLANG_WARN_STRICT_PROTOTYPES = YES;
273+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
274+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
275+ CLANG_WARN_UNREACHABLE_CODE = YES;
276+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
277+ CODE_SIGN_IDENTITY = "iPhone Developer";
278+ COPY_PHASE_STRIP = NO;
279+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
280+ ENABLE_NS_ASSERTIONS = NO;
281+ ENABLE_STRICT_OBJC_MSGSEND = YES;
282+ GCC_C_LANGUAGE_STANDARD = gnu11;
283+ GCC_NO_COMMON_BLOCKS = YES;
284+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
285+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
286+ GCC_WARN_UNDECLARED_SELECTOR = YES;
287+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
288+ GCC_WARN_UNUSED_FUNCTION = YES;
289+ GCC_WARN_UNUSED_VARIABLE = YES;
290+ IPHONEOS_DEPLOYMENT_TARGET = 11.3;
291+ MTL_ENABLE_DEBUG_INFO = NO;
292+ SDKROOT = iphoneos;
293+ SWIFT_COMPILATION_MODE = wholemodule;
294+ SWIFT_OPTIMIZATION_LEVEL = "-O";
295+ VALIDATE_PRODUCT = YES;
296+ };
297+ name = Release;
298+ };
299+ BEB7755B207267E500201EBB /* Debug */ = {
300+ isa = XCBuildConfiguration;
301+ buildSettings = {
302+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
303+ CODE_SIGN_STYLE = Automatic;
304+ DEVELOPMENT_TEAM = 6G5LMQ72D8;
305+ INFOPLIST_FILE = Example/Info.plist;
306+ LD_RUNPATH_SEARCH_PATHS = (
307+ "$(inherited)",
308+ "@executable_path/Frameworks",
309+ );
310+ PRODUCT_BUNDLE_IDENTIFIER = be.silverfox.Example;
311+ PRODUCT_NAME = "$(TARGET_NAME)";
312+ SWIFT_VERSION = 4.0;
313+ TARGETED_DEVICE_FAMILY = "1,2";
314+ };
315+ name = Debug;
316+ };
317+ BEB7755C207267E500201EBB /* Release */ = {
318+ isa = XCBuildConfiguration;
319+ buildSettings = {
320+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
321+ CODE_SIGN_STYLE = Automatic;
322+ DEVELOPMENT_TEAM = 6G5LMQ72D8;
323+ INFOPLIST_FILE = Example/Info.plist;
324+ LD_RUNPATH_SEARCH_PATHS = (
325+ "$(inherited)",
326+ "@executable_path/Frameworks",
327+ );
328+ PRODUCT_BUNDLE_IDENTIFIER = be.silverfox.Example;
329+ PRODUCT_NAME = "$(TARGET_NAME)";
330+ SWIFT_VERSION = 4.0;
331+ TARGETED_DEVICE_FAMILY = "1,2";
332+ };
333+ name = Release;
334+ };
335+/* End XCBuildConfiguration section */
336+
337+/* Begin XCConfigurationList section */
338+ BEB77543207267E400201EBB /* Build configuration list for PBXProject "Example" */ = {
339+ isa = XCConfigurationList;
340+ buildConfigurations = (
341+ BEB77558207267E500201EBB /* Debug */,
342+ BEB77559207267E500201EBB /* Release */,
343+ );
344+ defaultConfigurationIsVisible = 0;
345+ defaultConfigurationName = Release;
346+ };
347+ BEB7755A207267E500201EBB /* Build configuration list for PBXNativeTarget "Example" */ = {
348+ isa = XCConfigurationList;
349+ buildConfigurations = (
350+ BEB7755B207267E500201EBB /* Debug */,
351+ BEB7755C207267E500201EBB /* Release */,
352+ );
353+ defaultConfigurationIsVisible = 0;
354+ defaultConfigurationName = Release;
355+ };
356+/* End XCConfigurationList section */
357+ };
358+ rootObject = BEB77540207267E400201EBB /* Project object */;
359+}
Example/Example/AppDelegate.swiftnew file+46
@@ -0,0 +1,46 @@
1+//
2+// AppDelegate.swift
3+// Example
4+//
5+// Created by Louis D'hauwe on 02/04/2018.
6+// Copyright © 2018 Silver Fox. All rights reserved.
7+//
8+
9+import UIKit
10+
11+@UIApplicationMain
12+class AppDelegate: UIResponder, UIApplicationDelegate {
13+
14+ var window: UIWindow?
15+
16+
17+ func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
18+ // Override point for customization after application launch.
19+ return true
20+ }
21+
22+ func applicationWillResignActive(_ application: UIApplication) {
23+ // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
24+ // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
25+ }
26+
27+ func applicationDidEnterBackground(_ application: UIApplication) {
28+ // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
29+ // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
30+ }
31+
32+ func applicationWillEnterForeground(_ application: UIApplication) {
33+ // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
34+ }
35+
36+ func applicationDidBecomeActive(_ application: UIApplication) {
37+ // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
38+ }
39+
40+ func applicationWillTerminate(_ application: UIApplication) {
41+ // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
42+ }
43+
44+
45+}
46+
Example/Example/Assets.xcassets/AppIcon.appiconset/Contents.jsonnew file+98
@@ -0,0 +1,98 @@
1+{
2+ "images" : [
3+ {
4+ "idiom" : "iphone",
5+ "size" : "20x20",
6+ "scale" : "2x"
7+ },
8+ {
9+ "idiom" : "iphone",
10+ "size" : "20x20",
11+ "scale" : "3x"
12+ },
13+ {
14+ "idiom" : "iphone",
15+ "size" : "29x29",
16+ "scale" : "2x"
17+ },
18+ {
19+ "idiom" : "iphone",
20+ "size" : "29x29",
21+ "scale" : "3x"
22+ },
23+ {
24+ "idiom" : "iphone",
25+ "size" : "40x40",
26+ "scale" : "2x"
27+ },
28+ {
29+ "idiom" : "iphone",
30+ "size" : "40x40",
31+ "scale" : "3x"
32+ },
33+ {
34+ "idiom" : "iphone",
35+ "size" : "60x60",
36+ "scale" : "2x"
37+ },
38+ {
39+ "idiom" : "iphone",
40+ "size" : "60x60",
41+ "scale" : "3x"
42+ },
43+ {
44+ "idiom" : "ipad",
45+ "size" : "20x20",
46+ "scale" : "1x"
47+ },
48+ {
49+ "idiom" : "ipad",
50+ "size" : "20x20",
51+ "scale" : "2x"
52+ },
53+ {
54+ "idiom" : "ipad",
55+ "size" : "29x29",
56+ "scale" : "1x"
57+ },
58+ {
59+ "idiom" : "ipad",
60+ "size" : "29x29",
61+ "scale" : "2x"
62+ },
63+ {
64+ "idiom" : "ipad",
65+ "size" : "40x40",
66+ "scale" : "1x"
67+ },
68+ {
69+ "idiom" : "ipad",
70+ "size" : "40x40",
71+ "scale" : "2x"
72+ },
73+ {
74+ "idiom" : "ipad",
75+ "size" : "76x76",
76+ "scale" : "1x"
77+ },
78+ {
79+ "idiom" : "ipad",
80+ "size" : "76x76",
81+ "scale" : "2x"
82+ },
83+ {
84+ "idiom" : "ipad",
85+ "size" : "83.5x83.5",
86+ "scale" : "2x"
87+ },
88+ {
89+ "idiom" : "ios-marketing",
90+ "size" : "1024x1024",
91+ "scale" : "1x"
92+ }
93+ ],
94+ "info" : {
95+ "version" : 1,
96+ "author" : "xcode"
97+ }
98+}
Example/Example/Assets.xcassets/Contents.jsonnew file+6
@@ -0,0 +1,6 @@
1+{
2+ "info" : {
3+ "version" : 1,
4+ "author" : "xcode"
5+ }
6+}
Example/Example/Base.lproj/LaunchScreen.storyboardnew file+25
@@ -0,0 +1,25 @@
1+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" systemVersion="17A277" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
3+ <dependencies>
4+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
5+ <capability name="Safe area layout guides" minToolsVersion="9.0"/>
6+ <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
7+ </dependencies>
8+ <scenes>
9+ <!--View Controller-->
10+ <scene sceneID="EHf-IW-A2E">
11+ <objects>
12+ <viewController id="01J-lp-oVM" sceneMemberID="viewController">
13+ <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
14+ <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
15+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
16+ <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
17+ <viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
18+ </view>
19+ </viewController>
20+ <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
21+ </objects>
22+ <point key="canvasLocation" x="53" y="375"/>
23+ </scene>
24+ </scenes>
25+</document>
Example/Example/Base.lproj/Main.storyboardnew file+206
@@ -0,0 +1,206 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="8Fw-bv-Lqp">
3+ <device id="retina4_7" orientation="portrait">
4+ <adaptation id="fullscreen"/>
5+ </device>
6+ <dependencies>
7+ <deployment identifier="iOS"/>
8+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
9+ <capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
10+ <capability name="Safe area layout guides" minToolsVersion="9.0"/>
11+ <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
12+ </dependencies>
13+ <scenes>
14+ <!--HueKit Example-->
15+ <scene sceneID="tne-QT-ifu">
16+ <objects>
17+ <viewController id="BYZ-38-t0r" customClass="ViewController" customModule="Example" customModuleProvider="target" sceneMemberID="viewController">
18+ <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
19+ <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
20+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
21+ <subviews>
22+ <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="Tr0-NJ-glz">
23+ <rect key="frame" x="27.5" y="72" width="320" height="518.5"/>
24+ <subviews>
25+ <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="zdi-0K-woj" customClass="ColorSquarePicker" customModule="HueKit">
26+ <rect key="frame" x="0.0" y="0.0" width="320" height="320"/>
27+ <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
28+ <constraints>
29+ <constraint firstAttribute="width" secondItem="zdi-0K-woj" secondAttribute="height" multiplier="1:1" id="KwV-0T-f2e"/>
30+ </constraints>
31+ <userDefinedRuntimeAttributes>
32+ <userDefinedRuntimeAttribute type="point" keyPath="value">
33+ <point key="value" x="0.0" y="0.0"/>
34+ </userDefinedRuntimeAttribute>
35+ </userDefinedRuntimeAttributes>
36+ <connections>
37+ <action selector="colorSquarePickerValueChanged:" destination="BYZ-38-t0r" eventType="valueChanged" id="DaQ-xT-J8e"/>
38+ </connections>
39+ </view>
40+ <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Ht2-O7-0f1" customClass="ColorBarPicker" customModule="HueKit">
41+ <rect key="frame" x="0.0" y="320" width="320" height="44"/>
42+ <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
43+ <constraints>
44+ <constraint firstAttribute="height" constant="44" id="HJ2-He-zzk"/>
45+ </constraints>
46+ <connections>
47+ <action selector="colorBarPickerValueChanged:" destination="BYZ-38-t0r" eventType="valueChanged" id="hie-BA-aJU"/>
48+ </connections>
49+ </view>
50+ <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="UMo-bw-pvL">
51+ <rect key="frame" x="0.0" y="364" width="320" height="154.5"/>
52+ <subviews>
53+ <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="4" translatesAutoresizingMaskIntoConstraints="NO" id="6xm-ns-jG5">
54+ <rect key="frame" x="20" y="20" width="280" height="114.5"/>
55+ <subviews>
56+ <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="4" translatesAutoresizingMaskIntoConstraints="NO" id="GZz-Je-2gO">
57+ <rect key="frame" x="0.0" y="0.0" width="280" height="73.5"/>
58+ <subviews>
59+ <stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" translatesAutoresizingMaskIntoConstraints="NO" id="Yye-8l-cBt">
60+ <rect key="frame" x="0.0" y="0.0" width="280" height="32.5"/>
61+ <subviews>
62+ <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="R:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9BS-9j-1x8">
63+ <rect key="frame" x="0.0" y="0.0" width="93.5" height="32.5"/>
64+ <fontDescription key="fontDescription" name="Menlo-Regular" family="Menlo" pointSize="17"/>
65+ <nil key="textColor"/>
66+ <nil key="highlightedColor"/>
67+ </label>
68+ <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="G:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="euH-5z-YuL">
69+ <rect key="frame" x="93.5" y="0.0" width="93" height="32.5"/>
70+ <fontDescription key="fontDescription" name="Menlo-Regular" family="Menlo" pointSize="17"/>
71+ <nil key="textColor"/>
72+ <nil key="highlightedColor"/>
73+ </label>
74+ <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="B:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Vqz-K4-h3x">
75+ <rect key="frame" x="186.5" y="0.0" width="93.5" height="32.5"/>
76+ <fontDescription key="fontDescription" name="Menlo-Regular" family="Menlo" pointSize="17"/>
77+ <nil key="textColor"/>
78+ <nil key="highlightedColor"/>
79+ </label>
80+ </subviews>
81+ </stackView>
82+ <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="zbY-pB-SO7">
83+ <rect key="frame" x="0.0" y="36.5" width="280" height="1"/>
84+ <color key="backgroundColor" white="0.85195312499999998" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
85+ <constraints>
86+ <constraint firstAttribute="height" constant="1" id="KMO-Jy-7nJ"/>
87+ </constraints>
88+ </view>
89+ <stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" translatesAutoresizingMaskIntoConstraints="NO" id="Lpu-I1-JEV">
90+ <rect key="frame" x="0.0" y="41.5" width="280" height="32"/>
91+ <subviews>
92+ <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="H:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="539-Mk-3VV">
93+ <rect key="frame" x="0.0" y="0.0" width="93.5" height="32"/>
94+ <fontDescription key="fontDescription" name="Menlo-Regular" family="Menlo" pointSize="17"/>
95+ <nil key="textColor"/>
96+ <nil key="highlightedColor"/>
97+ </label>
98+ <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="S:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="16l-vt-EZG">
99+ <rect key="frame" x="93.5" y="0.0" width="93" height="32"/>
100+ <fontDescription key="fontDescription" name="Menlo-Regular" family="Menlo" pointSize="17"/>
101+ <nil key="textColor"/>
102+ <nil key="highlightedColor"/>
103+ </label>
104+ <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="V:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="sRv-69-Kyf">
105+ <rect key="frame" x="186.5" y="0.0" width="93.5" height="32"/>
106+ <fontDescription key="fontDescription" name="Menlo-Regular" family="Menlo" pointSize="17"/>
107+ <nil key="textColor"/>
108+ <nil key="highlightedColor"/>
109+ </label>
110+ </subviews>
111+ </stackView>
112+ </subviews>
113+ <constraints>
114+ <constraint firstItem="Lpu-I1-JEV" firstAttribute="height" secondItem="Yye-8l-cBt" secondAttribute="height" id="uhk-1i-KRK"/>
115+ </constraints>
116+ </stackView>
117+ <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="zJG-Df-vgl">
118+ <rect key="frame" x="0.0" y="77.5" width="280" height="1"/>
119+ <color key="backgroundColor" white="0.85195312499999998" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
120+ <constraints>
121+ <constraint firstAttribute="height" constant="1" id="liA-ZC-ZMS"/>
122+ </constraints>
123+ </view>
124+ <stackView opaque="NO" contentMode="scaleToFill" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="FQM-eG-Kx1">
125+ <rect key="frame" x="0.0" y="82.5" width="280" height="32"/>
126+ <subviews>
127+ <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="F9X-aB-MKf" customClass="ColorIndicatorView" customModule="HueKit">
128+ <rect key="frame" x="0.0" y="0.0" width="32" height="32"/>
129+ <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
130+ <constraints>
131+ <constraint firstAttribute="width" secondItem="F9X-aB-MKf" secondAttribute="height" multiplier="1:1" id="5ff-Qa-LF2"/>
132+ <constraint firstAttribute="width" constant="32" id="7PF-Y2-rat"/>
133+ </constraints>
134+ </view>
135+ <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="#000000" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="aBX-c2-og2">
136+ <rect key="frame" x="40" y="0.0" width="240" height="32"/>
137+ <fontDescription key="fontDescription" name="Menlo-Regular" family="Menlo" pointSize="17"/>
138+ <nil key="textColor"/>
139+ <nil key="highlightedColor"/>
140+ </label>
141+ </subviews>
142+ </stackView>
143+ </subviews>
144+ <constraints>
145+ <constraint firstItem="FQM-eG-Kx1" firstAttribute="height" secondItem="Lpu-I1-JEV" secondAttribute="height" id="7tw-z3-RhV"/>
146+ </constraints>
147+ </stackView>
148+ </subviews>
149+ <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
150+ <constraints>
151+ <constraint firstAttribute="bottom" secondItem="6xm-ns-jG5" secondAttribute="bottom" constant="20" id="QhR-Z9-V4H"/>
152+ <constraint firstAttribute="trailing" secondItem="6xm-ns-jG5" secondAttribute="trailing" constant="20" id="S5r-aC-jbg"/>
153+ <constraint firstItem="6xm-ns-jG5" firstAttribute="leading" secondItem="UMo-bw-pvL" secondAttribute="leading" constant="20" id="ZWD-CF-djw"/>
154+ <constraint firstItem="6xm-ns-jG5" firstAttribute="top" secondItem="UMo-bw-pvL" secondAttribute="top" constant="20" id="u3d-v9-Fe9"/>
155+ </constraints>
156+ </view>
157+ </subviews>
158+ <constraints>
159+ <constraint firstAttribute="width" constant="320" id="g1S-Ws-Nbz"/>
160+ </constraints>
161+ </stackView>
162+ </subviews>
163+ <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
164+ <constraints>
165+ <constraint firstItem="Tr0-NJ-glz" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="SEn-Gx-KKW"/>
166+ <constraint firstItem="Tr0-NJ-glz" firstAttribute="top" secondItem="6Tk-OE-BBY" secondAttribute="top" constant="8" id="jer-1Y-YsK"/>
167+ </constraints>
168+ <viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
169+ </view>
170+ <navigationItem key="navigationItem" title="HueKit Example" id="eA9-XS-nqp"/>
171+ <connections>
172+ <outlet property="bLabel" destination="Vqz-K4-h3x" id="Lcv-rh-t9r"/>
173+ <outlet property="colorIndicatorView" destination="F9X-aB-MKf" id="Mtx-hM-w9Z"/>
174+ <outlet property="colorSquarePicker" destination="zdi-0K-woj" id="tPX-oR-0VC"/>
175+ <outlet property="gLabel" destination="euH-5z-YuL" id="wJ5-5E-77k"/>
176+ <outlet property="hLabel" destination="539-Mk-3VV" id="e5s-5c-P4J"/>
177+ <outlet property="hexLabel" destination="aBX-c2-og2" id="Idh-jp-r44"/>
178+ <outlet property="rLabel" destination="9BS-9j-1x8" id="qZg-q3-WRl"/>
179+ <outlet property="sLabel" destination="16l-vt-EZG" id="fKa-nb-sM2"/>
180+ <outlet property="vLabel" destination="sRv-69-Kyf" id="bjq-dp-QFi"/>
181+ </connections>
182+ </viewController>
183+ <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
184+ </objects>
185+ <point key="canvasLocation" x="1076" y="133.5832083958021"/>
186+ </scene>
187+ <!--Navigation Controller-->
188+ <scene sceneID="Bxk-8d-r3b">
189+ <objects>
190+ <navigationController automaticallyAdjustsScrollViewInsets="NO" id="8Fw-bv-Lqp" sceneMemberID="viewController">
191+ <toolbarItems/>
192+ <navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="5Ii-tA-Bk8">
193+ <rect key="frame" x="0.0" y="20" width="375" height="44"/>
194+ <autoresizingMask key="autoresizingMask"/>
195+ </navigationBar>
196+ <nil name="viewControllers"/>
197+ <connections>
198+ <segue destination="BYZ-38-t0r" kind="relationship" relationship="rootViewController" id="w8A-a3-8JC"/>
199+ </connections>
200+ </navigationController>
201+ <placeholder placeholderIdentifier="IBFirstResponder" id="Vtp-Ht-Dz3" userLabel="First Responder" sceneMemberID="firstResponder"/>
202+ </objects>
203+ <point key="canvasLocation" x="136.80000000000001" y="133.5832083958021"/>
204+ </scene>
205+ </scenes>
206+</document>
Example/Example/Info.plistnew file+45
@@ -0,0 +1,45 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+<plist version="1.0">
4+<dict>
5+ <key>CFBundleDevelopmentRegion</key>
6+ <string>$(DEVELOPMENT_LANGUAGE)</string>
7+ <key>CFBundleExecutable</key>
8+ <string>$(EXECUTABLE_NAME)</string>
9+ <key>CFBundleIdentifier</key>
10+ <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11+ <key>CFBundleInfoDictionaryVersion</key>
12+ <string>6.0</string>
13+ <key>CFBundleName</key>
14+ <string>$(PRODUCT_NAME)</string>
15+ <key>CFBundlePackageType</key>
16+ <string>APPL</string>
17+ <key>CFBundleShortVersionString</key>
18+ <string>1.0</string>
19+ <key>CFBundleVersion</key>
20+ <string>1</string>
21+ <key>LSRequiresIPhoneOS</key>
22+ <true/>
23+ <key>UILaunchStoryboardName</key>
24+ <string>LaunchScreen</string>
25+ <key>UIMainStoryboardFile</key>
26+ <string>Main</string>
27+ <key>UIRequiredDeviceCapabilities</key>
28+ <array>
29+ <string>armv7</string>
30+ </array>
31+ <key>UISupportedInterfaceOrientations</key>
32+ <array>
33+ <string>UIInterfaceOrientationPortrait</string>
34+ <string>UIInterfaceOrientationLandscapeLeft</string>
35+ <string>UIInterfaceOrientationLandscapeRight</string>
36+ </array>
37+ <key>UISupportedInterfaceOrientations~ipad</key>
38+ <array>
39+ <string>UIInterfaceOrientationPortrait</string>
40+ <string>UIInterfaceOrientationPortraitUpsideDown</string>
41+ <string>UIInterfaceOrientationLandscapeLeft</string>
42+ <string>UIInterfaceOrientationLandscapeRight</string>
43+ </array>
44+</dict>
45+</plist>
Example/Example/ViewController.swiftnew file+84
@@ -0,0 +1,84 @@
1+//
2+// ViewController.swift
3+// Example
4+//
5+// Created by Louis D'hauwe on 02/04/2018.
6+// Copyright © 2018 Silver Fox. All rights reserved.
7+//
8+
9+import UIKit
10+import HueKit
11+
12+class ViewController: UIViewController {
13+
14+ @IBOutlet weak var colorSquarePicker: ColorSquarePicker!
15+ @IBOutlet weak var colorIndicatorView: ColorIndicatorView!
16+
17+ @IBOutlet weak var rLabel: UILabel!
18+ @IBOutlet weak var gLabel: UILabel!
19+ @IBOutlet weak var bLabel: UILabel!
20+
21+ @IBOutlet weak var hLabel: UILabel!
22+ @IBOutlet weak var sLabel: UILabel!
23+ @IBOutlet weak var vLabel: UILabel!
24+
25+ @IBOutlet weak var hexLabel: UILabel!
26+
27+ override func viewDidLoad() {
28+ super.viewDidLoad()
29+
30+ didChangeColor(colorSquarePicker.color)
31+
32+ }
33+
34+ @IBAction func colorBarPickerValueChanged(_ sender: ColorBarPicker) {
35+
36+ colorSquarePicker.hue = sender.hue
37+ didChangeColor(colorSquarePicker.color)
38+
39+ }
40+
41+ @IBAction func colorSquarePickerValueChanged(_ sender: ColorSquarePicker) {
42+
43+ didChangeColor(sender.color)
44+
45+ }
46+
47+ func didChangeColor(_ color: UIColor) {
48+
49+ guard let rgbValue = color.rgbValue else {
50+ return
51+ }
52+
53+ guard let hsvValue = color.hsvValue else {
54+ return
55+ }
56+
57+ rLabel.text = String(format: "R: %.f", rgbValue.r * 255)
58+ gLabel.text = String(format: "G: %.f", rgbValue.g * 255)
59+ bLabel.text = String(format: "B: %.f", rgbValue.b * 255)
60+
61+ hLabel.text = String(format: "H: %.f°", hsvValue.h * 360)
62+ sLabel.text = String(format: "S: %.f%%", hsvValue.s * 100)
63+ vLabel.text = String(format: "V: %.f%%", hsvValue.v * 100)
64+
65+ hexLabel.text = color.hexString
66+ colorIndicatorView.color = color
67+
68+ }
69+
70+}
71+
72+extension UIColor {
73+
74+ public var hexString: String {
75+ var r: CGFloat = 0
76+ var g: CGFloat = 0
77+ var b: CGFloat = 0
78+ var a: CGFloat = 0
79+ self.getRed(&r, green: &g, blue: &b, alpha: &a)
80+
81+ return String(format: "#%02X%02X%02X", Int(r * 255), Int(g * 255), Int(b * 255))
82+ }
83+
84+}
HueKit.xcodeproj/project.pbxproj+2
@@ -150,6 +150,7 @@
150150 BE5C1E0E1F3266B600B0080C /* Project object */ = {
151151 isa = PBXProject;
152152 attributes = {
153+ LastSwiftUpdateCheck = 0930;
153154 LastUpgradeCheck = 0900;
154155 ORGANIZATIONNAME = "Silver Fox";
155156 TargetAttributes = {
@@ -167,6 +168,7 @@
167168 hasScannedForEncodings = 0;
168169 knownRegions = (
169170 en,
171+ Base,
170172 );
171173 mainGroup = BE5C1E0D1F3266B600B0080C;
172174 productRefGroup = BE5C1E181F3266B600B0080C /* Products */;
HueKit.xcworkspace/contents.xcworkspacedatanew file+10
@@ -0,0 +1,10 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<Workspace
3+ version = "1.0">
4+ <FileRef
5+ location = "group:Example/Example.xcodeproj">
6+ </FileRef>
7+ <FileRef
8+ location = "group:HueKit.xcodeproj">
9+ </FileRef>
10+</Workspace>
HueKit.xcworkspace/xcshareddata/IDEWorkspaceChecks.plistnew file+8
@@ -0,0 +1,8 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+<plist version="1.0">
4+<dict>
5+ <key>IDEDidComputeMac32BitWarning</key>
6+ <true/>
7+</dict>
8+</plist>