├── MFLTextFillLoading
├── starBg.png
├── Starjedi.ttf
├── SWCrawlBody.ttf
├── SWCrawlTitle.ttf
├── StarJediBig.ttf
├── Franklin_Gothic_Book.ttf
├── ViewController.h
├── MFLTextFillLoading.xcdatamodeld
│ ├── .xccurrentversion
│ └── MFLTextFillLoading.xcdatamodel
│ │ └── contents
├── MFLFillableText
│ ├── Text Paths
│ │ ├── MFLBorderLabel.h
│ │ └── MFLBorderLabel.m
│ ├── MFLFillableTextLoader.h
│ ├── MFLFillableTextLoader.m
│ └── MFLFillableTextLoader.xib
├── main.m
├── AppDelegate.h
├── Images.xcassets
│ └── AppIcon.appiconset
│ │ └── Contents.json
├── Info.plist
├── Base.lproj
│ ├── LaunchScreen.xib
│ └── Main.storyboard
├── AppDelegate.m
└── ViewController.m
├── MFLTextFillLoading.xcodeproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── MFLTextFillLoading.xcscmblueprint
└── project.pbxproj
├── .gitignore
├── MFLTextFillLoadingTests
├── Info.plist
└── MFLTextFillLoadingTests.m
├── LICENSE
└── README.md
/MFLTextFillLoading/starBg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MattFoley/MFLFillableTextLoader/HEAD/MFLTextFillLoading/starBg.png
--------------------------------------------------------------------------------
/MFLTextFillLoading/Starjedi.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MattFoley/MFLFillableTextLoader/HEAD/MFLTextFillLoading/Starjedi.ttf
--------------------------------------------------------------------------------
/MFLTextFillLoading/SWCrawlBody.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MattFoley/MFLFillableTextLoader/HEAD/MFLTextFillLoading/SWCrawlBody.ttf
--------------------------------------------------------------------------------
/MFLTextFillLoading/SWCrawlTitle.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MattFoley/MFLFillableTextLoader/HEAD/MFLTextFillLoading/SWCrawlTitle.ttf
--------------------------------------------------------------------------------
/MFLTextFillLoading/StarJediBig.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MattFoley/MFLFillableTextLoader/HEAD/MFLTextFillLoading/StarJediBig.ttf
--------------------------------------------------------------------------------
/MFLTextFillLoading/Franklin_Gothic_Book.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MattFoley/MFLFillableTextLoader/HEAD/MFLTextFillLoading/Franklin_Gothic_Book.ttf
--------------------------------------------------------------------------------
/MFLTextFillLoading.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/MFLTextFillLoading/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // MFLTextFillLoading
4 | //
5 | // Created by Tj on 6/13/15.
6 | // Copyright (c) 2015 Tj. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : UIViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/MFLTextFillLoading/MFLTextFillLoading.xcdatamodeld/.xccurrentversion:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | _XCCurrentVersionName
6 | MFLTextFillLoading.xcdatamodel
7 |
8 |
9 |
--------------------------------------------------------------------------------
/MFLTextFillLoading/MFLFillableText/Text Paths/MFLBorderLabel.h:
--------------------------------------------------------------------------------
1 | //
2 | // MFLBorderLabel.h
3 | // MFLTextFillLoading
4 | //
5 | // Created by Tj on 6/13/15.
6 | // Copyright (c) 2015 Tj. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface MFLBorderLabel : UILabel
12 |
13 | @property IBInspectable UIColor *strokeColor;
14 | @property IBInspectable NSInteger strokeWidth;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/MFLTextFillLoading/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // MFLTextFillLoading
4 | //
5 | // Created by Tj on 6/13/15.
6 | // Copyright (c) 2015 Tj. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "AppDelegate.h"
11 |
12 | int main(int argc, char * argv[]) {
13 | @autoreleasepool {
14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/MFLTextFillLoading/MFLTextFillLoading.xcdatamodeld/MFLTextFillLoading.xcdatamodel/contents:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | #
3 | build/
4 | *.pbxuser
5 | !default.pbxuser
6 | *.mode1v3
7 | !default.mode1v3
8 | *.mode2v3
9 | !default.mode2v3
10 | *.perspectivev3
11 | !default.perspectivev3
12 | xcuserdata
13 | *.xccheckout
14 | *.moved-aside
15 | DerivedData
16 | *.hmap
17 | *.ipa
18 | *.xcuserstate
19 |
20 | # CocoaPods
21 | #
22 | # We recommend against adding the Pods directory to your .gitignore. However
23 | # you should judge for yourself, the pros and cons are mentioned at:
24 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
25 | #
26 | #Pods/
27 |
--------------------------------------------------------------------------------
/MFLTextFillLoading/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // MFLTextFillLoading
4 | //
5 | // Created by Tj on 6/13/15.
6 | // Copyright (c) 2015 Tj. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | @interface AppDelegate : UIResponder
13 |
14 | @property (strong, nonatomic) UIWindow *window;
15 |
16 | @property (readonly, strong, nonatomic) NSManagedObjectContext *managedObjectContext;
17 | @property (readonly, strong, nonatomic) NSManagedObjectModel *managedObjectModel;
18 | @property (readonly, strong, nonatomic) NSPersistentStoreCoordinator *persistentStoreCoordinator;
19 |
20 | - (void)saveContext;
21 | - (NSURL *)applicationDocumentsDirectory;
22 |
23 |
24 | @end
25 |
26 |
--------------------------------------------------------------------------------
/MFLTextFillLoadingTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | MFL.$(PRODUCT_NAME:rfc1034identifier)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/MFLTextFillLoading/MFLFillableText/Text Paths/MFLBorderLabel.m:
--------------------------------------------------------------------------------
1 | //
2 | // MFLBorderLabel.m
3 | // MFLTextFillLoading
4 | //
5 | // Created by Tj on 6/13/15.
6 | // Copyright (c) 2015 Tj. All rights reserved.
7 | //
8 |
9 | #import "MFLBorderLabel.h"
10 |
11 | @implementation MFLBorderLabel
12 |
13 | - (void)drawTextInRect:(CGRect)rect {
14 |
15 | CGSize shadowOffset = self.shadowOffset;
16 | UIColor *textColor = self.textColor;
17 |
18 | CGContextRef c = UIGraphicsGetCurrentContext();
19 | CGContextSetLineWidth(c, self.strokeWidth);
20 | CGContextSetLineJoin(c, kCGLineJoinMiter);
21 |
22 | CGContextSetTextDrawingMode(c, kCGTextStroke);
23 | self.textColor = self.strokeColor;
24 | [super drawTextInRect:rect];
25 |
26 | CGContextSetTextDrawingMode(c, kCGTextFill);
27 | self.textColor = textColor;
28 | self.shadowOffset = CGSizeMake(0, 0);
29 | [super drawTextInRect:rect];
30 |
31 | self.shadowOffset = shadowOffset;
32 | }
33 |
34 |
35 | @end
36 |
--------------------------------------------------------------------------------
/MFLTextFillLoadingTests/MFLTextFillLoadingTests.m:
--------------------------------------------------------------------------------
1 | //
2 | // MFLTextFillLoadingTests.m
3 | // MFLTextFillLoadingTests
4 | //
5 | // Created by Tj on 6/13/15.
6 | // Copyright (c) 2015 Tj. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | @interface MFLTextFillLoadingTests : XCTestCase
13 |
14 | @end
15 |
16 | @implementation MFLTextFillLoadingTests
17 |
18 | - (void)setUp {
19 | [super setUp];
20 | // Put setup code here. This method is called before the invocation of each test method in the class.
21 | }
22 |
23 | - (void)tearDown {
24 | // Put teardown code here. This method is called after the invocation of each test method in the class.
25 | [super tearDown];
26 | }
27 |
28 | - (void)testExample {
29 | // This is an example of a functional test case.
30 | XCTAssert(YES, @"Pass");
31 | }
32 |
33 | - (void)testPerformanceExample {
34 | // This is an example of a performance test case.
35 | [self measureBlock:^{
36 | // Put the code you want to measure the time of here.
37 | }];
38 | }
39 |
40 | @end
41 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 Tj
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/MFLTextFillLoading/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "ipad",
35 | "size" : "29x29",
36 | "scale" : "1x"
37 | },
38 | {
39 | "idiom" : "ipad",
40 | "size" : "29x29",
41 | "scale" : "2x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "40x40",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "40x40",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "76x76",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "76x76",
61 | "scale" : "2x"
62 | }
63 | ],
64 | "info" : {
65 | "version" : 1,
66 | "author" : "xcode"
67 | }
68 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # MFLFillableTextLoader
2 | Loading/progress indicator based on filling stroked text.
3 |
4 | 
5 |
6 | ### Code Example
7 | You can create an MFLFillableTextLoader either in a xib or in code. Here is a short code example:
8 |
9 | ```objc
10 |
11 | //Main text that will be stroked and filled.
12 | self.loader = [[MFLFillableTextLoader alloc] initWithString:@"Loading..."
13 | font:[UIFont boldSystemFontOfSize:28]
14 | alignment:NSTextAlignmentCenter
15 | withFrame:CGRectMake(0, 0, 320, 400)];
16 |
17 | //Subheading displayed describing load
18 | NSAttributedString *details = [[NSAttributedString alloc] initWithString:@"Never tell me the odds."];
19 | [self.loader setDetailText:details];
20 |
21 | //Set the font used for the percentage of the load displayed.
22 | [self.loader setProgressFont:[UIFont systemFontOfSize:18]];
23 |
24 | //Properties used for stroking/filling the text.
25 | [self.loader setStrokeColor:UIColorFromRGB(0xe5b13a)];
26 | [self.loader setStrokeWidth:4];
27 | ```
28 |
29 | ### Usage
30 |
31 | After creation, you can then add it to a UIView as a subview, and update the progress as you need to. It will automatically update it's fill.
32 |
33 | ```objc
34 | [self.view addSubview:self.loader];
35 | [self.loader setProgress: