Sometimes we need to open Setting's Preferences not of our app, but of the iPhone itself. What should we do to acomplish this?
[UPDATE: Added Wallet And Apple Pay below]
[UPDATE: Changed prefs for Bluetooth]
exec > /tmp/${PROJECT_NAME}_archive.log 2>&1 | |
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal | |
if [ "true" == ${ALREADYINVOKED:-false} ] | |
then | |
echo "RECURSION: Detected, stopping" | |
else | |
export ALREADYINVOKED="true" |
// To check if a number is between a range, don't do | |
if number >=0 && number <= 100 { | |
} | |
// Use range and news operators instead : | |
if 0...100 ~= number { | |
} |
import Foundation | |
/// An abstract class that makes building simple asynchronous operations easy. | |
/// Subclasses must implement `execute()` to perform any work and call | |
/// `finish()` when they are done. All `NSOperation` work will be handled | |
/// automatically. | |
open class AsynchronousOperation: Operation { | |
// MARK: - Properties |
extension Optional where Wrapped: Collection { | |
var isNilOrEmpty: Bool { | |
return self?.isEmpty ?? true | |
} | |
} |
import UIKit | |
import CoreGraphics | |
extension UIView { | |
func createRoundedRectPath(for rect: CGRect, radius: CGFloat) -> CGMutablePath { | |
let path = CGMutablePath() | |
let midTopPoint = CGPoint(x: rect.midX, y: rect.minY) | |
path.move(to: midTopPoint) | |
class Observable<Value> { | |
private var value: Value | |
private var observations = [UUID : (Value) -> Void]() | |
init(value: Value) { | |
self.value = value | |
} | |
func update(with value: Value) { | |
self.value = value |
struct Identifier: Hashable { | |
let string: String | |
} | |
extension Identifier: ExpressibleByStringLiteral { | |
init(stringLiteral value: String) { | |
string = value | |
} | |
} |