Skip to content

Commit d1208bd

Browse files
committed
Fix some swiftlint warning
1 parent 087dd9d commit d1208bd

10 files changed

+35
-33
lines changed

Prephirences.xcodeproj/project.pbxproj

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,7 @@
786786
SKIP_INSTALL = YES;
787787
SWIFT_VERSION = 4.0;
788788
TARGETED_DEVICE_FAMILY = 4;
789-
WATCHOS_DEPLOYMENT_TARGET = 2.0;
789+
WATCHOS_DEPLOYMENT_TARGET = 3.0;
790790
};
791791
name = Debug;
792792
};
@@ -809,7 +809,7 @@
809809
SWIFT_VERSION = 4.0;
810810
TARGETED_DEVICE_FAMILY = 4;
811811
VALIDATE_PRODUCT = YES;
812-
WATCHOS_DEPLOYMENT_TARGET = 2.0;
812+
WATCHOS_DEPLOYMENT_TARGET = 3.0;
813813
};
814814
name = Release;
815815
};
@@ -977,7 +977,7 @@
977977
);
978978
INFOPLIST_FILE = Xcodes/iOS/Info.plist;
979979
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
980-
IPHONEOS_DEPLOYMENT_TARGET = 8.3;
980+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
981981
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
982982
PRODUCT_BUNDLE_IDENTIFIER = tv.phimage.Prephirences;
983983
PRODUCT_NAME = Prephirences;
@@ -1000,7 +1000,7 @@
10001000
DYLIB_INSTALL_NAME_BASE = "@rpath";
10011001
INFOPLIST_FILE = Xcodes/iOS/Info.plist;
10021002
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
1003-
IPHONEOS_DEPLOYMENT_TARGET = 8.3;
1003+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
10041004
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
10051005
PRODUCT_BUNDLE_IDENTIFIER = tv.phimage.Prephirences;
10061006
PRODUCT_NAME = Prephirences;
@@ -1029,6 +1029,7 @@
10291029
INFOPLIST_FILE = Xcodes/Mac/Info.plist;
10301030
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
10311031
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
1032+
MACOSX_DEPLOYMENT_TARGET = 10.11;
10321033
PRODUCT_BUNDLE_IDENTIFIER = tv.phimage.Prephirences;
10331034
PRODUCT_NAME = Prephirences;
10341035
SKIP_INSTALL = YES;
@@ -1048,6 +1049,7 @@
10481049
INFOPLIST_FILE = Xcodes/Mac/Info.plist;
10491050
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
10501051
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
1052+
MACOSX_DEPLOYMENT_TARGET = 10.11;
10511053
PRODUCT_BUNDLE_IDENTIFIER = tv.phimage.Prephirences;
10521054
PRODUCT_NAME = Prephirences;
10531055
SKIP_INSTALL = YES;

