Skip to content

Commit

Permalink
Merge pull request #47 from willowtreeapps/develop
Browse files Browse the repository at this point in the history
Merge develop into master.
  • Loading branch information
chrsmys authored Jan 22, 2018
2 parents 28bad72 + 49f5920 commit dd88fc2
Show file tree
Hide file tree
Showing 57 changed files with 280 additions and 87 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ @implementation HYPAttributedStringAttributeProvider
{
NSMutableArray<id<HYPInspectorAttribute>> *viewAttributes = [[NSMutableArray alloc] init];

[attributedString enumerateAttributesInRange:NSMakeRange(0, attributedString.length) options:0 usingBlock:^(NSDictionary<NSAttributedStringKey,id> * _Nonnull attrs, NSRange range, BOOL * _Nonnull stop) {
[attributedString enumerateAttributesInRange:NSMakeRange(0, attributedString.length) options:0 usingBlock:^(NSDictionary<NSString *,id> * _Nonnull attrs, NSRange range, BOOL * _Nonnull stop) {
HYPAttributedStringInspectorAttribute *attribute = [[HYPAttributedStringInspectorAttribute alloc] initWithAttributedString:[attributedString attributedSubstringFromRange:range] range:range];
[viewAttributes addObject:attribute];
}];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ -(Class)providerClass

HYPKeyValueInspectorAttribute *accessibilityHintAttribute = [[HYPKeyValueInspectorAttribute alloc] initWithKey:@"Accessibility Hint" value:view.accessibilityHint ? view.accessibilityHint : @"--" ];
[viewAttributes addObject:accessibilityHintAttribute];

HYPKeyValueInspectorAttribute *accessibilityIDAttribute = [[HYPKeyValueInspectorAttribute alloc] initWithKey:@"Accessibility ID" value:view.accessibilityIdentifier ? view.accessibilityIdentifier : @"--" ];
[viewAttributes addObject:accessibilityIDAttribute];


return viewAttributes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ -(instancetype)initWithAttributedString:(NSAttributedString *)string
{
self = [[NSBundle bundleForClass:[self class]] loadNibNamed:@"HYPTextPreview" owner:self options:nil].firstObject;

__block NSDictionary<NSAttributedStringKey,id> *attributes;
__block NSDictionary<NSString *,id> *attributes;
__block BOOL viewTooComplicated = false;

NSRange range = NSMakeRange(0, string.length);

[string enumerateAttributesInRange:range options:0 usingBlock:^(NSDictionary<NSAttributedStringKey,id> * _Nonnull attrs, NSRange range, BOOL * _Nonnull stop) {
[string enumerateAttributesInRange:range options:0 usingBlock:^(NSDictionary<NSString *,id> * _Nonnull attrs, NSRange range, BOOL * _Nonnull stop) {

if (attributes)
{
Expand Down
4 changes: 4 additions & 0 deletions Core/Public/HyperionManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,10 @@ -(void)setActivationGesture:(HYPActivationGestureOptions)gesture {
NSMutableArray<id<HYPPluginModule>> *mutablePluginModules = [[NSMutableArray alloc] init];
NSArray<Class<HYPPlugin>> *pluginClasses = [self retrievePluginClasses];

pluginClasses = [pluginClasses sortedArrayUsingComparator:^NSComparisonResult(id _Nonnull obj1, id _Nonnull obj2) {
return [[[obj1 class] description] compare:[[obj2 class] description]];
}];

for (Class<HYPPlugin> pluginClass in pluginClasses)
{
if ([pluginClass conformsToProtocol:@protocol(HYPPlugin)])
Expand Down
14 changes: 13 additions & 1 deletion Core/Public/Plugin/HYPPluginHelper.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@ @implementation HYPPluginHelper
{
NSMutableArray<UIView *> *potentialSelectionViews = [[NSMutableArray alloc] init];
NSArray *subviews = [view subviews];
NSSet *blackList = [self blacklistedViews];

for (UIView *subView in [subviews reverseObjectEnumerator])
{
if (subView.alpha > 0 && !subView.hidden)
{
[potentialSelectionViews addObjectsFromArray:[self findSubviewsInView:subView intersectingPoint:point]];

if ([self view:subView surrondsPoint:point])
if ([self view:subView surrondsPoint:point] && ![blackList containsObject:NSStringFromClass([subView class])])
{
[potentialSelectionViews addObject:subView];
}
Expand All @@ -52,4 +53,15 @@ +(BOOL)view:(UIView *)view surrondsPoint:(CGPoint)point
viewRect.origin.y <= point.y && (viewRect.size.height + viewRect.origin.y) >= point.y;
}

/**
* This returns a list of views that we do not want to show up as selectable views.
* Reference: https://github.com/willowtreeapps/Hyperion-iOS/issues/31
*/
+(NSSet *)blacklistedViews
{
NSMutableSet *blackListedViews = [[NSMutableSet alloc] initWithArray:@[@"_UINavigationControllerPaletteClippingView"]];

return blackListedViews;
}

@end
5 changes: 5 additions & 0 deletions Core/Public/Plugin/HYPPluginMenuItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,9 @@
*/
@property (nonatomic) UIImageView *pluginImageView;

/**
* The height of the plugin menu item. This value defaults to 130.
*/
@property (nonatomic) CGFloat height;

@end
19 changes: 17 additions & 2 deletions Core/Public/Plugin/HYPPluginMenuItem.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
//

#import "HYPPluginMenuItem.h"
@interface HYPPluginMenuItem()

@property (nonatomic) NSLayoutConstraint *heightConstraint;

@end
@implementation HYPPluginMenuItem
@synthesize delegate = _delegate;
@synthesize selected = _selected;
Expand All @@ -34,19 +39,23 @@ -(instancetype)init
self.titleLabel.translatesAutoresizingMaskIntoConstraints = false;
self.pluginImageView.translatesAutoresizingMaskIntoConstraints = false;

_height = 130;

self.heightConstraint = [self.heightAnchor constraintEqualToConstant:_height];
self.heightConstraint.active = true;

[self addSubview:self.titleLabel];
[self addSubview:self.pluginImageView];

[self.pluginImageView.topAnchor constraintEqualToAnchor:self.topAnchor constant:50].active = true;
[self.pluginImageView.bottomAnchor constraintEqualToAnchor:self.bottomAnchor constant:-50].active = true;
[self.pluginImageView.heightAnchor constraintEqualToConstant:30].active = true;
[self.pluginImageView.widthAnchor constraintEqualToConstant:30].active = true;

[self.pluginImageView.leadingAnchor constraintEqualToAnchor:self.leadingAnchor constant:45].active = true;

self.titleLabel.numberOfLines = 2;
[self.titleLabel.leadingAnchor constraintEqualToAnchor:self.pluginImageView.trailingAnchor constant:28].active = true;
[self.titleLabel.centerYAnchor constraintEqualToAnchor:self.centerYAnchor].active = true;
[self.titleLabel.centerYAnchor constraintEqualToAnchor:self.pluginImageView.centerYAnchor].active = true;
[self.titleLabel.widthAnchor constraintEqualToConstant:114].active = true;

[self setSelected:NO animated:NO];
Expand Down Expand Up @@ -87,4 +96,10 @@ -(void)setSelected:(BOOL)selected animated:(BOOL)animated;
self.pluginImageView.tintColor = self.titleLabel.textColor;
}

-(void)setHeight:(CGFloat)height
{
_height = height;
self.heightConstraint.constant = _height;
}

@end
14 changes: 9 additions & 5 deletions HyperioniOS.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'HyperioniOS'
s.version = '1.0.1'
s.version = '1.0.2'
s.summary = 'Hyperion is an app design review tool that allows you to inspect views and perform measurements live within your app.'

# This description is used to generate tags and improve search results.
Expand All @@ -31,26 +31,30 @@ Hyperion is an app design review tool that allows you to inspect views and perfo
s.frameworks = ["UIKit"]

s.subspec 'Core' do |core|
core.source_files = 'Core/**/*'
core.source_files = 'Core/**/*.{h,m}'
core.exclude_files = 'Core/**/*.md'
core.resources = ['Core/**/*.png', 'Core/**/*.xib', 'Core/**/*.plist']
end

s.subspec 'AttributesInspector' do |attributes|
attributes.dependency 'HyperioniOS/Core'
attributes.source_files = 'AttributesInspector/**/*'
attributes.source_files = 'AttributesInspector/**/*.{h,m}'
attributes.exclude_files = 'AttributesInspector/**/*.md'
attributes.resources = ['AttributesInspector/**/*.png', 'AttributesInspector/**/*.xib', 'AttributesInspector/**/*.plist']
end

s.subspec 'SlowAnimations' do |slowanimations|
slowanimations.dependency 'HyperioniOS/Core'
slowanimations.source_files = 'SlowAnimations/**/*'
slowanimations.source_files = 'SlowAnimations/**/*.{h,m}'
slowanimations.exclude_files = 'SlowAnimations/**/*.md'
slowanimations.resources = ['SlowAnimations/**/*.png', 'SlowAnimations/**/*.xib', 'SlowAnimations/**/*.plist']
end

s.subspec 'Measurements' do |measurements|
measurements.dependency 'HyperioniOS/Core'
measurements.source_files = 'Measurements/**/*'
measurements.source_files = 'Measurements/**/*.{h,m}'
measurements.exclude_files = 'Measurements/**/*.md'
measurements.resources = ['Measurements/**/*.png', 'Measurements/**/*.xib', 'Measurements/**/*.plist']
end

end
2 changes: 2 additions & 0 deletions SlowAnimations/HYPSlowAnimationsPluginMenuItem.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ -(instancetype)init
{
self = [super init];

self.height = 160;

_quarterSpeed = [UIButton buttonWithType:UIButtonTypeCustom];

[_quarterSpeed setImage:[UIImage imageWithContentsOfFile:[[NSBundle bundleForClass:[self class]] pathForResource:@"25x-Unselected" ofType:@"png"]] forState:UIControlStateNormal];
Expand Down
4 changes: 2 additions & 2 deletions docs/Classes.html
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ <h4>Declaration</h4>
</div>
</div>
<div class="slightly-smaller">
<a href="https://github.com/willowtreeapps/Hyperion-iOS/tree/master//Core/Public/Plugin/HYPPluginMenuItem.h#L66-L93">Show on GitHub</a>
<a href="https://github.com/willowtreeapps/Hyperion-iOS/tree/master//Core/Public/Plugin/HYPPluginMenuItem.h#L66-L98">Show on GitHub</a>
</div>
</section>
</div>
Expand Down Expand Up @@ -363,7 +363,7 @@ <h4>Declaration</h4>
</section>
</section>
<section id="footer">
<p>&copy; 2017 <a class="link" href="http://willowtreeapps.com" target="_blank" rel="external">WillowTree</a>. All rights reserved. (Last updated: 2017-12-07)</p>
<p>&copy; 2018 <a class="link" href="http://willowtreeapps.com" target="_blank" rel="external">WillowTree</a>. All rights reserved. (Last updated: 2018-01-22)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
Expand Down
2 changes: 1 addition & 1 deletion docs/Classes/HYPPluginHelper.html
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ <h4>Parameters</h4>
</section>
</section>
<section id="footer">
<p>&copy; 2017 <a class="link" href="http://willowtreeapps.com" target="_blank" rel="external">WillowTree</a>. All rights reserved. (Last updated: 2017-12-07)</p>
<p>&copy; 2018 <a class="link" href="http://willowtreeapps.com" target="_blank" rel="external">WillowTree</a>. All rights reserved. (Last updated: 2018-01-22)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
Expand Down
37 changes: 36 additions & 1 deletion docs/Classes/HYPPluginMenuItem.html
Original file line number Diff line number Diff line change
Expand Up @@ -300,12 +300,47 @@ <h4>Declaration</h4>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/c:objc(cs)HYPPluginMenuItem(py)height"></a>
<a name="//apple_ref/objc/Property/height" class="dashAnchor"></a>
<a class="token" href="#/c:objc(cs)HYPPluginMenuItem(py)height">height</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The height of the plugin menu item. This value defaults to 130.</p>

</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Objective-C</p>
<pre class="highlight"><code><span class="k">@property</span> <span class="p">(</span><span class="n">assign</span><span class="p">,</span> <span class="n">readwrite</span><span class="p">,</span> <span class="n">nonatomic</span><span class="p">)</span> <span class="n">CGFloat</span> <span class="n">height</span><span class="p">;</span></code></pre>

</div>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="k">var</span> <span class="nv">height</span><span class="p">:</span> <span class="kt">Int32</span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>

</div>
</div>
<div class="slightly-smaller">
<a href="https://github.com/willowtreeapps/Hyperion-iOS/tree/master//Core/Public/Plugin/HYPPluginMenuItem.h#L96">Show on GitHub</a>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>&copy; 2017 <a class="link" href="http://willowtreeapps.com" target="_blank" rel="external">WillowTree</a>. All rights reserved. (Last updated: 2017-12-07)</p>
<p>&copy; 2018 <a class="link" href="http://willowtreeapps.com" target="_blank" rel="external">WillowTree</a>. All rights reserved. (Last updated: 2018-01-22)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
Expand Down
2 changes: 1 addition & 1 deletion docs/Classes/HYPSnapShotInteractionView.html
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ <h4>Declaration</h4>
</section>
</section>
<section id="footer">
<p>&copy; 2017 <a class="link" href="http://willowtreeapps.com" target="_blank" rel="external">WillowTree</a>. All rights reserved. (Last updated: 2017-12-07)</p>
<p>&copy; 2018 <a class="link" href="http://willowtreeapps.com" target="_blank" rel="external">WillowTree</a>. All rights reserved. (Last updated: 2018-01-22)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
Expand Down
2 changes: 1 addition & 1 deletion docs/Classes/HYPSnapshotPluginModule.html
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ <h4>Return Value</h4>
</section>
</section>
<section id="footer">
<p>&copy; 2017 <a class="link" href="http://willowtreeapps.com" target="_blank" rel="external">WillowTree</a>. All rights reserved. (Last updated: 2017-12-07)</p>
<p>&copy; 2018 <a class="link" href="http://willowtreeapps.com" target="_blank" rel="external">WillowTree</a>. All rights reserved. (Last updated: 2018-01-22)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
Expand Down
2 changes: 1 addition & 1 deletion docs/Classes/HyperionManager.html
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ <h4>Declaration</h4>
</section>
</section>
<section id="footer">
<p>&copy; 2017 <a class="link" href="http://willowtreeapps.com" target="_blank" rel="external">WillowTree</a>. All rights reserved. (Last updated: 2017-12-07)</p>
<p>&copy; 2018 <a class="link" href="http://willowtreeapps.com" target="_blank" rel="external">WillowTree</a>. All rights reserved. (Last updated: 2018-01-22)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
Expand Down
2 changes: 1 addition & 1 deletion docs/Constants.html
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ <h4>Declaration</h4>
</section>
</section>
<section id="footer">
<p>&copy; 2017 <a class="link" href="http://willowtreeapps.com" target="_blank" rel="external">WillowTree</a>. All rights reserved. (Last updated: 2017-12-07)</p>
<p>&copy; 2018 <a class="link" href="http://willowtreeapps.com" target="_blank" rel="external">WillowTree</a>. All rights reserved. (Last updated: 2018-01-22)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
Expand Down
2 changes: 1 addition & 1 deletion docs/Enums.html
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ <h4>Declaration</h4>
</section>
</section>
<section id="footer">
<p>&copy; 2017 <a class="link" href="http://willowtreeapps.com" target="_blank" rel="external">WillowTree</a>. All rights reserved. (Last updated: 2017-12-07)</p>
<p>&copy; 2018 <a class="link" href="http://willowtreeapps.com" target="_blank" rel="external">WillowTree</a>. All rights reserved. (Last updated: 2018-01-22)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
Expand Down
2 changes: 1 addition & 1 deletion docs/Enums/HYPActivationGestureOptions.html
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ <h4>Declaration</h4>
</section>
</section>
<section id="footer">
<p>&copy; 2017 <a class="link" href="http://willowtreeapps.com" target="_blank" rel="external">WillowTree</a>. All rights reserved. (Last updated: 2017-12-07)</p>
<p>&copy; 2018 <a class="link" href="http://willowtreeapps.com" target="_blank" rel="external">WillowTree</a>. All rights reserved. (Last updated: 2018-01-22)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
Expand Down
2 changes: 1 addition & 1 deletion docs/Protocols.html
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ <h4>Declaration</h4>
</section>
</section>
<section id="footer">
<p>&copy; 2017 <a class="link" href="http://willowtreeapps.com" target="_blank" rel="external">WillowTree</a>. All rights reserved. (Last updated: 2017-12-07)</p>
<p>&copy; 2018 <a class="link" href="http://willowtreeapps.com" target="_blank" rel="external">WillowTree</a>. All rights reserved. (Last updated: 2018-01-22)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
Expand Down
2 changes: 1 addition & 1 deletion docs/Protocols/HYPOverlayContainer.html
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ <h4>Declaration</h4>
</section>
</section>
<section id="footer">
<p>&copy; 2017 <a class="link" href="http://willowtreeapps.com" target="_blank" rel="external">WillowTree</a>. All rights reserved. (Last updated: 2017-12-07)</p>
<p>&copy; 2018 <a class="link" href="http://willowtreeapps.com" target="_blank" rel="external">WillowTree</a>. All rights reserved. (Last updated: 2018-01-22)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
Expand Down
2 changes: 1 addition & 1 deletion docs/Protocols/HYPOverlayPluginViewProvider.html
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ <h4>Declaration</h4>
</section>
</section>
<section id="footer">
<p>&copy; 2017 <a class="link" href="http://willowtreeapps.com" target="_blank" rel="external">WillowTree</a>. All rights reserved. (Last updated: 2017-12-07)</p>
<p>&copy; 2018 <a class="link" href="http://willowtreeapps.com" target="_blank" rel="external">WillowTree</a>. All rights reserved. (Last updated: 2018-01-22)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
Expand Down
Loading

0 comments on commit dd88fc2

Please # to comment.