typo fixes

This commit is contained in:
Pfeil, Scott Robert 2019-11-07 10:05:17 -05:00
parent 4a1a196854
commit 347ebbed8c
19 changed files with 38 additions and 34 deletions

View File

@ -50,7 +50,7 @@
+ (nonnull ViewConstrainingView *)viewConstrainingView:(nonnull UIView *)view;
// Can be initialized with a molecule to constrain
- (nullable instancetype)initWithMolecule:(nonnull UIView <MVMCoreUIMoleculeViewProtocol>*)molecule alignment:(UIStackViewAlignment)alignment;
- (nonnull instancetype)initWithMolecule:(nonnull UIView <MVMCoreUIMoleculeViewProtocol>*)molecule alignment:(UIStackViewAlignment)alignment;
#pragma mark - Constraining

View File

@ -23,7 +23,7 @@
@implementation ViewConstrainingView
- (nullable instancetype)initWithMolecule:(nonnull UIView <MVMCoreUIMoleculeViewProtocol>*)molecule alignment:(UIStackViewAlignment)alignment {
- (nonnull instancetype)initWithMolecule:(nonnull UIView <MVMCoreUIMoleculeViewProtocol>*)molecule alignment:(UIStackViewAlignment)alignment {
if (self = [super init]) {
if (!molecule.superview) {
[self addConstrainedView:molecule alignment:alignment];

View File

@ -13,12 +13,12 @@ extension Encodable {
}
public func toJSON() -> JSONObject? {
guard let data = try? self.encode() else { return nil }
guard let data = try? encode() else { return nil }
return (try? JSONSerialization.jsonObject(with: data, options: .allowFragments)).flatMap { $0 as? JSONObject }
}
public func toJSONString() -> String? {
guard let data = try? self.encode(),
guard let data = try? encode(),
let string = String(data: data, encoding: .utf8) else {
return nil
}

View File

@ -69,8 +69,8 @@ extension Holder {
public func encode(to encoder: Encoder) throws {
var container = encoder.singleValueContainer()
guard let encode = HolderManager.encoders[self.name],
let holdable = self.object as? Holdable else{
guard let encode = HolderManager.encoders[name],
let holdable = object as? Holdable else {
throw HolderManager.Error.encoderError
}
try encode(holdable, &container)

View File

@ -1,5 +1,5 @@
//
// SeperatorModel.swift
// LineModel.swift
// MVMCoreUI
//
// Created by Suresh, Kamlesh on 10/28/19.
@ -8,8 +8,8 @@
import UIKit
@objcMembers public class SeperatorModel: MoleculeProtocol {
public static var identifier: String = "seperator"
@objcMembers public class LineModel: MoleculeProtocol {
public static var identifier: String = "line"
public var moleculeName: String?
public var type: String?

View File

@ -12,7 +12,7 @@ import UIKit
public var template: String?
public var pageType: String?
public var screenHeading: String?
public var isAtomicTabs: Bool = false
public var isAtomicTabs: Bool? = false
public var header: HeaderModel?
public var molecules: [ListItemModel]?
}

View File

@ -8,7 +8,6 @@
#import <UIKit/UIKit.h>
@import MVMCore.MVMCoreViewProtocol;
//@import MVMCoreUI.Swift;
@class MVMCoreUIDelegateObject;
@class MVMCoreErrorObject;
@class MoleculeProtocol;

View File

@ -10,7 +10,6 @@ import Foundation
import UIKit
import MVMCore.MVMCoreViewProtocol
//@import MVMCoreUI.Swift;
@objc public protocol MoleculeViewProtocol: MVMCoreViewProtocol {

View File

@ -67,7 +67,7 @@ public class StandardHeaderView: ViewConstrainingView, ModelMoleculeViewProtocol
return
}
if let seperatorModel = headerModel.seperator?.object as? SeperatorModel {
if let seperatorModel = headerModel.seperator?.object as? LineModel {
separatorView?.setWithJSON(seperatorModel.toJSON(), delegateObject: delegateObject, additionalData: additionalData)
}
}

View File

@ -8,7 +8,6 @@
import Foundation
public extension MVMCoreUIMoleculeMappingObject {
func createMolecule(_ model: MoleculeProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> (UIView & MVMCoreUIMoleculeViewProtocol)? {
@ -17,11 +16,11 @@ public extension MVMCoreUIMoleculeMappingObject {
func createMolecule(_ model: MoleculeProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ constrainIfNeeded: Bool) -> (UIView & MVMCoreUIMoleculeViewProtocol)? {
guard let moleculeName = model.moleculeName,
let molecule = createMolecule(forName: moleculeName) as? MVMCoreUIViewConstrainingProtocol & UIView & MVMCoreUIMoleculeViewProtocol else {
let molecule = createMolecule(forName: moleculeName) else {
return nil
}
let setData = {() in
let setData = {(molecule: UIView & MVMCoreUIMoleculeViewProtocol) in
if let molecule = molecule as? ModelMoleculeViewProtocol {
molecule.setWithModel(model, delegateObject, nil)
} else {
@ -29,12 +28,13 @@ public extension MVMCoreUIMoleculeMappingObject {
}
}
if constrainIfNeeded, molecule.needsToBeConstrained?() ?? false {
let viewConstrainingView = ViewConstrainingView(molecule: molecule, alignment: molecule.alignment?() ?? .fill)
setData()
return viewConstrainingView
}
setData()
if constrainIfNeeded, let castMolecule = molecule as? MVMCoreUIViewConstrainingProtocol, castMolecule.needsToBeConstrained?() ?? false {
let view = ViewConstrainingView(molecule: molecule, alignment: castMolecule.alignment?() ?? .fill)
setData(view)
return view
} else {
setData(molecule)
return molecule
}
}
}

View File

@ -17,6 +17,6 @@ import Foundation
HolderManager.register(ListItemModel.self)
HolderManager.register(MoleculeStackItemModel.self)
HolderManager.register(TextFieldModel.self)
HolderManager.register(SeperatorModel.self)
HolderManager.register(LineModel.self)
}
}

View File

@ -73,10 +73,16 @@
}
+ (nullable instancetype)sharedMappingObject {
[MVMCoreUIMoleculeMappingObject registerObjects];
return [MVMCoreActionUtility initializerClassCheck:[MVMCoreUIObject sharedInstance].moleculeMap classToVerify:self];
}
- (instancetype)init {
if (self = [super init]) {
[MVMCoreUIMoleculeMappingObject registerObjects];
}
return self;
}
- (nullable Class)getMoleculeClassWithJSON:(nonnull NSDictionary *)json {
NSString *moleculeName = [json string:KeyMoleculeName];
if (moleculeName) {