-
Notifications
You must be signed in to change notification settings - Fork 69
Redundant conformance of 'CGPoint' to protocol 'Decodable' #145
Copy link
Copy link
Open
Description
I'm getting this error when trying to build the project for Test target:
The code is:
extension CGPoint: Decodable {
/// Decodes CGPoint from JSON array. Returns CGPoint.zero if array.count < 2.
///
/// - Parameter json: json element
/// - Returns: CGPoint converted from json
/// - Throws: error if type mismatch.
public static func decode(_ json: Any) throws -> CGPoint {
let array: [Double] = try cast(json)
let point: CGPoint
if array.count < 2 {
print("Can't parse point from array: \(array)")
point = CGPoint.zero
} else {
point = CGPoint(x: array[0], y: array[1])
}
return point
}
}Everything works fine with main target. Any ideas? Decodable is installed via CocoaPods, version 0.5.
podfile:
use_frameworks!
# ignore all warnings from all pods
inhibit_all_warnings!
def pods
pod 'Masonry', '0.6.4'
pod 'Decodable'
pod 'RealmSwift'
end
target 'App' do
platform :ios, '9.0'
pods
end
target 'AppTests' do
platform :ios, '9.0'
pods
end
post_install do |installer|
Dir.glob(installer.sandbox.target_support_files_root + "Pods-*/*.sh").each do |script|
flag_name = File.basename(script, ".sh") + "-Installation-Flag"
folder = "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
file = File.join(folder, flag_name)
content = File.read(script)
content.gsub!(/set -e/, "set -e\nKG_FILE=\"#{file}\"\nif [ -f \"$KG_FILE\" ]; then exit 0; fi\nmkdir -p \"#{folder}\"\ntouch \"$KG_FILE\"")
File.write(script, content)
end
endReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
