Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class HPCollectionVC: UICollectionViewController, UICollectionViewDelegateFlowLa
// MARK: - Helper

func sizeForText(_ text: String, maxSize: CGSize) -> CGSize {
let attr: [NSAttributedStringKey: Any] = [.font : font]
let attr: [NSAttributedString.Key: Any] = [.font : font]
var frame = (text as NSString).boundingRect(with: maxSize, options: .usesLineFragmentOrigin, attributes: attr, context: NSStringDrawingContext())
frame = frame.integral
frame.size.width += 10
Expand Down
2 changes: 1 addition & 1 deletion HorizontalPicker/Classes/HorizontalPickerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public class HorizontalPickerView: UIView {
private func adjust(with delegate: HorizontalPickerViewDelegate?, dataSource: HorizontalPickerViewDataSource?) {
guard let delegate = delegate, let dataSource = dataSource, isInitialized == false else { return }

collectionController.font = delegate.textFontForHorizontalPickerView?(pickerView: self) ?? UIFont.preferredFont(forTextStyle: UIFontTextStyle.body)
collectionController.font = delegate.textFontForHorizontalPickerView?(pickerView: self) ?? UIFont.preferredFont(forTextStyle: UIFont.TextStyle.body)
collectionController.textColor = delegate.textColorForHorizontalPickerView?(pickerView: self) ?? UIColor.lightGray
collectionController.useTwoLineMode = delegate.useTwoLineModeForHorizontalPickerView?(pickerView: self) ?? false

Expand Down
11 changes: 11 additions & 0 deletions HorizontalPickerDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
Expand Down Expand Up @@ -671,6 +672,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = de.berndrabe.HorizontalPickerDemo;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -684,6 +686,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = de.berndrabe.HorizontalPickerDemo;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand All @@ -695,6 +698,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = de.berndrabe.HorizontalPickerDemoTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HorizontalPickerDemo.app/HorizontalPickerDemo";
};
name = Debug;
Expand All @@ -707,6 +711,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = de.berndrabe.HorizontalPickerDemoTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HorizontalPickerDemo.app/HorizontalPickerDemo";
};
name = Release;
Expand All @@ -718,6 +723,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = de.berndrabe.HorizontalPickerDemoUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TEST_TARGET_NAME = HorizontalPickerDemo;
USES_XCTRUNNER = YES;
};
Expand All @@ -730,6 +736,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = de.berndrabe.HorizontalPickerDemoUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TEST_TARGET_NAME = HorizontalPickerDemo;
USES_XCTRUNNER = YES;
};
Expand All @@ -755,6 +762,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand All @@ -779,6 +787,7 @@
PRODUCT_BUNDLE_IDENTIFIER = de.berndrabe.HorizontalPicker;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand All @@ -792,6 +801,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = de.berndrabe.HorizontalPickerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HorizontalPickerDemo.app/HorizontalPickerDemo";
};
name = Debug;
Expand All @@ -803,6 +813,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = de.berndrabe.HorizontalPickerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HorizontalPickerDemo.app/HorizontalPickerDemo";
};
name = Release;
Expand Down