Sources/DictionaryPreferences.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ open class DictionaryPreferences: PreferencesType, Sequence, ExpressibleByDictio
139139
open func array(forKey key: PreferenceKey) -> [PreferenceObject]? {
140140
return dico[key] as? [AnyObject]
141141
}
142-
open func dictionary(forKey key: PreferenceKey) -> [String : AnyObject]? {
142+
open func dictionary(forKey key: PreferenceKey) -> [String: AnyObject]? {
143143
return dico[key] as? [String: AnyObject]
144144
}
145145
open func data(forKey key: PreferenceKey) -> Data? {
@@ -222,7 +222,7 @@ open class MutableDictionaryPreferences: DictionaryPreferences, MutablePreferenc
222222

223223
// MARK: - private
224224
// dictionary append
225-
internal func +=<K, V> (left: inout [K : V], right: [K : V]) { for (k, v) in right { left[k] = v } }
225+
internal func +=<K, V> (left: inout [K: V], right: [K: V]) { for (k, v) in right { left[k] = v } }
226226

227227
// MARK: - Buffered preferences
228228
open class BufferPreferences: MutableDictionaryPreferences {

Sources/NSCachePreferences.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import Foundation
1010

11-
public class NSCachePreferences<ObjectType>: MutablePreferencesType where ObjectType : AnyObject {
11+
public class NSCachePreferences<ObjectType>: MutablePreferencesType where ObjectType: AnyObject {
1212

1313
public let cache: NSCache<NSString, ObjectType>
1414
public var insertCost: Int = 0

Sources/NSUbiquitousKeyValueStore+Prephirences.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import Foundation
3030
/** Prephirences Extends NSUbiquitousKeyValueStore
3131

3232
*/
33-
extension NSUbiquitousKeyValueStore : MutablePreferencesType {
33+
extension NSUbiquitousKeyValueStore: MutablePreferencesType {
3434

3535
public func dictionary() -> PreferencesDictionary {
3636
return self.dictionaryRepresentation
@@ -89,7 +89,7 @@ extension NSUbiquitousKeyValueStore {
8989
#endif
9090
let data: Data?
9191
do {
92-
data = try urlToSet.bookmarkData(options: options, includingResourceValuesForKeys:nil, relativeTo:nil)
92+
data = try urlToSet.bookmarkData(options: options, includingResourceValuesForKeys: nil, relativeTo: nil)
9393
} catch _ {
9494
data = nil
9595
}

Sources/PatternPreferences.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ open class CompositePreferences: PreferencesType, ExpressibleByArrayLiteral {
7777
open func array(forKey key: PreferenceKey) -> [PreferenceObject]? {
7878
return self[key] as? [AnyObject]
7979
}
80-
open func dictionary(forKey key: PreferenceKey) -> [String : AnyObject]? {
80+
open func dictionary(forKey key: PreferenceKey) -> [String: AnyObject]? {
8181
return self[key] as? [String: AnyObject]
8282
}
8383
open func data(forKey key: PreferenceKey) -> Data? {

Sources/PreferenceOperators.swift

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -137,40 +137,40 @@ extension Array: Initializable {}
137137
extension Bool: Initializable {}
138138

139139
// MARK: IntegerArithmetic
140-
public func +=<T> (preference: inout MutablePreference<T>, addend: T) where T:BinaryInteger, T:Initializable {
140+
public func +=<T> (preference: inout MutablePreference<T>, addend: T) where T: BinaryInteger, T: Initializable {
141141
let c = preference.value ?? T()
142142
preference.value = c + addend
143143
}
144-
public func -=<T> (preference: inout MutablePreference<T>, addend: T) where T:BinaryInteger, T:Initializable {
144+
public func -=<T> (preference: inout MutablePreference<T>, addend: T) where T: BinaryInteger, T: Initializable {
145145
let c = preference.value ?? T()
146146
preference.value = c - addend
147147
}
148148

149-
public func *=<T> (preference: inout MutablePreference<T>, multiplier : T) where T:BinaryInteger, T:Initializable {
149+
public func *=<T> (preference: inout MutablePreference<T>, multiplier : T) where T: BinaryInteger, T: Initializable {
150150
let c = preference.value ?? T()
151151
preference.value = c * multiplier
152152
}
153153

154-
public func /=<T> (preference: inout MutablePreference<T>, divisor : T) where T:BinaryInteger, T:Initializable {
154+
public func /=<T> (preference: inout MutablePreference<T>, divisor : T) where T: BinaryInteger, T: Initializable {
155155
let c = preference.value ?? T()
156156
preference.value = c / divisor
157157
}
158158

159-
public func %=<T> (preference: inout MutablePreference<T>, modulo : T) where T:BinaryInteger, T:Initializable {
159+
public func %=<T> (preference: inout MutablePreference<T>, modulo : T) where T: BinaryInteger, T: Initializable {
160160
let c = preference.value ?? T()
161161
preference.value = c % modulo
162162
}
163163

164164
// MARK: Bitwise Operations
165-
public func &= <T>(preference: inout MutablePreference<T>, rhs: T) where T: FixedWidthInteger, T:Initializable {
165+
public func &= <T>(preference: inout MutablePreference<T>, rhs: T) where T: FixedWidthInteger, T: Initializable {
166166
let c = preference.value ?? T()
167167
preference.value = c & rhs
168168
}
169-
public func |= <T>(preference: inout MutablePreference<T>, rhs: T) where T: FixedWidthInteger, T:Initializable {
169+
public func |= <T>(preference: inout MutablePreference<T>, rhs: T) where T: FixedWidthInteger, T: Initializable {
170170
let c = preference.value ?? T()
171171
preference.value = c | rhs
172172
}
173-
public func ^=<T> (preference: inout MutablePreference<T>, rhs: T) where T: FixedWidthInteger, T:Initializable {
173+
public func ^=<T> (preference: inout MutablePreference<T>, rhs: T) where T: FixedWidthInteger, T: Initializable {
174174
let c = preference.value ?? T()
175175
preference.value = c ^ rhs
176176
}
@@ -185,7 +185,7 @@ public protocol Addable {
185185
extension String: Addable {}
186186
extension Array: Addable {}
187187

188-
public func +=<T> (preference: inout MutablePreference<T>, addend: T) where T:Addable, T:Initializable {
188+
public func +=<T> (preference: inout MutablePreference<T>, addend: T) where T: Addable, T: Initializable {
189189
let c = preference.value ?? T()
190190
preference.value = c + addend
191191
}
@@ -211,12 +211,12 @@ extension Conjunctive {
211211
}
212212
}
213213

214-
public func && <T>(left: MutablePreference<T>, right: Preference<T>) -> T where T: Conjunctive, T:Initializable {
214+
public func && <T>(left: MutablePreference<T>, right: Preference<T>) -> T where T: Conjunctive, T: Initializable {
215215
let leftV = left.value ?? T()
216216
let rightV = right.value ?? T()
217217
return leftV && rightV
218218
}
219-
public func &&=<T> (preference: inout MutablePreference<T>, right: @autoclosure () throws -> T) rethrows where T:Conjunctive, T:Initializable {
219+
public func &&=<T> (preference: inout MutablePreference<T>, right: @autoclosure () throws -> T) rethrows where T: Conjunctive, T: Initializable {
220220
let c = preference.value ?? T()
221221
try preference.value = c && right
222222
}
@@ -237,7 +237,7 @@ public func ||=<T> (preference: inout MutablePreference<T>, rhs: @autoclosure ()
237237
try preference.value = c || rhs
238238
}
239239

240-
public func || <T>(left: MutablePreference<T>, right: Preference<T>) -> T where T: Disjunctive, T:Initializable {
240+
public func || <T>(left: MutablePreference<T>, right: Preference<T>) -> T where T: Disjunctive, T: Initializable {
241241
let leftV = left.value ?? T()
242242
let rightV = right.value ?? T()
243243
return leftV || rightV

Sources/PreferencesType.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public extension PreferencesType {
9696
return self.object(forKey: key) as? [AnyObject]
9797
}
9898
public func dictionary(forKey key: PreferenceKey) -> PreferencesDictionary? {
99-
return self.object(forKey: key) as? [String : AnyObject]
99+
return self.object(forKey: key) as? [String: AnyObject]
100100
}
101101
public func data(forKey key: PreferenceKey) -> Data? {
102102
return self.object(forKey: key) as? Data

Sources/RawRepresentableKey/RawRepresentable+Prephirences.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,27 +98,27 @@ public extension MutablePreferencesType {
9898
}
9999

100100
public func set<R: RawRepresentable>(_ value: Int, rawRepresentableKey: R) where R.RawValue == PreferenceKey {
101-
set(value, forKey : rawRepresentableKey.rawValue)
101+
set(value, forKey: rawRepresentableKey.rawValue)
102102
}
103103

104104
public func set<R: RawRepresentable>(_ value: Float, rawRepresentableKey: R) where R.RawValue == PreferenceKey {
105-
set(value, forKey : rawRepresentableKey.rawValue)
105+
set(value, forKey: rawRepresentableKey.rawValue)
106106
}
107107

108108
public func set<R: RawRepresentable>(_ value: Double, rawRepresentableKey: R) where R.RawValue == PreferenceKey {
109-
set(value, forKey : rawRepresentableKey.rawValue)
109+
set(value, forKey: rawRepresentableKey.rawValue)
110110
}
111111

112112
public func set<R: RawRepresentable>(_ value: Bool, rawRepresentableKey: R) where R.RawValue == PreferenceKey {
113-
set(value, forKey : rawRepresentableKey.rawValue)
113+
set(value, forKey: rawRepresentableKey.rawValue)
114114
}
115115

116116
public func set<R: RawRepresentable>(_ url: URL?, rawRepresentableKey: R) where R.RawValue == PreferenceKey {
117-
set(url, forKey : rawRepresentableKey.rawValue)
117+
set(url, forKey: rawRepresentableKey.rawValue)
118118
}
119119

120120
public func set<T: RawRepresentable, R: RawRepresentable>(rawValue value: T?, rawRepresentableKey: R) where R.RawValue == PreferenceKey {
121-
self.set(rawValue: value, forKey : rawRepresentableKey.rawValue)
121+
self.set(rawValue: value, forKey: rawRepresentableKey.rawValue)
122122
}
123123

124124
}
@@ -145,7 +145,7 @@ extension MutablePreferencesType {
145145
}
146146

147147
public subscript(key: PreferenceSerializable<Int?>) -> Int? {
148-
get { return object(forKey:key.rawValue) as? Int }
148+
get { return object(forKey: key.rawValue) as? Int }
149149
set { set(newValue, forKey: key.rawValue) }
150150
}
151151

@@ -170,7 +170,7 @@ extension MutablePreferencesType {
170170
}
171171

172172
public subscript(key: PreferenceSerializable<Bool>) -> Bool {
173-
get { return bool(forKey:key.rawValue) }
173+
get { return bool(forKey: key.rawValue) }
174174
set { set(newValue, forKey: key.rawValue) }
175175
}
176176

Sources/UserDefaults+Prephirences.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import Foundation
3232
*/
3333
extension Foundation.UserDefaults: MutablePreferencesType {
3434

35-
public func dictionary() -> [PreferenceKey : PreferenceObject] {
35+
public func dictionary() -> [PreferenceKey: PreferenceObject] {
3636
return self.dictionaryRepresentation()
3737
}
3838

Sources/UserDefaults/UserDefaults+Adds.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public extension Foundation.UserDefaults {
4444

4545
public func set(color: Color, forKey aKey: String) {
4646
let theData = NSKeyedArchiver.archivedData(withRootObject: color)
47-
self.set(theData, forKey:aKey)
47+
self.set(theData, forKey: aKey)
4848
}
4949

5050
public func color(forKey aKey: String) -> Color? {

0 commit comments

Comments
 (0)