Skip to content

Commit

Permalink
Major code rewrite / cleanup. closes #56 #60
Browse files Browse the repository at this point in the history
- MBProgressHUD now requires LLVM 3+

- instance variables moved to the class implementation or removed (using synthesized instance vars)
- using KVO instead of custom accessors
- completely rewritten layout and UI buildup code
- more concise arc conditionals
- added MBProgressHUDModeText (+ example)
- various documentation fixes
- migrated to @autoreleasepool
- general source code cleanup and restructuring
- removed deprecated delegate callback
- version bump to 5.0
  • Loading branch information
matej committed Mar 22, 2012
1 parent caf3980 commit 4af1759
Show file tree
Hide file tree
Showing 5 changed files with 557 additions and 658 deletions.
14 changes: 14 additions & 0 deletions Demo/Classes/HudDemoViewController.m
Expand Up @@ -188,6 +188,20 @@ - (IBAction)showWithGradient:(id)sender {
[HUD showWhileExecuting:@selector(myTask) onTarget:self withObject:nil animated:YES];
}

- (IBAction)showTextOnly:(id)sender {

MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.navigationController.view animated:YES];

// Configure for text only and offset down
hud.mode = MBProgressHUDModeText;
hud.labelText = @"Some message...";
hud.margin = 10.f;
hud.yOffset = 150.f;
hud.removeFromSuperViewOnHide = YES;

[hud hide:YES afterDelay:3];
}

#pragma mark -
#pragma mark Execution code

Expand Down
49 changes: 45 additions & 4 deletions Demo/en.lproj/HudDemoViewController.xib
Expand Up @@ -299,13 +299,37 @@
<string key="NSFrame">{{20, 499}, {280, 40}}</string>
<reference key="NSSuperview" ref="821963304"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="686140023"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">3</int>
<int key="IBUIButtonType">1</int>
<string key="IBUINormalTitle">With Gradient</string>
<string key="IBUINormalTitle">Dim background</string>
<reference key="IBUIHighlightedTitleColor" ref="434568641"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA</bytes>
</object>
<reference key="IBUINormalTitleShadowColor" ref="612289531"/>
<reference key="IBUIFontDescription" ref="931117317"/>
<reference key="IBUIFont" ref="432819284"/>
</object>
<object class="IBUIButton" id="686140023">
<reference key="NSNextResponder" ref="821963304"/>
<int key="NSvFlags">294</int>
<string key="NSFrame">{{20, 547}, {280, 40}}</string>
<reference key="NSSuperview" ref="821963304"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">3</int>
<int key="IBUIButtonType">1</int>
<string key="IBUINormalTitle">Text only</string>
<reference key="IBUIHighlightedTitleColor" ref="434568641"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
Expand All @@ -316,7 +340,7 @@
<reference key="IBUIFont" ref="432819284"/>
</object>
</object>
<string key="NSFrameSize">{320, 546}</string>
<string key="NSFrameSize">{320, 607}</string>
<reference key="NSSuperview" ref="560298147"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="960472997"/>
Expand All @@ -329,7 +353,7 @@
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
</object>
<string key="NSFrameSize">{320, 546}</string>
<string key="NSFrameSize">{320, 607}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="821963304"/>
Expand Down Expand Up @@ -448,6 +472,15 @@
</object>
<int key="connectionID">108</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">showTextOnly:</string>
<reference key="source" ref="686140023"/>
<reference key="destination" ref="372490531"/>
<int key="IBEventType">7</int>
</object>
<int key="connectionID">113</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
Expand Down Expand Up @@ -496,6 +529,7 @@
<reference ref="960472997"/>
<reference ref="8005370"/>
<reference ref="706142914"/>
<reference ref="686140023"/>
</object>
<reference key="parent" ref="560298147"/>
</object>
Expand Down Expand Up @@ -554,6 +588,11 @@
<reference key="object" ref="706142914"/>
<reference key="parent" ref="821963304"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">111</int>
<reference key="object" ref="686140023"/>
<reference key="parent" ref="821963304"/>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
Expand All @@ -566,6 +605,7 @@
<string>-2.IBPluginDependency</string>
<string>10.IBPluginDependency</string>
<string>106.IBPluginDependency</string>
<string>111.IBPluginDependency</string>
<string>16.IBPluginDependency</string>
<string>20.IBPluginDependency</string>
<string>43.IBPluginDependency</string>
Expand Down Expand Up @@ -597,6 +637,7 @@
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
Expand All @@ -611,7 +652,7 @@
<reference key="dict.values" ref="0"/>
</object>
<nil key="sourceID"/>
<int key="maxID">110</int>
<int key="maxID">113</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
Expand Down

0 comments on commit 4af1759

Please sign in to comment.