Merge branch 'feature/coding' into feature/coding_action_map
This commit is contained in:
commit
7d55f7d41b
@ -157,6 +157,8 @@
|
||||
AFFCFA681FCCC0D700FD0730 /* MVMCoreLoadingViewControllerProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = AFFCFA641FCCC0D600FD0730 /* MVMCoreLoadingViewControllerProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
D282AAB62240085300C46919 /* MVMCoreGetterUtility+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = D282AAB52240085300C46919 /* MVMCoreGetterUtility+Extension.swift */; };
|
||||
D282AAB82240342D00C46919 /* NSNumber+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = D282AAB72240342D00C46919 /* NSNumber+Extension.swift */; };
|
||||
D2DEDCB723C63F3B00C44CC4 /* Clamping.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2DEDCB623C63F3B00C44CC4 /* Clamping.swift */; };
|
||||
D2DEDCB923C6400600C44CC4 /* UnitInterval.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2DEDCB823C6400600C44CC4 /* UnitInterval.swift */; };
|
||||
D2E1FAD92260C3E400AEFD8C /* DelegateObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2E1FAD82260C3E400AEFD8C /* DelegateObject.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
@ -305,6 +307,8 @@
|
||||
AFFCFA641FCCC0D600FD0730 /* MVMCoreLoadingViewControllerProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVMCoreLoadingViewControllerProtocol.h; sourceTree = "<group>"; };
|
||||
D282AAB52240085300C46919 /* MVMCoreGetterUtility+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MVMCoreGetterUtility+Extension.swift"; sourceTree = "<group>"; };
|
||||
D282AAB72240342D00C46919 /* NSNumber+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSNumber+Extension.swift"; sourceTree = "<group>"; };
|
||||
D2DEDCB623C63F3B00C44CC4 /* Clamping.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Clamping.swift; sourceTree = "<group>"; };
|
||||
D2DEDCB823C6400600C44CC4 /* UnitInterval.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UnitInterval.swift; sourceTree = "<group>"; };
|
||||
D2E1FAD82260C3E400AEFD8C /* DelegateObject.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DelegateObject.swift; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
@ -369,6 +373,7 @@
|
||||
881D26901FCC9D180079C521 /* MVMCoreOperation.m */,
|
||||
AFEA17A6209B6A1C00BC6740 /* MVMCoreBlockOperation.h */,
|
||||
AFEA17A7209B6A1C00BC6740 /* MVMCoreBlockOperation.m */,
|
||||
D2DEDCB523C63F1800C44CC4 /* PropertyWrappers */,
|
||||
AFBB96E71FBA4A260008D868 /* HardCodedServerResponse */,
|
||||
AFBB96AB1FBA3B590008D868 /* Helpers */,
|
||||
);
|
||||
@ -678,6 +683,15 @@
|
||||
path = LoadingOverlay;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
D2DEDCB523C63F1800C44CC4 /* PropertyWrappers */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
D2DEDCB623C63F3B00C44CC4 /* Clamping.swift */,
|
||||
D2DEDCB823C6400600C44CC4 /* UnitInterval.swift */,
|
||||
);
|
||||
path = PropertyWrappers;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXHeadersBuildPhase section */
|
||||
@ -876,6 +890,7 @@
|
||||
881D26931FCC9D180079C521 /* MVMCoreErrorObject.m in Sources */,
|
||||
946EE1B0237B5EF70036751F /* JSONHelper.swift in Sources */,
|
||||
30349BF21FCCA78A00546A1E /* MVMCoreSessionTimeHandler.m in Sources */,
|
||||
D2DEDCB923C6400600C44CC4 /* UnitInterval.swift in Sources */,
|
||||
8876D5E91FB50AB000EB2E3D /* NSArray+MFConvenience.m in Sources */,
|
||||
946EE1B2237B5F260036751F /* JSONValue.swift in Sources */,
|
||||
AFBB96971FBA3A9A0008D868 /* MVMCorePresentViewControllerOperation.m in Sources */,
|
||||
@ -900,6 +915,7 @@
|
||||
01F2A05423A83E9200D954D8 /* KeyedDecodingContainer+CodingKey.swift in Sources */,
|
||||
AFBB96B31FBA3B590008D868 /* MVMCoreGetterUtility.m in Sources */,
|
||||
AF43A7071FC4D7A2008E9347 /* MVMCoreObject.m in Sources */,
|
||||
D2DEDCB723C63F3B00C44CC4 /* Clamping.swift in Sources */,
|
||||
01DF561421F90ADC00CC099B /* Dictionary+MFConvenience.swift in Sources */,
|
||||
AFBB96B11FBA3B590008D868 /* MVMCoreDispatchUtility.m in Sources */,
|
||||
946EE1A3237B59C30036751F /* Model.swift in Sources */,
|
||||
|
||||
26
MVMCore/MVMCore/Utility/PropertyWrappers/Clamping.swift
Normal file
26
MVMCore/MVMCore/Utility/PropertyWrappers/Clamping.swift
Normal file
@ -0,0 +1,26 @@
|
||||
//
|
||||
// Clamping.swift
|
||||
// MVMCore
|
||||
//
|
||||
// Created by Scott Pfeil on 1/8/20.
|
||||
// Copyright © 2020 myverizon. All rights reserved.
|
||||
//
|
||||
// Clamps the value between a given range.
|
||||
|
||||
import Foundation
|
||||
|
||||
@propertyWrapper
|
||||
public struct Clamping<Value: Comparable> {
|
||||
private var value: Value
|
||||
private let range: ClosedRange<Value>
|
||||
|
||||
init(range: ClosedRange<Value>) {
|
||||
self.value = range.lowerBound
|
||||
self.range = range
|
||||
}
|
||||
|
||||
public var wrappedValue: Value {
|
||||
get { value }
|
||||
set { value = min(max(range.lowerBound, newValue), range.upperBound) }
|
||||
}
|
||||
}
|
||||
20
MVMCore/MVMCore/Utility/PropertyWrappers/UnitInterval.swift
Normal file
20
MVMCore/MVMCore/Utility/PropertyWrappers/UnitInterval.swift
Normal file
@ -0,0 +1,20 @@
|
||||
//
|
||||
// UnitInterval.swift
|
||||
// MVMCore
|
||||
//
|
||||
// Created by Scott Pfeil on 1/8/20.
|
||||
// Copyright © 2020 myverizon. All rights reserved.
|
||||
//
|
||||
// Clamps the value between 0 and 1
|
||||
|
||||
import Foundation
|
||||
|
||||
@propertyWrapper
|
||||
public struct UnitInterval<Value: FloatingPoint> {
|
||||
@Clamping(range: 0...1)
|
||||
public var wrappedValue: Value
|
||||
|
||||
public init(wrappedValue value: Value) {
|
||||
self.wrappedValue = value
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user