diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..1f67c23 Binary files /dev/null and b/.DS_Store differ diff --git a/Setting/.DS_Store b/Setting/.DS_Store new file mode 100644 index 0000000..a7f0e71 Binary files /dev/null and b/Setting/.DS_Store differ diff --git a/Setting/Setting.xcodeproj/project.pbxproj b/Setting/Setting.xcodeproj/project.pbxproj index 80cc775..21364d2 100644 --- a/Setting/Setting.xcodeproj/project.pbxproj +++ b/Setting/Setting.xcodeproj/project.pbxproj @@ -265,6 +265,7 @@ TargetAttributes = { CC9523ED1BADA07D0040FF08 = { CreatedOnToolsVersion = 7.0; + ProvisioningStyle = Manual; }; CC9524091BADA07D0040FF08 = { CreatedOnToolsVersion = 7.0; @@ -281,6 +282,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, Base, ); @@ -474,11 +476,14 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Manual; + DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = Setting/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 7.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = zifeng.Setting; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; }; name = Debug; }; @@ -486,11 +491,14 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Manual; + DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = Setting/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 7.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = zifeng.Setting; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; }; name = Release; }; diff --git a/Setting/Setting.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Setting/Setting.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Setting/Setting.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Setting/Setting/Assets.xcassets/AppIcon.appiconset/Contents.json b/Setting/Setting/Assets.xcassets/AppIcon.appiconset/Contents.json index 118c98f..8121323 100644 --- a/Setting/Setting/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/Setting/Setting/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -2,37 +2,52 @@ "images" : [ { "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" + "scale" : "2x", + "size" : "20x20" }, { "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" + "scale" : "3x", + "size" : "20x20" }, { "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" + "scale" : "2x", + "size" : "29x29" }, { "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" + "scale" : "3x", + "size" : "29x29" }, { "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" + "scale" : "2x", + "size" : "40x40" }, { "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" + "scale" : "3x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/Setting/Setting/ZFettingViewController.m b/Setting/Setting/ZFettingViewController.m index f15f9b3..c2ebd94 100755 --- a/Setting/Setting/ZFettingViewController.m +++ b/Setting/Setting/ZFettingViewController.m @@ -80,10 +80,23 @@ - (void)add1SectionItems { [weakSelf.navigationController pushViewController:helpVC animated:YES]; }; + NSString *weixinStr =@"xxxxxx"; + // 开发者微信 + ZFSettingItem *weixin = [ZFSettingItem itemWithIcon:@"MoreShare" title:@"开发者微信" type:ZFSettingItemTypeText text:weixinStr]; + weixin.operation = ^{ + //复制到剪切板 + [UIPasteboard generalPasteboard].string = weixinStr; + // 初始化对话框 + UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"提示" message:@"已复制" preferredStyle:UIAlertControllerStyleAlert]; + [alert addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:nil]]; + // 弹出对话框 + [self presentViewController:alert animated:true completion:nil]; + }; + ZFSettingGroup *group = [[ZFSettingGroup alloc] init]; group.header = @"高级设置"; group.footer = @"这是footer"; - group.items = @[ help, share , about]; + group.items = @[ help, share , about,weixin]; [_allGroups addObject:group]; } diff --git a/ZFSetting/.DS_Store b/ZFSetting/.DS_Store new file mode 100644 index 0000000..95b9d65 Binary files /dev/null and b/ZFSetting/.DS_Store differ diff --git a/ZFSetting/Model/.DS_Store b/ZFSetting/Model/.DS_Store new file mode 100644 index 0000000..4bbaeb6 Binary files /dev/null and b/ZFSetting/Model/.DS_Store differ diff --git a/ZFSetting/Model/ZFSettingItem.h b/ZFSetting/Model/ZFSettingItem.h index 3ede342..8b60794 100755 --- a/ZFSetting/Model/ZFSettingItem.h +++ b/ZFSetting/Model/ZFSettingItem.h @@ -12,7 +12,8 @@ typedef NS_ENUM(NSInteger, ZFSettingItemType) { ZFSettingItemTypeNone, // 什么也没有 ZFSettingItemTypeArrow, // 箭头 - ZFSettingItemTypeSwitch // 开关 + ZFSettingItemTypeSwitch, // 开关 + ZFSettingItemTypeText //文本 }; @interface ZFSettingItem : NSObject @@ -20,6 +21,7 @@ typedef NS_ENUM(NSInteger, ZFSettingItemType) { @property (nonatomic, copy) NSString *icon; /// 标题 @property (nonatomic, copy) NSString *title; +@property (nonatomic, copy) NSString *text; /// 设置开关 @property (nonatomic, assign, getter=isSwitchOn) BOOL switchOn; /// cell的样式 @@ -31,4 +33,6 @@ typedef NS_ENUM(NSInteger, ZFSettingItemType) { + (instancetype)itemWithIcon:(NSString *)icon title:(NSString *)title type:(ZFSettingItemType)type; ++ (instancetype)itemWithIcon:(NSString *)icon title:(NSString *)title type:(ZFSettingItemType)type text:(NSString *)text; + @end diff --git a/ZFSetting/Model/ZFSettingItem.m b/ZFSetting/Model/ZFSettingItem.m index b5c01ee..81eb2bb 100755 --- a/ZFSetting/Model/ZFSettingItem.m +++ b/ZFSetting/Model/ZFSettingItem.m @@ -10,7 +10,7 @@ @implementation ZFSettingItem -+ (instancetype)itemWithIcon:(NSString *)icon title:(NSString *)title type:(ZFSettingItemType)type { ++ (instancetype)itemWithIcon:(NSString *)icon title:(NSString *)title type:(ZFSettingItemType)type{ ZFSettingItem *item = [[self alloc] init]; item.icon = icon; item.title = title; @@ -18,4 +18,13 @@ + (instancetype)itemWithIcon:(NSString *)icon title:(NSString *)title type:(ZFSe return item; } ++ (instancetype)itemWithIcon:(NSString *)icon title:(NSString *)title type:(ZFSettingItemType)type text:(NSString *)text{ + ZFSettingItem *item = [[self alloc] init]; + item.icon = icon; + item.title = title; + item.type = type; + item.text=text; + return item; +} + @end diff --git a/ZFSetting/View/.DS_Store b/ZFSetting/View/.DS_Store new file mode 100644 index 0000000..6e4d70c Binary files /dev/null and b/ZFSetting/View/.DS_Store differ diff --git a/ZFSetting/View/ZFSettingCell.m b/ZFSetting/View/ZFSettingCell.m index c09e068..6a454d8 100755 --- a/ZFSetting/View/ZFSettingCell.m +++ b/ZFSetting/View/ZFSettingCell.m @@ -11,6 +11,7 @@ @interface ZFSettingCell() { UISwitch *_switch; + UILabel *_text; } @end @@ -42,7 +43,7 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus - (void)setItem:(ZFSettingItem *)item { _item = item; // 设置数据 - self.imageView.image = item.icon.length ? [UIImage imageNamed:item.icon] : nil; + self.imageView.image = item.icon.length ? [UIImage imageNamed:item.icon] : nil; self.textLabel.text = item.title; if (item.type == ZFSettingItemTypeArrow) { self.accessoryType = UITableViewCellAccessoryDisclosureIndicator; @@ -53,13 +54,22 @@ - (void)setItem:(ZFSettingItem *)item { _switch = [[UISwitch alloc] init]; _switch.on = item.switchOn; [_switch addTarget:self action:@selector(switchStatusChanged:) forControlEvents:UIControlEventValueChanged]; - } else { - [_switch setOn:item.switchOn animated:YES]; - } + } else { + [_switch setOn:item.switchOn animated:YES]; + } // 右边显示开关 self.accessoryView = _switch; // 禁止选中 self.selectionStyle = UITableViewCellSelectionStyleNone; + }else if(item.type == ZFSettingItemTypeText){ + UILabel *rightLabel = [[UILabel alloc]initWithFrame:CGRectMake(0,0,item.text.length*10,self.frame.size.height)]; + rightLabel.text=item.text; + //rightLabel.textAlignment = NSTextAlignment; + self.accessoryView= rightLabel; + self.accessoryType = UITableViewCellAccessoryDisclosureIndicator; + // 用默认的选中样式 + self.selectionStyle = UITableViewCellSelectionStyleBlue; + //self.accessoryView.backgroundColor= [UIColor lightGrayColor];   //加上红色容易看清楚 } else { // 什么也没有,清空右边显示的view self.accessoryView = nil;