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
func testNotifications() { | |
// map all authorizationStatus with expected Result | |
let authorizationStatusMap: [UNAuthorizationStatus: Int] = [.authorized: 1, .denied: 0, .notDetermined: 0, .provisional: 1] | |
UNNotificationSettings.swizzleAuthorizationStatus() | |
authorizationStatusMap.forEach { (key: UNAuthorizationStatus, value: Int) in | |
UNNotificationSettings.fakeAuthorizationStatus = key | |
let mockCenter = UserNotificationCenterMock() | |
let mockCoder = MockNSCoder() |
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
# Xcode 10.2 | |
# please use within Xcode environment (Build Phases -> Run Script or Scheme -> Post Actions) | |
xcodebuild -version | |
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal | |
# make sure the output directory exists | |
mkdir -p "${UNIVERSAL_OUTPUTFOLDER}" | |
env > env.txt | |
# Step 1. Build Device and Simulator versions | |
xcodebuild -project "${PROJECT_NAME}.xcodeproj" -target "${PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build |
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
import Foundation | |
import RealmSwift | |
protocol CascadingDeletable { | |
var cascadingDeletions: [AnyObject?] { get } | |
} | |
extension Realm { | |
func delete<T: AnyObject>(_ objects: List<T>, cascade: Bool = true) where T: CascadingDeletable { |