For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.
This file contains hidden or 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
| Question |
This file contains hidden or 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
| import Foundation | |
| import SystemConfiguration | |
| final class NetworkValidator { | |
| static func isConnectedToNetwork() -> Bool { | |
| var zeroAddress = sockaddr_in() | |
| zeroAddress.sin_len = UInt8(MemoryLayout.size(ofValue: zeroAddress)) | |
| zeroAddress.sin_family = sa_family_t(AF_INET) |
This file contains hidden or 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
| enum ScreenSize { | |
| static let width = UIScreen.main.bounds.size.width | |
| static let height = UIScreen.main.bounds.size.height | |
| static let maxLength = max(ScreenSize.width, ScreenSize.height) | |
| static let minLength = min(ScreenSize.width, ScreenSize.height) | |
| } | |
| enum DeviceType { | |
| static let idiom = UIDevice.current.userInterfaceIdiom | |
| static let nativeScale = UIScreen.main.nativeScale |