From 1f143e20d62828b72895b40c99d2e02da059818d Mon Sep 17 00:00:00 2001 From: Vadym Markov Date: Fri, 18 Mar 2016 11:31:38 +0100 Subject: [PATCH 1/2] Fix device model enum --- .../Extensions/{UIDevice.swift => UIDevice+Model.swift} | 4 ++-- Sugar.xcodeproj/project.pbxproj | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) rename Source/iOS/Extensions/{UIDevice.swift => UIDevice+Model.swift} (85%) diff --git a/Source/iOS/Extensions/UIDevice.swift b/Source/iOS/Extensions/UIDevice+Model.swift similarity index 85% rename from Source/iOS/Extensions/UIDevice.swift rename to Source/iOS/Extensions/UIDevice+Model.swift index 6f83324..3d7424f 100644 --- a/Source/iOS/Extensions/UIDevice.swift +++ b/Source/iOS/Extensions/UIDevice+Model.swift @@ -2,7 +2,7 @@ import UIKit public extension UIDevice { - public enum Model: String { + public enum Model { case iPhone4 case iPhone5 case iPhone6 @@ -12,7 +12,7 @@ public extension UIDevice { } public var model: Model { - guard UIDevice().userInterfaceIdiom == .Phone else { + guard userInterfaceIdiom == .Phone else { return .iPad } diff --git a/Sugar.xcodeproj/project.pbxproj b/Sugar.xcodeproj/project.pbxproj index 5fe952e..cb20545 100644 --- a/Sugar.xcodeproj/project.pbxproj +++ b/Sugar.xcodeproj/project.pbxproj @@ -48,7 +48,7 @@ BDAF15621C3917110008A5D6 /* Then.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDAF15611C3917110008A5D6 /* Then.swift */; }; BDAF15631C3917110008A5D6 /* Then.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDAF15611C3917110008A5D6 /* Then.swift */; }; BDAF15651C3917A90008A5D6 /* TestThen.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDAF15641C3917A90008A5D6 /* TestThen.swift */; }; - D527EDA01C9C0B7D0092AD6B /* UIDevice.swift in Sources */ = {isa = PBXBuildFile; fileRef = D527ED9F1C9C0B7D0092AD6B /* UIDevice.swift */; }; + D527EDA01C9C0B7D0092AD6B /* UIDevice+Model.swift in Sources */ = {isa = PBXBuildFile; fileRef = D527ED9F1C9C0B7D0092AD6B /* UIDevice+Model.swift */; }; D52D72431C3BDEA5009A4426 /* Swizzler.swift in Sources */ = {isa = PBXBuildFile; fileRef = D52D72421C3BDEA5009A4426 /* Swizzler.swift */; }; D52D72441C3BDEA5009A4426 /* Swizzler.swift in Sources */ = {isa = PBXBuildFile; fileRef = D52D72421C3BDEA5009A4426 /* Swizzler.swift */; }; D52D72461C3BDFAB009A4426 /* TestSwizzler.swift in Sources */ = {isa = PBXBuildFile; fileRef = D52D72451C3BDFAB009A4426 /* TestSwizzler.swift */; }; @@ -105,7 +105,7 @@ BDA4481B1C295A01003FDEAD /* TestStringExtensionCoreFoundation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestStringExtensionCoreFoundation.swift; sourceTree = ""; }; BDAF15611C3917110008A5D6 /* Then.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Then.swift; sourceTree = ""; }; BDAF15641C3917A90008A5D6 /* TestThen.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestThen.swift; sourceTree = ""; }; - D527ED9F1C9C0B7D0092AD6B /* UIDevice.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIDevice.swift; sourceTree = ""; }; + D527ED9F1C9C0B7D0092AD6B /* UIDevice+Model.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIDevice+Model.swift"; sourceTree = ""; }; D52D72421C3BDEA5009A4426 /* Swizzler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Swizzler.swift; sourceTree = ""; }; D52D72451C3BDFAB009A4426 /* TestSwizzler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestSwizzler.swift; sourceTree = ""; }; D5619C191C97FEB8006C8176 /* UIImage+RenderingMode.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIImage+RenderingMode.swift"; sourceTree = ""; }; @@ -175,7 +175,7 @@ BD0E01CD1C3BD7AC0092C477 /* UITableView+Indexes.swift */, BD0E01D01C3BD93C0092C477 /* UICollectionView+Indexes.swift */, D5619C191C97FEB8006C8176 /* UIImage+RenderingMode.swift */, - D527ED9F1C9C0B7D0092AD6B /* UIDevice.swift */, + D527ED9F1C9C0B7D0092AD6B /* UIDevice+Model.swift */, ); path = Extensions; sourceTree = ""; @@ -521,7 +521,7 @@ BDA447B21C29471C003FDEAD /* Application.swift in Sources */, BDA447B31C29471C003FDEAD /* UIView+Optimize.swift in Sources */, BD0E01CB1C3BCFEF0092C477 /* Localization.swift in Sources */, - D527EDA01C9C0B7D0092AD6B /* UIDevice.swift in Sources */, + D527EDA01C9C0B7D0092AD6B /* UIDevice+Model.swift in Sources */, BDA447B41C29471C003FDEAD /* Screen.swift in Sources */, BDA447B51C29471C003FDEAD /* Simulator.swift in Sources */, BDA4481A1C29588F003FDEAD /* String+CoreFoundation.swift in Sources */, From 66187f79a8eb45bb07c7ee35106666d81a83dae4 Mon Sep 17 00:00:00 2001 From: Vadym Markov Date: Fri, 18 Mar 2016 11:32:17 +0100 Subject: [PATCH 2/2] 1.0.9 --- Sugar.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sugar.podspec b/Sugar.podspec index 991d642..f08bd9d 100644 --- a/Sugar.podspec +++ b/Sugar.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "Sugar" s.summary = "Something sweet that goes great with your Cocoa" - s.version = "1.0.8" + s.version = "1.0.9" s.homepage = "https://github.com/hyperoslo/Sugar" s.license = 'MIT' s.author = { "Hyper Interaktiv AS" => "ios@hyper.no" }