Skip to content

Commit

Permalink
Merge pull request #72 from Raizlabs/feature/zeveisenberg/66-chain-co…
Browse files Browse the repository at this point in the history
…mposition

Feature/zeveisenberg/66 chain composition
  • Loading branch information
ZevEisenberg committed Oct 12, 2015
2 parents fabc9ef + 6740b58 commit 866e18c
Show file tree
Hide file tree
Showing 33 changed files with 837 additions and 424 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# * https://github.com/supermarin/xcpretty#usage

language: objective-c
osx_image: xcode6.4
osx_image: xcode7
# cache: cocoapods
# podfile: Example/Podfile
# before_install:
Expand Down
36 changes: 36 additions & 0 deletions Example/BonMot.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@
CD24988C1B30CBA90055F2A7 /* BONTrackingTestCase.m */,
CD39D86D1B7FE1CB00336231 /* BONIndentSpacerTestCase.m */,
CDFDF5531B518F3900A1AD42 /* BONDictionaryEqualityTestCase.m */,
CDB7D3581BC86FF8006B842F /* BONChainableTestCase.m */,
CDAB918B1B5F2A410023E432 /* BONTextAlignmentConstraintTestCase.m */,
6003F5B6195388D20070C39A /* Supporting Files */,
);
Expand Down Expand Up @@ -364,6 +365,7 @@
6003F587195388D20070C39A /* Frameworks */,
6003F588195388D20070C39A /* Resources */,
BE78F1BA6C5EE44EDEB3F0D1 /* Copy Pods Resources */,
9A3EDE593CCFF3A23E681016 /* Embed Pods Frameworks */,
);
buildRules = (
);
Expand All @@ -383,6 +385,7 @@
6003F5AB195388D20070C39A /* Frameworks */,
6003F5AC195388D20070C39A /* Resources */,
4B189F1C62BA8C46507CA25B /* Copy Pods Resources */,
F8E39F3EA9A6C644F3FCE452 /* Embed Pods Frameworks */,
);
buildRules = (
);
Expand Down Expand Up @@ -489,6 +492,21 @@
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Tests/Pods-Tests-resources.sh\"\n";
showEnvVarsInLog = 0;
};
9A3EDE593CCFF3A23E681016 /* Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Embed Pods Frameworks";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-BonMot/Pods-BonMot-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
BE78F1BA6C5EE44EDEB3F0D1 /* Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -519,6 +537,21 @@
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
F8E39F3EA9A6C644F3FCE452 /* Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Embed Pods Frameworks";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Tests/Pods-Tests-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
Expand Down Expand Up @@ -554,6 +587,7 @@
CDB7D35B1BC88C05006B842F /* BONPropertyClobberingTestCase.m in Sources */,
CDFDF5541B518F3900A1AD42 /* BONDictionaryEqualityTestCase.m in Sources */,
CDFCA9E11B5078E0000E47DB /* BONBaseTestCase.m in Sources */,
CDB7D3591BC86FF8006B842F /* BONChainableTestCase.m in Sources */,
CD39D86E1B7FE1CB00336231 /* BONIndentSpacerTestCase.m in Sources */,
CD24988D1B30CBA90055F2A7 /* BONTrackingTestCase.m in Sources */,
CDAB918C1B5F2A410023E432 /* BONTextAlignmentConstraintTestCase.m in Sources */,
Expand Down Expand Up @@ -702,6 +736,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
HEADER_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = "BonMot/BonMot-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
PRODUCT_NAME = BonMot;
Expand All @@ -715,6 +750,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
HEADER_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = "BonMot/BonMot-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
PRODUCT_NAME = BonMot;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0600"
LastUpgradeVersion = "0700"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -23,10 +23,10 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -48,15 +48,18 @@
ReferencedContainer = "container:BonMot.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
Expand All @@ -72,10 +75,10 @@
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
Expand Down
6 changes: 3 additions & 3 deletions Example/BonMot/Cells/IndentationCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ - (void)awakeFromNib
BONChain *firstBaseTextChain = BONChain.new.fontNameAndSize(@"AvenirNextCondensed-Medium", 18.0f);
BONChain *imageChain = firstBaseTextChain.image(image).indentSpacer(4.0f).baselineOffset(-6.0f);

