IOS-Settings and help interface

Source: Internet
Author: User

Settings and help
Change avatar, change password, mobile customer service, help, statement, about us.

Code

////  IndexSetting600ViewController.h//  SymptomChecker////  Created by wang on 2015-7-21.////#import "CYTableViewController.h"@interface IndexSetting600ViewController : CYTableViewController@end
////INDEXSETTING600VIEWCONTROLLER.M//Symptomchecker////Created by Wang on 2015-7-21.////#import "IndexSetting600ViewController.h" #import "UserCenter600Item.h" #import "UserInfoEditingItem.h" //change Avatar#import "PortraitPickerViewController.h" //Photo view#import "ModifyPasswordViewController.h" //Change Password#import "LocalPasswordViewController.h" #import "CYWebFromLocalViewController.h" //help/Disclaimer#import "CYAboutUsViewController.h" //About US#define Kviewradio viewwidth ()/320 @interface indexsetting600viewcontroller () <portraitpickerviewcontrollerdelegate >@end @implementation indexsetting600viewcontroller {Userfigureeditingitem *_figureitem;//Change AvatarPortraitpickerviewcontroller *_portraitpickerviewcontroller;//Change avatar ViewSetting600item *_changesecret;//Change login passwordSetting600item *_chunyutel;//Mobile customer serviceSetting600item *_helpitem;//HelpSetting600item *_shengming;//StatementSetting600item *_aboutus;//About USSetting600separateitem *_separateitem;//Blank cut cellFilledcolorbutton *_logoutbutton;//Logout button    UIView*_logoutfooterview;} - (ID) Initwithquery: (nsdictionary*) Query { Self= [SuperInitwithquery:query];if( Self) { Self. Title= @"Settings and help"; [[NsnotificationcenterDefaultcenter] Addobserver: SelfSelector@selector(Createmodel) Name:kregisterlocalpassword ObjectNil]; }return  Self;} - (void) Dealloc {[[NsnotificationcenterDefaultcenter] Removeobserver: Self];} - (void) Viewdidload {[SuperViewdidload]; [ Self. TableViewSetseparatorstyle:uitableviewcellseparatorstylenone]; [ SelfCreatetableitems];//Make sure item is created}- (void) Viewwillappear: (BOOL) Animated {[SuperViewwillappear:animated];}////Create only one//- (void) Createtableitems {Cy_define_self_bar ( Self); user* user = [user CurrentUser];//Change Avatar_figureitem = [[Userfigureeditingitem alloc] initwithtitle:@"Avatar"Value:[user. MatphotoGetmediaurl]]; [ Self. TableviewactionsAttachtoobject:_figureitem tapblock:^BOOL(IDObjectIDTargetNsindexpath*indexpath) {[_ SelfEdituserfigure];return YES; }];//Change login password_changesecret = [[Setting600item alloc] Initwithtitle: @"Change login password"]; _changesecret. Type= Ksetting600top; [ Self. TableviewactionsAttachtoobject: _changesecret tapblock:^BOOL(IDObjectIDTargetNsindexpath*indexpath) {Modifypasswordviewcontroller *controller = [Modifypasswordviewcontroller                                     NEW]; [_ SelfCypresentviewcontroller:controller Animated:YES];return NO; }];//Mobile customer service_chunyutel = [[Setting600item alloc] Initwithtitle: @"Mobile customer Service"]; _chunyutel. Type= Ksetting600middle; [ Self. TableviewactionsAttachtoobject: _chunyutel tapblock: ^BOOL(IDObjectIDTargetNsindexpath*indexpath) {NSString* Feedbackphonenumber = @"4001100866"; [[uiapplicationSharedapplication] openurl:[NsurlURLWithString: [NSStringstringWithFormat: @"tel://%@", Feedbackphonenumber]];return YES; }];//Help_helpitem = [[Setting600item alloc] Initwithtitle: @"Help"]; _helpitem. Type= Ksetting600middle; [ Self. TableviewactionsAttachtoobject: _helpitem tapblock: ^BOOL(IDObjectIDTargetNsindexpath*indexpath) {cywebfromlocalviewcontroller* controller = [[Cywebfromlocalviewcontrolle R Alloc] initwithquery:@{@"title": @"Help", @"Local_name": @"Help"}]; [ Self. NavigationcontrollerPushviewcontroller:controller Animated:YES];return YES; }];//Statement_shengming = [[Setting600item alloc] Initwithtitle: @"declaration"]; _shengming. Type= Ksetting600middle; [ Self. TableviewactionsAttachtoobject:_shengming tapblock:^BOOL(IDObjectIDTargetNsindexpath*indexpath) {cywebfromlocalviewcontroller* controller = [[Cywebfromlocalviewcontrolle R Alloc] initwithquery:@{@"title": @"declaration", @"Local_name": @"Statement"}]; [ Self. NavigationcontrollerPushviewcontroller:controller Animated:YES];return YES; }];//About US_aboutus = [[Setting600item alloc] Initwithtitle: @"About Us"]; _aboutus. Type= Ksetting600bottom; [ Self. TableviewactionsAttachtoobject:_aboutus tapblock:^BOOL(IDObjectIDTargetNsindexpath*indexpath) {cyaboutusviewcontroller* controller = [[Cyaboutusviewcontroller alloc] I nitwithquery:@{@"title": @"About Us", @"Local_name": @"About"}]; [ Self. NavigationcontrollerPushviewcontroller:controller Animated:YES];return YES; }];//Cutting_separateitem = [[Setting600separateitem alloc] init];//Bottom View_logoutfooterview = [UIViewViewwithframe:cgrectmake (0,0, Self. View. Width, the*kviewradio) andbkcolor:[UicolorClearcolor]]; Self. TableView. Tablefooterview= _logoutfooterview;//Version number information    UILabel*versionlabel = [UILabelLabelwithframe:cgrectmake (0,8*kviewradio, Viewwidth (), A*kviewradio) FontSize: OneFontcolor:rgbcolor_hex (0x522121) text:[NSStringstringWithFormat: @"Current version number:%@", @"1.0.0"]                             ];    [Versionlabel Settextalignment:nstextalignmentcenter]; [_logoutfooterview Addsubview:versionlabel];CGRectLogoutrect = CGRectMake ( -*kviewradio, Versionlabel. Bottom+ -*kviewradio, Viewwidth ()- +*kviewradio, -*kviewradio);//Logout button_logoutbutton = [[Filledcolorbutton alloc] Initwithframe:logoutrect Color:rgbcolor_hex (0xe85454) Highlightedcolor:rgbcolor_hex (0xa43939) TextColor: [UicolorWhitecolor] Title: @"Logout"FontSize: -*kviewradio IsBold:YES]; [_logoutbutton AddTarget: SelfAction@selector(onlogoutbtnpressed:) forcontrolevents:uicontroleventtouchupinside]; [_logoutfooterview Addsubview:_logoutbutton];} - (void) edituserfigure {_portraitpickerviewcontroller = [[Portraitpickerviewcontroller alloc] Initwithparent: Self]; _portraitpickerviewcontroller. Delegate= Self; [_portraitpickerviewcontroller showoptions];} - (void) Createmodel {Nsarray*dataitems;if([User Hasloggedin]) {dataitems = @[_separateitem, _figureitem,//Change Avatar_separateitem, _changesecret,//Change login password_chunyutel,//Mobile customer service_helpitem,//Help_shengming,//Statement_aboutus,//About US_separateitem]; }Else{_logoutbutton. Hidden=YES; _logoutfooterview. Height= +; Dataitems = @[_separateitem, _chunyutel,//Mobile customer service_helpitem,//Help_shengming,//Statement_aboutus,//About US_separateitem]; } Self. Tableviewmodel= [[Nitableviewmodel alloc] Initwithlistarray:dataitems delega Te Self. Cellfactory];}#pragma mark-btn-selectors//Click Sign out- (void) Onlogoutbtnpressed: (UIButton*) Sender {nidprintmethodname ();//Log out[[Autologinmanager sharedinstance] logout];//Update the current interface[ SelfCreatemodel]; [ SelfBacktolastcontroller:Nil];//Let other places change the UI[[NsnotificationcenterDefaultcenter] Postnotificationname:knotificationuserlogout object:Nil];//Get badge that are not logged in[[NsnotificationcenterDefaultcenter] Postnotificationname:knotificationcheckbadge object:Nil];}@end

Effect

IOS-Settings and help interface

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.