Skip to content

Commit

Permalink
0.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
s2mh committed Sep 12, 2016
1 parent 48085f4 commit 1f6a881
Show file tree
Hide file tree
Showing 38 changed files with 315 additions and 684 deletions.
Binary file modified .DS_Store
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@
6A73D6BA1D86BB2600D38630 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6A73D6B81D86BB2600D38630 /* Main.storyboard */; };
6A73D6BC1D86BB2600D38630 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6A73D6BB1D86BB2600D38630 /* Assets.xcassets */; };
6A73D6BF1D86BB2600D38630 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6A73D6BD1D86BB2600D38630 /* LaunchScreen.storyboard */; };
6A73D6D41D86BB6500D38630 /* FYFontCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A73D6C81D86BB6500D38630 /* FYFontCache.m */; };
6A73D6D51D86BB6500D38630 /* FYFontDownloader.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A73D6CA1D86BB6500D38630 /* FYFontDownloader.m */; };
6A73D6D61D86BB6500D38630 /* FYFontManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A73D6CC1D86BB6500D38630 /* FYFontManager.m */; };
6A73D6D71D86BB6500D38630 /* FYFontModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A73D6CE1D86BB6500D38630 /* FYFontModel.m */; };
6A73D6D81D86BB6500D38630 /* FYFontRegister.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A73D6D01D86BB6500D38630 /* FYFontRegister.m */; };
6A73D6D91D86BB6500D38630 /* UIFont+FY_Fonty.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A73D6D31D86BB6500D38630 /* UIFont+FY_Fonty.m */; };
6A73D6E81D86C05000D38630 /* FYFontCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A73D6DC1D86C05000D38630 /* FYFontCache.m */; };
6A73D6E91D86C05000D38630 /* FYFontDownloader.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A73D6DE1D86C05000D38630 /* FYFontDownloader.m */; };
6A73D6EA1D86C05000D38630 /* FYFontManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A73D6E01D86C05000D38630 /* FYFontManager.m */; };
6A73D6EB1D86C05000D38630 /* FYFontModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A73D6E21D86C05000D38630 /* FYFontModel.m */; };
6A73D6EC1D86C05000D38630 /* FYFontRegister.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A73D6E41D86C05000D38630 /* FYFontRegister.m */; };
6A73D6ED1D86C05000D38630 /* UIFont+FY_Fonty.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A73D6E71D86C05000D38630 /* UIFont+FY_Fonty.m */; };
6A73D6F21D86C09500D38630 /* FYSelectFontViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A73D6EF1D86C09500D38630 /* FYSelectFontViewController.m */; };
6A73D6F31D86C09500D38630 /* FYSelectFontTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A73D6F11D86C09500D38630 /* FYSelectFontTableViewCell.m */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -32,19 +34,23 @@
6A73D6BB1D86BB2600D38630 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
6A73D6BE1D86BB2600D38630 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
6A73D6C01D86BB2600D38630 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
6A73D6C71D86BB6500D38630 /* FYFontCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FYFontCache.h; sourceTree = "<group>"; };
6A73D6C81D86BB6500D38630 /* FYFontCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FYFontCache.m; sourceTree = "<group>"; };
6A73D6C91D86BB6500D38630 /* FYFontDownloader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FYFontDownloader.h; sourceTree = "<group>"; };
6A73D6CA1D86BB6500D38630 /* FYFontDownloader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FYFontDownloader.m; sourceTree = "<group>"; };
6A73D6CB1D86BB6500D38630 /* FYFontManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FYFontManager.h; sourceTree = "<group>"; };
6A73D6CC1D86BB6500D38630 /* FYFontManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FYFontManager.m; sourceTree = "<group>"; };
6A73D6CD1D86BB6500D38630 /* FYFontModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FYFontModel.h; sourceTree = "<group>"; };
6A73D6CE1D86BB6500D38630 /* FYFontModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FYFontModel.m; sourceTree = "<group>"; };
6A73D6CF1D86BB6500D38630 /* FYFontRegister.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FYFontRegister.h; sourceTree = "<group>"; };
6A73D6D01D86BB6500D38630 /* FYFontRegister.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FYFontRegister.m; sourceTree = "<group>"; };
6A73D6D11D86BB6500D38630 /* FYHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FYHeader.h; sourceTree = "<group>"; };
6A73D6D21D86BB6500D38630 /* UIFont+FY_Fonty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIFont+FY_Fonty.h"; sourceTree = "<group>"; };
6A73D6D31D86BB6500D38630 /* UIFont+FY_Fonty.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIFont+FY_Fonty.m"; sourceTree = "<group>"; };
6A73D6DB1D86C05000D38630 /* FYFontCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FYFontCache.h; sourceTree = "<group>"; };
6A73D6DC1D86C05000D38630 /* FYFontCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FYFontCache.m; sourceTree = "<group>"; };
6A73D6DD1D86C05000D38630 /* FYFontDownloader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FYFontDownloader.h; sourceTree = "<group>"; };
6A73D6DE1D86C05000D38630 /* FYFontDownloader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FYFontDownloader.m; sourceTree = "<group>"; };
6A73D6DF1D86C05000D38630 /* FYFontManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FYFontManager.h; sourceTree = "<group>"; };
6A73D6E01D86C05000D38630 /* FYFontManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FYFontManager.m; sourceTree = "<group>"; };
6A73D6E11D86C05000D38630 /* FYFontModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FYFontModel.h; sourceTree = "<group>"; };
6A73D6E21D86C05000D38630 /* FYFontModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FYFontModel.m; sourceTree = "<group>"; };
6A73D6E31D86C05000D38630 /* FYFontRegister.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FYFontRegister.h; sourceTree = "<group>"; };
6A73D6E41D86C05000D38630 /* FYFontRegister.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FYFontRegister.m; sourceTree = "<group>"; };
6A73D6E51D86C05000D38630 /* FYHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FYHeader.h; sourceTree = "<group>"; };
6A73D6E61D86C05000D38630 /* UIFont+FY_Fonty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIFont+FY_Fonty.h"; sourceTree = "<group>"; };
6A73D6E71D86C05000D38630 /* UIFont+FY_Fonty.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIFont+FY_Fonty.m"; sourceTree = "<group>"; };
6A73D6EE1D86C09500D38630 /* FYSelectFontViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FYSelectFontViewController.h; sourceTree = "<group>"; };
6A73D6EF1D86C09500D38630 /* FYSelectFontViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FYSelectFontViewController.m; sourceTree = "<group>"; };
6A73D6F01D86C09500D38630 /* FYSelectFontTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FYSelectFontTableViewCell.h; sourceTree = "<group>"; };
6A73D6F11D86C09500D38630 /* FYSelectFontTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FYSelectFontTableViewCell.m; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -62,7 +68,7 @@
isa = PBXGroup;
children = (
6A73D6AE1D86BB2600D38630 /* Fonty-Demo */,
6A73D6C61D86BB6500D38630 /* Fonty */,
6A73D6DA1D86C05000D38630 /* Fonty */,
6A73D6AD1D86BB2600D38630 /* Products */,
);
sourceTree = "<group>";
Expand All @@ -82,6 +88,10 @@
6A73D6B31D86BB2600D38630 /* AppDelegate.m */,
6A73D6B51D86BB2600D38630 /* ViewController.h */,
6A73D6B61D86BB2600D38630 /* ViewController.m */,
6A73D6EE1D86C09500D38630 /* FYSelectFontViewController.h */,
6A73D6EF1D86C09500D38630 /* FYSelectFontViewController.m */,
6A73D6F01D86C09500D38630 /* FYSelectFontTableViewCell.h */,
6A73D6F11D86C09500D38630 /* FYSelectFontTableViewCell.m */,
6A73D6B81D86BB2600D38630 /* Main.storyboard */,
6A73D6BB1D86BB2600D38630 /* Assets.xcassets */,
6A73D6BD1D86BB2600D38630 /* LaunchScreen.storyboard */,
Expand All @@ -99,22 +109,22 @@
name = "Supporting Files";
sourceTree = "<group>";
};
6A73D6C61D86BB6500D38630 /* Fonty */ = {
6A73D6DA1D86C05000D38630 /* Fonty */ = {
isa = PBXGroup;
children = (
6A73D6C71D86BB6500D38630 /* FYFontCache.h */,
6A73D6C81D86BB6500D38630 /* FYFontCache.m */,
6A73D6C91D86BB6500D38630 /* FYFontDownloader.h */,
6A73D6CA1D86BB6500D38630 /* FYFontDownloader.m */,
6A73D6CB1D86BB6500D38630 /* FYFontManager.h */,
6A73D6CC1D86BB6500D38630 /* FYFontManager.m */,
6A73D6CD1D86BB6500D38630 /* FYFontModel.h */,
6A73D6CE1D86BB6500D38630 /* FYFontModel.m */,
6A73D6CF1D86BB6500D38630 /* FYFontRegister.h */,
6A73D6D01D86BB6500D38630 /* FYFontRegister.m */,
6A73D6D11D86BB6500D38630 /* FYHeader.h */,
6A73D6D21D86BB6500D38630 /* UIFont+FY_Fonty.h */,
6A73D6D31D86BB6500D38630 /* UIFont+FY_Fonty.m */,
6A73D6DB1D86C05000D38630 /* FYFontCache.h */,
6A73D6DC1D86C05000D38630 /* FYFontCache.m */,
6A73D6DD1D86C05000D38630 /* FYFontDownloader.h */,
6A73D6DE1D86C05000D38630 /* FYFontDownloader.m */,
6A73D6DF1D86C05000D38630 /* FYFontManager.h */,
6A73D6E01D86C05000D38630 /* FYFontManager.m */,
6A73D6E11D86C05000D38630 /* FYFontModel.h */,
6A73D6E21D86C05000D38630 /* FYFontModel.m */,
6A73D6E31D86C05000D38630 /* FYFontRegister.h */,
6A73D6E41D86C05000D38630 /* FYFontRegister.m */,
6A73D6E51D86C05000D38630 /* FYHeader.h */,
6A73D6E61D86C05000D38630 /* UIFont+FY_Fonty.h */,
6A73D6E71D86C05000D38630 /* UIFont+FY_Fonty.m */,
);
path = Fonty;
sourceTree = "<group>";
Expand Down Expand Up @@ -189,15 +199,17 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
6A73D6F21D86C09500D38630 /* FYSelectFontViewController.m in Sources */,
6A73D6B71D86BB2600D38630 /* ViewController.m in Sources */,
6A73D6B41D86BB2600D38630 /* AppDelegate.m in Sources */,
6A73D6D41D86BB6500D38630 /* FYFontCache.m in Sources */,
6A73D6D61D86BB6500D38630 /* FYFontManager.m in Sources */,
6A73D6D51D86BB6500D38630 /* FYFontDownloader.m in Sources */,
6A73D6E81D86C05000D38630 /* FYFontCache.m in Sources */,
6A73D6EA1D86C05000D38630 /* FYFontManager.m in Sources */,
6A73D6F31D86C09500D38630 /* FYSelectFontTableViewCell.m in Sources */,
6A73D6E91D86C05000D38630 /* FYFontDownloader.m in Sources */,
6A73D6B11D86BB2600D38630 /* main.m in Sources */,
6A73D6D81D86BB6500D38630 /* FYFontRegister.m in Sources */,
6A73D6D91D86BB6500D38630 /* UIFont+FY_Fonty.m in Sources */,
6A73D6D71D86BB6500D38630 /* FYFontModel.m in Sources */,
6A73D6EC1D86C05000D38630 /* FYFontRegister.m in Sources */,
6A73D6ED1D86C05000D38630 /* UIFont+FY_Fonty.m in Sources */,
6A73D6EB1D86C05000D38630 /* FYFontModel.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -312,6 +324,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = "Fonty-Demo/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "s2mh.Fonty-Demo";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -323,6 +336,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = "Fonty-Demo/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "s2mh.Fonty-Demo";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -348,6 +362,7 @@
6A73D6C51D86BB2600D38630 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "1"
version = "2.0">
</Bucket>
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions Fonty-Demo/FYSelectFontTableViewCell.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// FYSelectFontTableViewCell.h
// Fonty
//
// Created by 颜为晨 on 9/9/16.
// Copyright © 2016 颜为晨. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface FYSelectFontTableViewCell : UITableViewCell

@end
16 changes: 16 additions & 0 deletions Fonty-Demo/FYSelectFontTableViewCell.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

//
// FYSelectFontTableViewCell.m
// Fonty
//
// Created by 颜为晨 on 9/9/16.
// Copyright © 2016 颜为晨. All rights reserved.
//

#import "FYSelectFontTableViewCell.h"

@implementation FYSelectFontTableViewCell

//- ()

@end
13 changes: 13 additions & 0 deletions Fonty-Demo/FYSelectFontViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// FYSelectFontViewController.h
// Fonty
//
// Created by 颜为晨 on 9/9/16.
// Copyright © 2016 颜为晨. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface FYSelectFontViewController : UITableViewController

@end
133 changes: 133 additions & 0 deletions Fonty-Demo/FYSelectFontViewController.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
//
// FYSelectFontViewController.m
// Fonty
//
// Created by 颜为晨 on 9/9/16.
// Copyright © 2016 颜为晨. All rights reserved.
//

#import "FYSelectFontViewController.h"
#import "FYHeader.h"

static NSString *const UITableViewCellIdentifier = @"UITableViewCellIdentifier";

@interface FYSelectFontViewController () <UIAlertViewDelegate>

@property (nonatomic, weak) FYFontManager *fontManager;
@property (nonatomic, weak) NSArray *fontModelArray;

@end

@implementation FYSelectFontViewController

- (void)viewDidLoad {
[super viewDidLoad];
self.navigationItem.title = @"Fonty";

self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Done"
style:UIBarButtonItemStyleDone
target:self
action:@selector(backAction)];

self.fontManager = [FYFontManager sharedManager];
self.fontModelArray = self.fontManager.fontModelArray;

[self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:UITableViewCellIdentifier];
}

#pragma mark - UITableViewDataSource

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.fontModelArray.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
FYFontModel *model = [self.fontModelArray objectAtIndex:indexPath.row];
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:UITableViewCellIdentifier forIndexPath:indexPath];

cell.selectionStyle = UITableViewCellSelectionStyleBlue;
cell.textLabel.text = model.description;
cell.accessoryView = nil;

if (model.status == FYFontModelDownloadStatusDownloaded) {
if (indexPath.row == self.fontManager.mainFontIndex) {
cell.selected = YES;
}
} else if (model.status == FYFontModelDownloadStatusDeleting || model.status == FYFontModelDownloadStatusDownloading) {
UIActivityIndicatorView *AIV = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
[AIV startAnimating];
cell.accessoryView = AIV;
}

return cell;
}

- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
FYFontModel *model = [self.fontModelArray objectAtIndex:indexPath.row];
return model.status == FYFontModelDownloadStatusDownloaded;
}

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete) {

FYFontModel *model = [self.fontModelArray objectAtIndex:indexPath.row];
model.status = FYFontModelDownloadStatusDeleting;
[tableView reloadData];

[self.fontManager deleteFontWithURL:model.URL completeBlock:^{
model.status = FYFontModelDownloadStatusToBeDownloaded;
self.fontManager.mainFontIndex = 0;
[tableView reloadData];
}];
}
}

#pragma mark UITableViewDelegate

- (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath {
FYFontModel *model = [self.fontModelArray objectAtIndex:indexPath.row];
if (model.status == FYFontModelDownloadStatusDownloaded) {
self.fontManager.mainFontIndex = indexPath.row;
[tableView reloadData];
return indexPath;
} else {
UIAlertView *AV = [[UIAlertView alloc] initWithTitle:@"Download Font File from"
message:model.URL.absoluteString
delegate:self
cancelButtonTitle:@"cancel"
otherButtonTitles:@"start", nil];
AV.tag = indexPath.row;
[AV show];
return nil;
}
}

- (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath {
return @"clear";
}

- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath {
FYFontModel *model = [self.fontModelArray objectAtIndex:indexPath.row];
if (model.status == FYFontModelDownloadStatusDownloaded || model.URL) {
return UITableViewCellEditingStyleDelete;
} else {
return UITableViewCellEditingStyleNone;
}
}

#pragma mark UIAlertViewDelegate

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex == 1) {
FYFontModel *model = [self.fontModelArray objectAtIndex:alertView.tag];
[self.fontManager downloadFontWithURL:model.URL];
}
}

#pragma mark - Action

- (void)backAction {
[self dismissViewControllerAnimated:YES completion:nil];
}

@end
Binary file not shown.
27 changes: 0 additions & 27 deletions Fonty-Demo/Fonty-Demo/ViewController.m

This file was deleted.

Loading

0 comments on commit 1f6a881

Please sign in to comment.