imageChain.append(firstBaseTextChain.string(quote))
.append(firstBaseTextChain.string(attribution));
[imageChain appendLink:firstBaseTextChain.string(quote)];
[imageChain appendLink:firstBaseTextChain.string(attribution)];

NSAttributedString *imageAttributedString = imageChain.attributedString;

Expand All @@ -44,7 +44,7 @@ - (void)awakeFromNib
NSString *secondQuote = @"You can also use strings (including emoji) for bullets as well, and they will still properly indent the appended text by the right amount.";
BONChain *secondBaseTextChain = BONChain.new.fontNameAndSize(@"AvenirNextCondensed-Regular", 18.0f);
BONChain *secondChain = secondBaseTextChain.string(@"🍑 →").indentSpacer(4.0f).textColor([UIColor orangeColor]);
secondChain.append(secondBaseTextChain.string(secondQuote).textColor([UIColor darkGrayColor]));
[secondChain appendLink:secondBaseTextChain.string(secondQuote).textColor([UIColor darkGrayColor])];

NSAttributedString *textAttributedString = secondChain.attributedString;
self.stringPrefixLabel.attributedText = textAttributedString;
Expand Down
17 changes: 9 additions & 8 deletions Example/BonMot/Cells/InlineImagesCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,16 @@ - (void)awakeFromNib
BONChain *spaceChain = BONChain.new.string(@" ");

BONChain *wholeString = BONChain.new;
wholeString
.append(twoChain)
.appendWithSeparator(@" ", beeChain)
.appendWithSeparator(@" ", oarChain)
.appendWithSeparator(@" ", knotChain)
[wholeString appendLink:twoChain];
[wholeString appendLink:beeChain separator:@" "];
[wholeString appendLink:oarChain separator:@" "];
[wholeString appendLink:knotChain separator:@" "];

// you can also append the space and the chain separately if you prefer
.append(spaceChain)
.append(twoChain)
.appendWithSeparator(@" ", beeChain);
[wholeString appendLink:spaceChain];
[wholeString appendLink:twoChain];

[wholeString appendLink:beeChain separator:@" "];

self.label.attributedText = wholeString.attributedString;

Expand Down
2 changes: 1 addition & 1 deletion Example/BonMot/Cells/SpecialCharactersCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ - (void)awakeFromNib
UIImage *image = [UIImage imageNamed:imageNames[theIndex]];
NSAssert(image, @"Image must not be nil");
BONChain *chunk = baseImageChain.image(image);
chunk.appendWithSeparator(BONSpecial.noBreakSpace, baseTextChain.string(words[theIndex]));
[chunk appendLink:baseTextChain.string(words[theIndex]) separator:BONSpecial.noBreakSpace];

[chunks addObject:chunk.text];
}
Expand Down
6 changes: 3 additions & 3 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- BonMot (1.2)
- BonMot (1.2.2)

DEPENDENCIES:
- BonMot (from `../`)
Expand All @@ -9,6 +9,6 @@ EXTERNAL SOURCES:
:path: "../"

SPEC CHECKSUMS:
BonMot: d712a7b8b9a7d29e5ca64cb56ab784f4c26f864b
BonMot: 3001d57d0ca8f49f039df79286fd3f14b360f3e1

COCOAPODS: 0.38.2
COCOAPODS: 0.39.0
1 change: 1 addition & 0 deletions Example/Pods/Headers/Private/BonMot/BONChainable.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Example/Pods/Headers/Public/BonMot/BONChainable.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Example/Pods/Local Podspecs/BonMot.podspec.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Example/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 866e18c

Please sign in to comment.