diff --git a/Example/RealmContent.xcodeproj/project.pbxproj b/Example/RealmContent.xcodeproj/project.pbxproj index d1a029a..0a995d1 100644 --- a/Example/RealmContent.xcodeproj/project.pbxproj +++ b/Example/RealmContent.xcodeproj/project.pbxproj @@ -364,9 +364,22 @@ files = ( ); inputPaths = ( + "${SRCROOT}/Pods/Target Support Files/Pods-RealmContent_Example/Pods-RealmContent_Example-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/Kingfisher/Kingfisher.framework", + "${BUILT_PRODUCTS_DIR}/MMMarkdown/MMMarkdown.framework", + "${BUILT_PRODUCTS_DIR}/NSString+Color/NSString_Color.framework", + "${BUILT_PRODUCTS_DIR}/Realm/Realm.framework", + "${BUILT_PRODUCTS_DIR}/RealmContent/RealmContent.framework", + "${BUILT_PRODUCTS_DIR}/RealmSwift/RealmSwift.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Kingfisher.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MMMarkdown.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/NSString_Color.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Realm.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RealmContent.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RealmSwift.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -379,13 +392,16 @@ files = ( ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-RealmContent_Example-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; 92A3FFBC474A2B332CB77CA9 /* [CP] Embed Pods Frameworks */ = { @@ -409,13 +425,16 @@ files = ( ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-RealmContent_Tests-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ diff --git a/RealmContent.podspec b/RealmContent.podspec index e2cdf9e..de2de81 100644 --- a/RealmContent.podspec +++ b/RealmContent.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'RealmContent' - s.version = '0.2.0' + s.version = '0.2.1' s.summary = 'Realm powered content management system' s.description = <<-DESC diff --git a/RealmContent/Core/View/ContentViewController.swift b/RealmContent/Core/View/ContentViewController.swift index 4d4e940..9d7da2f 100644 --- a/RealmContent/Core/View/ContentViewController.swift +++ b/RealmContent/Core/View/ContentViewController.swift @@ -110,9 +110,7 @@ public class ContentViewController: UIViewController, UITableViewDataSource, UIT } } - pageElementsUpdatesToken = page.elements - .filter(NSPredicate(format: "type in %@", ContentElement.Kind.allRawValues())) - .addNotificationBlock(applyChanges) + pageElementsUpdatesToken = page.elements.addNotificationBlock(applyChanges) } private func populateFrom(page: ContentPage) { @@ -126,7 +124,7 @@ public class ContentViewController: UIViewController, UITableViewDataSource, UIT } } - private func applyChanges(_ changes: RealmCollectionChange>) { + private func applyChanges(_ changes: RealmCollectionChange>) { let section = 0 switch changes { diff --git a/RealmContent/Core/View/ImageContentCell.swift b/RealmContent/Core/View/ImageContentCell.swift index b2cdd56..78e023a 100644 --- a/RealmContent/Core/View/ImageContentCell.swift +++ b/RealmContent/Core/View/ImageContentCell.swift @@ -43,18 +43,15 @@ public class ImageContentCell: UITableViewCell { override init(style: UITableViewCellStyle, reuseIdentifier: String?) { super.init(style: style, reuseIdentifier: reuseIdentifier) - let marginGuide = contentView.layoutMarginsGuide - + img.translatesAutoresizingMaskIntoConstraints = true img.contentMode = .scaleAspectFit + img.frame = contentView.bounds.insetBy(dx: layoutMargins.left, dy: layoutMargins.top) + img.autoresizingMask = [.flexibleWidth, .flexibleHeight] - // configure titleLabel contentView.addSubview(img) - img.translatesAutoresizingMaskIntoConstraints = false - img.leadingAnchor.constraint(equalTo: marginGuide.leadingAnchor).isActive = true - img.topAnchor.constraint(equalTo: marginGuide.topAnchor).isActive = true - img.trailingAnchor.constraint(equalTo: marginGuide.trailingAnchor).isActive = true - img.bottomAnchor.constraint(equalTo: marginGuide.bottomAnchor).isActive = true - heightConstraint = img.heightAnchor.constraint(equalToConstant: 20) + + heightConstraint = contentView.heightAnchor.constraint(equalToConstant: 20) + heightConstraint.priority = 500 heightConstraint.isActive = true }