This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// To set the light icon | |
UIApplication.shared.setAlternateIconName("light") { | |
guard let error = $0 else { return } | |
os_log("Error setting alternative icon: %@", error.localizedDescription) | |
} | |
// To set the light icon | |
UIApplication.shared.setAlternateIconName("dark") { | |
guard let error = $0 else { return } | |
os_log("Error setting alternative icon: %@", error.localizedDescription) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<key>CFBundleIcons~ipad</key> | |
<dict> | |
<key>CFBundlePrimaryIcon</key> | |
<dict> | |
<key>CFBundleIconFiles</key> | |
<array> | |
<string>default</string> | |
</array> | |
<key>UIPrerenderedIcon</key> | |
<false/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<key>CFBundleIcons</key> | |
<dict> | |
<key>CFBundlePrimaryIcon</key> | |
<dict> | |
<key>CFBundleIconFiles</key> | |
<array> | |
<string>default</string> | |
</array> | |
<key>UIPrerenderedIcon</key> | |
<false/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Acknowledgments: Decodable { | |
let specs: [Framework] | |
} | |
struct Framework: Decodable { | |
let name: String | |
let homepage: String | |
let version: String | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public extension UIView { | |
private struct AssociatedKey { | |
static var constrictor: UInt8 = 0 | |
} | |
var constrictor: Constrictor { | |
if let constrictor = objc_getAssociatedObject(self, &AssociatedKey.constrictor) as? Constrictor { | |
return constrictor | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lazy var constrictor = Constrictor(object: self)() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ViewController.swift | |
// Example | |
// | |
// Created by Pedro Carrasco on 21/05/2018. | |
// Copyright © 2018 Pedro Carrasco. All rights reserved. | |
// | |
import UIKit | |
import Constrictor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ViewController.swift | |
// Example | |
// | |
// Created by Pedro Carrasco on 21/05/2018. | |
// Copyright © 2018 Pedro Carrasco. All rights reserved. | |
// | |
import UIKit | |
import Constrictor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private enum Constant { | |
static let scenarioAFile = "screenScenarioA" | |
static let scenarioBFile = "screenScenarioB" | |
} | |
func testScenarioA() { | |
// Arrange & Act | |
updateStructureWithJSON(named: Constant.scenarioAFile) | |
let result = screenStructureManager.current | |
let expectedResult: [Component] = [.header, .products] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private enum Constant { | |
static let scenarioAFile = "screenScenarioA" | |
static let scenarioBFile = "screenScenarioB" | |
} | |
func testScenarioA() { | |
// Arrange | |
guard let filePath = Bundle(for: type(of: self)).path(forResource: Constant.scenarioAFile, ofType: FileType.json), | |
let data = try? Data(contentsOf: URL(fileURLWithPath: filePath)), | |
let jsonObject = try? JSONSerialization.jsonObject(with: data, options: .allowFragments), |
NewerOlder