-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
2,211 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Pod::Spec.new do |s| | ||
s.name = 'THUI' | ||
s.version = '1.0.0' | ||
s.authors = { 'ZhuZhen' => '[email protected]' } | ||
s.homepage = 'https://github.com/Zhuzhen6/THUI' | ||
s.summary = 'a tool menu for ios like wechat homepage.' | ||
s.source = { :git => 'https://github.com/Zhuzhen6/THUI.git', | ||
:tag => s.version.to_s } | ||
s.license = { :type => "MIT", :file => "LICENSE" } | ||
|
||
s.platform = :ios, '10.0' | ||
s.requires_arc = true | ||
s.source_files = 'THUIDemo/THUI' | ||
s.ios.deployment_target = '10.0' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+14.6 KB
(220%)
...proj/project.xcworkspace/xcuserdata/tonghuimac.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// | ||
// MenuBtnView.h | ||
// TH | ||
// | ||
// Created by TonghuiMac on 2018/11/6. | ||
// Copyright © 2018 TonghuiMac. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
#import "THUIHeader.h" | ||
#import "ToolButton.h" | ||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface MenuBtnView : UIView | ||
- (void)addBtn:(ToolButton *)btn; | ||
@property (nonatomic, assign) CGFloat menuBtnViewWidth; | ||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// | ||
// MenuBtnView.m | ||
// TH | ||
// | ||
// Created by TonghuiMac on 2018/11/6. | ||
// Copyright © 2018 TonghuiMac. All rights reserved. | ||
// | ||
|
||
#import "MenuBtnView.h" | ||
|
||
|
||
@interface MenuBtnView () | ||
@property (nonatomic, strong) NSMutableArray <ToolButton *> *btnArray; | ||
@property (nonatomic, strong) UIView *menuView; | ||
@end | ||
|
||
|
||
@implementation MenuBtnView | ||
|
||
-(instancetype)initWithFrame:(CGRect)frame{ | ||
if (self = [super initWithFrame:frame]) { | ||
[self addUI]; | ||
// self.menuBtnViewWidth = 0.0; | ||
} | ||
return self; | ||
} | ||
|
||
-(void)layoutSubviews{ | ||
[super layoutSubviews]; | ||
[self setBtnFrame]; | ||
} | ||
- (void)addUI{ | ||
|
||
self.btnArray = [[NSMutableArray alloc]init]; | ||
|
||
self.menuView = [[UIView alloc] init]; | ||
self.menuView.backgroundColor = LEFT_SLIDE_HIGHTLIGHT_COLOR; | ||
self.menuView.layer.cornerRadius = 6; | ||
[self addSubview:self.menuView]; | ||
} | ||
|
||
- (void)setBtnFrame{ | ||
|
||
CGFloat Size = 56; | ||
CGFloat Width = 50; | ||
CGFloat y0 = 1; | ||
NSUInteger iConut = self.btnArray.count; | ||
for (int i = 0; i<iConut; i++) { | ||
self.btnArray[i].frame = CGRectMake(y0, 0, Width, Size); | ||
y0 += Width; | ||
} | ||
|
||
self.menuBtnViewWidth = y0+5; | ||
self.menuView.frame = CGRectMake(0, 0,self.menuBtnViewWidth, Size); | ||
|
||
} | ||
|
||
|
||
/** | ||
添加btn到数组 视图 | ||
@param btn MenuButton | ||
*/ | ||
- (void)addBtn:(ToolButton *)btn{ | ||
|
||
[self.btnArray addObject:btn]; | ||
[self.menuView addSubview:btn]; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// | ||
// MenuView.h | ||
// TH | ||
// | ||
// Created by TonghuiMac on 2018/11/6. | ||
// Copyright © 2018 TonghuiMac. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface MenuView : UIView | ||
- (void)addView:(UIView *)view; | ||
/** | ||
退出按钮事件 | ||
*/ | ||
@property (nonatomic,copy) void (^ExitAction)(void); | ||
|
||
- (void)closeMenuView; | ||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
// | ||
// MenuView.m | ||
// TH | ||
// | ||
// Created by TonghuiMac on 2018/11/6. | ||
// Copyright © 2018 TonghuiMac. All rights reserved. | ||
// | ||
|
||
#import "MenuView.h" | ||
#import "THUIHeader.h" | ||
#import "ToolButton.h" | ||
|
||
@interface MenuView () | ||
@property (nonatomic, strong) NSMutableArray <UIView *> *viewArray; | ||
@property (nonatomic, strong) UIView *menuView; | ||
@end | ||
|
||
@implementation MenuView | ||
|
||
-(instancetype)initWithFrame:(CGRect)frame{ | ||
if (self = [super initWithFrame:frame]) { | ||
[self addUI]; | ||
} | ||
return self; | ||
} | ||
|
||
-(void)layoutSubviews{ | ||
[super layoutSubviews]; | ||
[self setBtnFrame]; | ||
} | ||
- (void)addUI{ | ||
|
||
self.viewArray = [[NSMutableArray alloc]init]; | ||
|
||
self.menuView = [[UIView alloc] init]; | ||
self.menuView.backgroundColor = LEFT_SLIDE_HIGHTLIGHT_COLOR; | ||
self.menuView.layer.cornerRadius = 4; | ||
[self addSubview:self.menuView]; | ||
} | ||
|
||
- (void)setBtnFrame{ | ||
|
||
CGFloat Size = 56; | ||
CGFloat Width = 0; | ||
CGFloat y0 = 1; | ||
NSUInteger iConut = self.viewArray.count; | ||
for (int i = 0; i<iConut; i++) { | ||
Width = self.viewArray[i].frame.size.width; | ||
self.viewArray[i].frame = CGRectMake(y0, 0, Width, Size); | ||
y0 += Width; | ||
} | ||
|
||
ToolButton *exitBtn = [[ToolButton alloc]init]; | ||
[exitBtn btnWithName:@"退出" imgName:@"\U0000e916"]; | ||
exitBtn.frame = CGRectMake(y0+3, 0, 50, Size); | ||
[exitBtn addTarget:self action:@selector(exitAction:) forControlEvents:(UIControlEventTouchUpInside)]; | ||
[self.menuView addSubview:exitBtn]; | ||
|
||
CGFloat menuViewWidth = y0 + 50 + 3; | ||
self.menuView.frame = CGRectMake(0, 0, menuViewWidth, Size); | ||
} | ||
|
||
- (void)addView:(UIView *)view{ | ||
|
||
[self.menuView addSubview:view]; | ||
[self.viewArray addObject:view]; | ||
} | ||
|
||
|
||
|
||
-(void)exitAction:(UIButton*)btn{ | ||
[self closeMenuView]; | ||
if (self.ExitAction) { | ||
[self ExitAction]; | ||
} | ||
} | ||
|
||
- (void)closeMenuView{ | ||
[self removeFromSuperview]; | ||
} | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// | ||
// MoreToolCell.h | ||
// THZT | ||
// | ||
// Created by TonghuiMac on 2018/10/24. | ||
// Copyright © 2018 TonghuiMac. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
#import "ToolButton.h" | ||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface MoreToolCell : UICollectionViewCell | ||
@property (nonatomic, strong) ToolButton *btn; | ||
|
||
@end | ||
NS_ASSUME_NONNULL_END |
Oops, something went wrong.