From be9f970cc09376db5a277532107737ae601a817e Mon Sep 17 00:00:00 2001 From: MIt9 Date: Sat, 27 Sep 2014 16:55:33 +0300 Subject: [PATCH 01/10] add storyboard --- SimpleNotes.xcodeproj/project.pbxproj | 6 ++++++ SimpleNotes/PSRAppDelegate.m | 6 ++++-- SimpleNotes/SimpleNotes-Info.plist | 3 ++- SimpleNotes/main.storyboard | 27 +++++++++++++++++++++++++++ 4 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 SimpleNotes/main.storyboard diff --git a/SimpleNotes.xcodeproj/project.pbxproj b/SimpleNotes.xcodeproj/project.pbxproj index c4c896e..ad6e86e 100644 --- a/SimpleNotes.xcodeproj/project.pbxproj +++ b/SimpleNotes.xcodeproj/project.pbxproj @@ -24,6 +24,7 @@ 1F42EFE819097ED100B91F5B /* PSRMasterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1F42EFE719097ED100B91F5B /* PSRMasterViewController.m */; }; 1F42EFEB190989DC00B91F5B /* PSRDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1F42EFEA190989DC00B91F5B /* PSRDetailViewController.m */; }; 1F876B9D19165105009DA0BB /* yoda.png in Resources */ = {isa = PBXBuildFile; fileRef = 1F876B9C19165105009DA0BB /* yoda.png */; }; + 30EB7FB419D6F7EB0093795D /* main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 30EB7FB319D6F7EB0093795D /* main.storyboard */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -62,6 +63,7 @@ 1F42EFE9190989DC00B91F5B /* PSRDetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PSRDetailViewController.h; sourceTree = ""; }; 1F42EFEA190989DC00B91F5B /* PSRDetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PSRDetailViewController.m; sourceTree = ""; }; 1F876B9C19165105009DA0BB /* yoda.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = yoda.png; sourceTree = ""; }; + 30EB7FB319D6F7EB0093795D /* main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = main.storyboard; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -125,6 +127,7 @@ 1F42EFC0190978A700B91F5B /* PSRAppDelegate.m */, 1F42EFE619097ED100B91F5B /* PSRMasterViewController.h */, 1F42EFE719097ED100B91F5B /* PSRMasterViewController.m */, + 30EB7FB319D6F7EB0093795D /* main.storyboard */, 1F42EFE9190989DC00B91F5B /* PSRDetailViewController.h */, 1F42EFEA190989DC00B91F5B /* PSRDetailViewController.m */, 1F876B9C19165105009DA0BB /* yoda.png */, @@ -254,6 +257,7 @@ 1F876B9D19165105009DA0BB /* yoda.png in Resources */, 1F42EFBB190978A700B91F5B /* InfoPlist.strings in Resources */, 1F42EFC3190978A700B91F5B /* Images.xcassets in Resources */, + 30EB7FB419D6F7EB0093795D /* main.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -397,6 +401,7 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "SimpleNotes/SimpleNotes-Prefix.pch"; INFOPLIST_FILE = "SimpleNotes/SimpleNotes-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 6.1; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; @@ -410,6 +415,7 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "SimpleNotes/SimpleNotes-Prefix.pch"; INFOPLIST_FILE = "SimpleNotes/SimpleNotes-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 6.1; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; diff --git a/SimpleNotes/PSRAppDelegate.m b/SimpleNotes/PSRAppDelegate.m index dcbb21e..6c93859 100644 --- a/SimpleNotes/PSRAppDelegate.m +++ b/SimpleNotes/PSRAppDelegate.m @@ -14,17 +14,19 @@ @implementation PSRAppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { +/* self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch. self.window.backgroundColor = [UIColor whiteColor]; - +*/ [[PSRNoteManager sharedManager] loadFromFile]; - +/* PSRMasterViewController *masterVC = [[PSRMasterViewController alloc] init]; UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:masterVC]; self.window.rootViewController = navigationController; [self.window makeKeyAndVisible]; + */ return YES; } diff --git a/SimpleNotes/SimpleNotes-Info.plist b/SimpleNotes/SimpleNotes-Info.plist index 4edabad..497a03c 100644 --- a/SimpleNotes/SimpleNotes-Info.plist +++ b/SimpleNotes/SimpleNotes-Info.plist @@ -24,13 +24,14 @@ 1.0 LSRequiresIPhoneOS + UIMainStoryboardFile + main UIRequiredDeviceCapabilities armv7 UISupportedInterfaceOrientations - UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight diff --git a/SimpleNotes/main.storyboard b/SimpleNotes/main.storyboard new file mode 100644 index 0000000..1551a93 --- /dev/null +++ b/SimpleNotes/main.storyboard @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 6b5d0636be94690d380104313748959827de1b31 Mon Sep 17 00:00:00 2001 From: MIt9 Date: Sat, 27 Sep 2014 17:00:14 +0300 Subject: [PATCH 02/10] last Change all work maybe --- SimpleNotes/SimpleNotes-Info.plist | 3 +-- SimpleNotes/main.storyboard | 23 +++++++++++++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/SimpleNotes/SimpleNotes-Info.plist b/SimpleNotes/SimpleNotes-Info.plist index 497a03c..367c814 100644 --- a/SimpleNotes/SimpleNotes-Info.plist +++ b/SimpleNotes/SimpleNotes-Info.plist @@ -32,8 +32,7 @@ UISupportedInterfaceOrientations - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight + UIInterfaceOrientationPortrait diff --git a/SimpleNotes/main.storyboard b/SimpleNotes/main.storyboard index 1551a93..87ce023 100644 --- a/SimpleNotes/main.storyboard +++ b/SimpleNotes/main.storyboard @@ -1,5 +1,5 @@ - + @@ -9,13 +9,32 @@ - + + + + + + + + + + + + + + + + + + + + From fbc460a4e0d51f2178e68de5322c0b6bad2c5c77 Mon Sep 17 00:00:00 2001 From: MIt9 Date: Sat, 27 Sep 2014 17:05:46 +0300 Subject: [PATCH 03/10] =?UTF-8?q?=D0=BF=D1=83=D0=BD=D0=BA=D1=82=205=20?= =?UTF-8?q?=D0=B2=D1=8B=D0=BF=D0=BE=D0=BB=D0=BD=D0=B5=D0=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SimpleNotes/main.storyboard | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/SimpleNotes/main.storyboard b/SimpleNotes/main.storyboard index 87ce023..c1f7414 100644 --- a/SimpleNotes/main.storyboard +++ b/SimpleNotes/main.storyboard @@ -4,10 +4,10 @@ - + - + @@ -38,6 +38,11 @@ + + + + + From c9031c7813742742598c9f8db9386a50b4c611bf Mon Sep 17 00:00:00 2001 From: MIt9 Date: Sat, 27 Sep 2014 19:27:35 +0300 Subject: [PATCH 04/10] =?UTF-8?q?=D0=BF=D1=80=D0=B8=D1=81=D1=82=D1=83?= =?UTF-8?q?=D0=BF=D0=B0=D1=8E=20=D0=BA=20=D0=BF=D1=83=D0=BD=D0=BA=D1=82?= =?UTF-8?q?=D1=83=207?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SimpleNotes/PSRDetailViewController.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SimpleNotes/PSRDetailViewController.m b/SimpleNotes/PSRDetailViewController.m index bd286d2..ee14843 100644 --- a/SimpleNotes/PSRDetailViewController.m +++ b/SimpleNotes/PSRDetailViewController.m @@ -28,6 +28,8 @@ - (void)viewDidLoad { UIBarButtonItem *cancelButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancel)]; self.navigationItem.rightBarButtonItem = cancelButton; + + } - (void)cancel { From db822ca5a64289d358c942880bbc9131b3b3e30b Mon Sep 17 00:00:00 2001 From: MIt9 Date: Sat, 27 Sep 2014 21:17:38 +0300 Subject: [PATCH 05/10] add to note property color and font with empty in it --- SimpleNotes/PSRDetailViewController.m | 22 +++++++++++++++++++--- SimpleNotes/PSRNote.h | 3 ++- SimpleNotes/PSRNote.m | 6 ++++++ SimpleNotes/main.storyboard | 7 +------ 4 files changed, 28 insertions(+), 10 deletions(-) diff --git a/SimpleNotes/PSRDetailViewController.m b/SimpleNotes/PSRDetailViewController.m index ee14843..2898719 100644 --- a/SimpleNotes/PSRDetailViewController.m +++ b/SimpleNotes/PSRDetailViewController.m @@ -16,6 +16,8 @@ @implementation PSRDetailViewController - (void)viewDidLoad { [super viewDidLoad]; + + self.view.backgroundColor = [UIColor whiteColor]; self.textView = [[UITextView alloc] initWithFrame:self.view.bounds]; [self.view addSubview:self.textView]; @@ -27,15 +29,29 @@ - (void)viewDidLoad { self.navigationItem.title = self.note.text; UIBarButtonItem *cancelButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancel)]; - self.navigationItem.rightBarButtonItem = cancelButton; - + + UIBarButtonItem *colorChangeButton = [[UIBarButtonItem alloc]init]; + colorChangeButton.action = @selector(doTheThing); + colorChangeButton.title = @"Color"; + colorChangeButton.target = self; + UIBarButtonItem *fontChangeButton = [[UIBarButtonItem alloc]init]; + fontChangeButton.action = @selector(doTheThing); + fontChangeButton.title = @"Font"; + fontChangeButton.target = self; + +// self.navigationItem.rightBarButtonItem = buttons; + self.navigationItem.rightBarButtonItems = [[NSArray alloc] initWithObjects:cancelButton, colorChangeButton, fontChangeButton, nil]; } - (void)cancel { } - +- (void) doTheThing { + + NSLog(@"Doing the thing"); + +} - (void)viewWillDisappear:(BOOL)animated { self.note.text = self.textView.text; } diff --git a/SimpleNotes/PSRNote.h b/SimpleNotes/PSRNote.h index d745b9f..c57a79b 100644 --- a/SimpleNotes/PSRNote.h +++ b/SimpleNotes/PSRNote.h @@ -10,5 +10,6 @@ @property (nonatomic, strong) NSString *text; @property (nonatomic, strong) NSDate *date; - +@property (nonatomic, strong) UIColor *color; +@property (nonatomic, strong) NSString *font; @end diff --git a/SimpleNotes/PSRNote.m b/SimpleNotes/PSRNote.m index 172d0ff..f09da51 100644 --- a/SimpleNotes/PSRNote.m +++ b/SimpleNotes/PSRNote.m @@ -16,6 +16,8 @@ - (id)init { if (self) { self.text = @"New note"; self.date = [NSDate date]; + self.color = [UIColor blackColor]; + self.font = @"some"; } return self; @@ -24,6 +26,8 @@ - (id)init { - (void)encodeWithCoder:(NSCoder *)coder { [coder encodeObject:self.text forKey:@"text"]; [coder encodeObject:self.date forKey:@"date"]; + [coder encodeObject:self.color forKey:@"color"]; + [coder encodeObject:self.font forKey:@"font"]; } - (id)initWithCoder:(NSCoder *)aDecoder { @@ -32,6 +36,8 @@ - (id)initWithCoder:(NSCoder *)aDecoder { if (self) { self.text = [aDecoder decodeObjectForKey:@"text"]; self.date = [aDecoder decodeObjectForKey:@"date"]; + self.color = [aDecoder decodeObjectForKey:@"color"]; + self.font = [aDecoder decodeObjectForKey:@"font"]; } return self; diff --git a/SimpleNotes/main.storyboard b/SimpleNotes/main.storyboard index c1f7414..bef126f 100644 --- a/SimpleNotes/main.storyboard +++ b/SimpleNotes/main.storyboard @@ -17,7 +17,7 @@ - + @@ -38,11 +38,6 @@ - - - - - From 008fd6d8015633e11927708441a54fee0770a327 Mon Sep 17 00:00:00 2001 From: MIt9 Date: Sat, 27 Sep 2014 22:41:06 +0300 Subject: [PATCH 06/10] correct PSRNote --- SimpleNotes/PSRNote.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SimpleNotes/PSRNote.m b/SimpleNotes/PSRNote.m index f09da51..61957dc 100644 --- a/SimpleNotes/PSRNote.m +++ b/SimpleNotes/PSRNote.m @@ -17,7 +17,7 @@ - (id)init { self.text = @"New note"; self.date = [NSDate date]; self.color = [UIColor blackColor]; - self.font = @"some"; + self.font = @"AmericanTypewriter"; } return self; From 36e8e42b9ede6ccba9facbf76a1834f9bf676b56 Mon Sep 17 00:00:00 2001 From: MIt9 Date: Sat, 27 Sep 2014 22:57:24 +0300 Subject: [PATCH 07/10] some color change of storyboard --- SimpleNotes/main.storyboard | 72 +++++++++++++++++++++++++++++++++++-- 1 file changed, 70 insertions(+), 2 deletions(-) diff --git a/SimpleNotes/main.storyboard b/SimpleNotes/main.storyboard index bef126f..41388b5 100644 --- a/SimpleNotes/main.storyboard +++ b/SimpleNotes/main.storyboard @@ -17,7 +17,67 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -35,9 +95,17 @@ - + + + + + + + + + From dc82eb98ba17d83e57ff71865380c6cb16c900e5 Mon Sep 17 00:00:00 2001 From: MIt9 Date: Sat, 27 Sep 2014 23:17:24 +0300 Subject: [PATCH 08/10] add PSRColoreSelectSliderView and PSRColoreSelectSliderViewController just h --- SimpleNotes.xcodeproj/project.pbxproj | 12 +++++++ SimpleNotes/PSRColoreSelectSliderView.h | 18 +++++++++++ SimpleNotes/PSRColoreSelectSliderView.m | 31 +++++++++++++++++++ .../PSRColoreSelectSliderViewController.h | 22 +++++++++++++ .../PSRColoreSelectSliderViewController.m | 16 ++++++++++ SimpleNotes/main.storyboard | 17 ++++++++-- 6 files changed, 113 insertions(+), 3 deletions(-) create mode 100644 SimpleNotes/PSRColoreSelectSliderView.h create mode 100644 SimpleNotes/PSRColoreSelectSliderView.m create mode 100644 SimpleNotes/PSRColoreSelectSliderViewController.h create mode 100644 SimpleNotes/PSRColoreSelectSliderViewController.m diff --git a/SimpleNotes.xcodeproj/project.pbxproj b/SimpleNotes.xcodeproj/project.pbxproj index ad6e86e..99acf4d 100644 --- a/SimpleNotes.xcodeproj/project.pbxproj +++ b/SimpleNotes.xcodeproj/project.pbxproj @@ -25,6 +25,8 @@ 1F42EFEB190989DC00B91F5B /* PSRDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1F42EFEA190989DC00B91F5B /* PSRDetailViewController.m */; }; 1F876B9D19165105009DA0BB /* yoda.png in Resources */ = {isa = PBXBuildFile; fileRef = 1F876B9C19165105009DA0BB /* yoda.png */; }; 30EB7FB419D6F7EB0093795D /* main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 30EB7FB319D6F7EB0093795D /* main.storyboard */; }; + 30EC2AF919D74ED900F6600F /* PSRColoreSelectSliderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 30EC2AF819D74ED900F6600F /* PSRColoreSelectSliderView.m */; }; + 30EC2AFC19D7505300F6600F /* PSRColoreSelectSliderViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 30EC2AFB19D7505300F6600F /* PSRColoreSelectSliderViewController.m */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -64,6 +66,10 @@ 1F42EFEA190989DC00B91F5B /* PSRDetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PSRDetailViewController.m; sourceTree = ""; }; 1F876B9C19165105009DA0BB /* yoda.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = yoda.png; sourceTree = ""; }; 30EB7FB319D6F7EB0093795D /* main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = main.storyboard; sourceTree = ""; }; + 30EC2AF719D74ED900F6600F /* PSRColoreSelectSliderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PSRColoreSelectSliderView.h; sourceTree = ""; }; + 30EC2AF819D74ED900F6600F /* PSRColoreSelectSliderView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PSRColoreSelectSliderView.m; sourceTree = ""; }; + 30EC2AFA19D7505300F6600F /* PSRColoreSelectSliderViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PSRColoreSelectSliderViewController.h; sourceTree = ""; }; + 30EC2AFB19D7505300F6600F /* PSRColoreSelectSliderViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PSRColoreSelectSliderViewController.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -129,7 +135,11 @@ 1F42EFE719097ED100B91F5B /* PSRMasterViewController.m */, 30EB7FB319D6F7EB0093795D /* main.storyboard */, 1F42EFE9190989DC00B91F5B /* PSRDetailViewController.h */, + 30EC2AF719D74ED900F6600F /* PSRColoreSelectSliderView.h */, + 30EC2AF819D74ED900F6600F /* PSRColoreSelectSliderView.m */, 1F42EFEA190989DC00B91F5B /* PSRDetailViewController.m */, + 30EC2AFA19D7505300F6600F /* PSRColoreSelectSliderViewController.h */, + 30EC2AFB19D7505300F6600F /* PSRColoreSelectSliderViewController.m */, 1F876B9C19165105009DA0BB /* yoda.png */, 1F42EFE5190978EC00B91F5B /* Model */, 1F42EFC2190978A700B91F5B /* Images.xcassets */, @@ -282,6 +292,8 @@ 1F42EFEB190989DC00B91F5B /* PSRDetailViewController.m in Sources */, 1F42EFE819097ED100B91F5B /* PSRMasterViewController.m in Sources */, 1F42EFBD190978A700B91F5B /* main.m in Sources */, + 30EC2AF919D74ED900F6600F /* PSRColoreSelectSliderView.m in Sources */, + 30EC2AFC19D7505300F6600F /* PSRColoreSelectSliderViewController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/SimpleNotes/PSRColoreSelectSliderView.h b/SimpleNotes/PSRColoreSelectSliderView.h new file mode 100644 index 0000000..9b5af9d --- /dev/null +++ b/SimpleNotes/PSRColoreSelectSliderView.h @@ -0,0 +1,18 @@ +// +// PSRColoreSelectSliderView.h +// SimpleNotes +// +// Created by dimaBii on 9/27/14. +// Copyright (c) 2014 Daniil Korotin. All rights reserved. +// + +#import + +@interface PSRColoreSelectSliderView : UIView + +@property (nonatomic, strong) UIColor *color; + +@property (nonatomic, weak) IBOutlet UISlider *redSlider; +@property (nonatomic, weak) IBOutlet UISlider *greenSlider; +@property (nonatomic, weak) IBOutlet UISlider *blueSlider; +@end diff --git a/SimpleNotes/PSRColoreSelectSliderView.m b/SimpleNotes/PSRColoreSelectSliderView.m new file mode 100644 index 0000000..60827f5 --- /dev/null +++ b/SimpleNotes/PSRColoreSelectSliderView.m @@ -0,0 +1,31 @@ +// +// PSRColoreSelectSliderView.m +// SimpleNotes +// +// Created by dimaBii on 9/27/14. +// Copyright (c) 2014 Daniil Korotin. All rights reserved. +// + +#import "PSRColoreSelectSliderView.h" + +@implementation PSRColoreSelectSliderView + +- (id)initWithFrame:(CGRect)frame +{ + self = [super initWithFrame:frame]; + if (self) { + // Initialization code + } + return self; +} + +/* +// Only override drawRect: if you perform custom drawing. +// An empty implementation adversely affects performance during animation. +- (void)drawRect:(CGRect)rect +{ + // Drawing code +} +*/ + +@end diff --git a/SimpleNotes/PSRColoreSelectSliderViewController.h b/SimpleNotes/PSRColoreSelectSliderViewController.h new file mode 100644 index 0000000..00ee202 --- /dev/null +++ b/SimpleNotes/PSRColoreSelectSliderViewController.h @@ -0,0 +1,22 @@ +// +// PSRColoreSelectSliderViewController.h +// SimpleNotes +// +// Created by dimaBii on 9/27/14. +// Copyright (c) 2014 Daniil Korotin. All rights reserved. +// + +#import + +@class PSRColoreSelectSliderViewController; +@protocol PSRColoreSelectSliderViewControllerDelegate + +-(void)psr_colorSelectViewControler:(PSRColoreSelectSliderViewController *) controller didFinishWithColor:(UIColor *)color; + +@end + +@interface PSRColoreSelectSliderViewController: UIViewController +@property (nonatomic, strong) UIColor *SelectedColor; +@property (nonatomic, weak) id delegate; + +@end \ No newline at end of file diff --git a/SimpleNotes/PSRColoreSelectSliderViewController.m b/SimpleNotes/PSRColoreSelectSliderViewController.m new file mode 100644 index 0000000..313fd47 --- /dev/null +++ b/SimpleNotes/PSRColoreSelectSliderViewController.m @@ -0,0 +1,16 @@ +// +// PSRColoreSelectSliderViewController.m +// SimpleNotes +// +// Created by dimaBii on 9/27/14. +// Copyright (c) 2014 Daniil Korotin. All rights reserved. +// + +#import "PSRColoreSelectSliderViewController.h" + +@implementation PSRColoreSelectSliderViewController +-(void)viewDidLoad{ + + [super viewDidLoad]; +} +@end diff --git a/SimpleNotes/main.storyboard b/SimpleNotes/main.storyboard index 41388b5..25dad72 100644 --- a/SimpleNotes/main.storyboard +++ b/SimpleNotes/main.storyboard @@ -19,15 +19,15 @@ - + - + - + @@ -102,6 +102,17 @@ + + + + + + + + + + + From 014df8915b325c521d8455b5cb9179d29b9a47e1 Mon Sep 17 00:00:00 2001 From: MIt9 Date: Sat, 27 Sep 2014 23:30:29 +0300 Subject: [PATCH 09/10] correct controller --- SimpleNotes.xcodeproj/project.pbxproj | 2 +- SimpleNotes/PSRColoreSelectSliderViewController.h | 6 +++++- SimpleNotes/PSRColoreSelectSliderViewController.m | 6 ++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/SimpleNotes.xcodeproj/project.pbxproj b/SimpleNotes.xcodeproj/project.pbxproj index 99acf4d..61e8cd1 100644 --- a/SimpleNotes.xcodeproj/project.pbxproj +++ b/SimpleNotes.xcodeproj/project.pbxproj @@ -135,9 +135,9 @@ 1F42EFE719097ED100B91F5B /* PSRMasterViewController.m */, 30EB7FB319D6F7EB0093795D /* main.storyboard */, 1F42EFE9190989DC00B91F5B /* PSRDetailViewController.h */, + 1F42EFEA190989DC00B91F5B /* PSRDetailViewController.m */, 30EC2AF719D74ED900F6600F /* PSRColoreSelectSliderView.h */, 30EC2AF819D74ED900F6600F /* PSRColoreSelectSliderView.m */, - 1F42EFEA190989DC00B91F5B /* PSRDetailViewController.m */, 30EC2AFA19D7505300F6600F /* PSRColoreSelectSliderViewController.h */, 30EC2AFB19D7505300F6600F /* PSRColoreSelectSliderViewController.m */, 1F876B9C19165105009DA0BB /* yoda.png */, diff --git a/SimpleNotes/PSRColoreSelectSliderViewController.h b/SimpleNotes/PSRColoreSelectSliderViewController.h index 00ee202..e85fdf5 100644 --- a/SimpleNotes/PSRColoreSelectSliderViewController.h +++ b/SimpleNotes/PSRColoreSelectSliderViewController.h @@ -9,14 +9,18 @@ #import @class PSRColoreSelectSliderViewController; + @protocol PSRColoreSelectSliderViewControllerDelegate -(void)psr_colorSelectViewControler:(PSRColoreSelectSliderViewController *) controller didFinishWithColor:(UIColor *)color; @end +@class PSRColoreSelectSliderView; + @interface PSRColoreSelectSliderViewController: UIViewController +@property (nonatomic,weak) IBOutlet PSRColoreSelectSliderView *colorSlider; @property (nonatomic, strong) UIColor *SelectedColor; @property (nonatomic, weak) id delegate; -@end \ No newline at end of file +@end diff --git a/SimpleNotes/PSRColoreSelectSliderViewController.m b/SimpleNotes/PSRColoreSelectSliderViewController.m index 313fd47..d8c3222 100644 --- a/SimpleNotes/PSRColoreSelectSliderViewController.m +++ b/SimpleNotes/PSRColoreSelectSliderViewController.m @@ -7,10 +7,8 @@ // #import "PSRColoreSelectSliderViewController.h" +#import "PSRColoreSelectSliderView.h" @implementation PSRColoreSelectSliderViewController --(void)viewDidLoad{ - - [super viewDidLoad]; -} + @end From 89e3270448e184cedf4b03ea2fe3d82c2774a623 Mon Sep 17 00:00:00 2001 From: MIt9 Date: Tue, 30 Sep 2014 09:05:09 +0300 Subject: [PATCH 10/10] Add code go to colour control --- Default-568h@2x.png | Bin 0 -> 18594 bytes SimpleNotes.xcodeproj/project.pbxproj | 22 +++++++--- .../PSRColoreSelectSliderViewController.h | 6 +-- .../PSRColoreSelectSliderViewController.m | 28 ++++++++++++- SimpleNotes/PSRDetailViewController.h | 4 +- SimpleNotes/PSRDetailViewController.m | 18 ++++++++- SimpleNotes/PSRFontChangeController.h | 13 ++++++ SimpleNotes/PSRFontChangeController.m | 38 ++++++++++++++++++ SimpleNotes/main.storyboard | 10 +++-- 9 files changed, 122 insertions(+), 17 deletions(-) create mode 100644 Default-568h@2x.png create mode 100644 SimpleNotes/PSRFontChangeController.h create mode 100644 SimpleNotes/PSRFontChangeController.m diff --git a/Default-568h@2x.png b/Default-568h@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..0891b7aabfcf3422423b109c8beed2bab838c607 GIT binary patch literal 18594 zcmeI4X;f257Jx&9fS`ixvS;&$x8J@slQFSel)6zJN=?13FB7H(lQjRkSy8x_-S~tvu2gzn1oS+dLcF#eqtq$ z%tf9TTvX?`)R@}3uBI;jzS-=ZR-Td&MHaS&;!0?Ni*#$#`n*~CcQK)Q9vAQ~TUpnI!j)a2biYK^R)M~A5wUDZhx?ULMX z3x1P&qt=trOY6P2U67L=m=U?F|5#Uj(eCueNTZaHs_ceWiHeET+j+tp3Jt9g(ekqP z2WOvfR{qV+9r+o4J5?qK>7;;^+I7tGv-i)es$X_D=EoKF+S?zsyj^oRFElP}c}JT< zd8SUs-?O?}2YD#ngKbnHgzHBcboxK_2r9l(?eNCl-pEzkJm}fY?WC*jnS?VBE4EpY zO$fEejz6fU;W2Kl>JeQBZBl-%Irg`obSlg*@4QB;Dd1H7^Oi5wvt4d{RZ!8Og?^aE z)k0$1g+V3fd(gdQ3d&q2q-FL*uy#}|bc^=VhFsl0jBgUGJ+-s3U8MK9A!YJJMxpci z5hJ%|{DwV48fZn0{n5l$N_KcSb#NKE4plB`9I6Zt=Z!~-zw0{9tg$L&Ju1F0X)Cy8 zKF;(&lJ>x)Jw(=;p~sF(Sd9VWGwFE2rnyS9!f^DZ8+aCLq zQ};>lcJ1GDLqjm6Hd>|Eabno@P`~Bn(~6^aD_#yoEH(a?Nm1S<;S+hSxI5d16^<1lEM3NPFi zkqPrpL)+ zgnseFikg`gJVBha1&7C4;O6>h=dt~`ND+;Zd?W(4v2JIb7Pt>Td42%M-Ju-XAH#Pns762L}K3 zDhvsRqN0Ni(1UrishD2YvV?4*h2iFj$+&N||Fn$4n|^NSU+o?~jq`0jVQt8T9l{7b zXiwwODFh2V!Q6sqP9S>WH$oOf$N~=d0-bqTlD61!=`&0eAP-F>XN?*|gtOXX{ zQVTWyYo4ZK0GAw!GHf|pz9`D;-bbb*5LBX*{bnz|+)$@&P9|ORM2o?95{;ejvo&r- zq8cBhTN6nn)7~W>54U)%-F_-b?YKdfk5I8MHcuzBD5)!;yv#Z&R&^y=@=>VTIMy#r zX&U<=BsPkdqcMe<_}2+>H%XKyrr5ZR8_KVe>ZqYN z^=^~TFD};;rHJ$U;{~w^hYojl4hRI@SH$^K{YEo=sg)WY87r!*7blQK&qnpDo0`Vn zkl)9u9g=mCh&ZCJS(L4yN3k0kQ zuvg$h2KEEk51T+O0JQ+r0`R>g{jvqM0Mr6d3qUOZwE!?PI7HY@CE|dr sfw?Q;rAv?G4&^^8-z_>&sWXMxvD*gPOU4CBe-*@OtE+wfmVJNyHv)PfH~;_u literal 0 HcmV?d00001 diff --git a/SimpleNotes.xcodeproj/project.pbxproj b/SimpleNotes.xcodeproj/project.pbxproj index 61e8cd1..c36422c 100644 --- a/SimpleNotes.xcodeproj/project.pbxproj +++ b/SimpleNotes.xcodeproj/project.pbxproj @@ -26,7 +26,9 @@ 1F876B9D19165105009DA0BB /* yoda.png in Resources */ = {isa = PBXBuildFile; fileRef = 1F876B9C19165105009DA0BB /* yoda.png */; }; 30EB7FB419D6F7EB0093795D /* main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 30EB7FB319D6F7EB0093795D /* main.storyboard */; }; 30EC2AF919D74ED900F6600F /* PSRColoreSelectSliderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 30EC2AF819D74ED900F6600F /* PSRColoreSelectSliderView.m */; }; - 30EC2AFC19D7505300F6600F /* PSRColoreSelectSliderViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 30EC2AFB19D7505300F6600F /* PSRColoreSelectSliderViewController.m */; }; + 30EC2AFE19D76E6E00F6600F /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 30EC2AFD19D76E6E00F6600F /* Default-568h@2x.png */; }; + 30EC2B0119D7704300F6600F /* PSRFontChangeController.m in Sources */ = {isa = PBXBuildFile; fileRef = 30EC2B0019D7704300F6600F /* PSRFontChangeController.m */; }; + 30EC2B0419D7717600F6600F /* PSRColoreSelectSliderViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 30EC2B0319D7717500F6600F /* PSRColoreSelectSliderViewController.m */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -68,8 +70,11 @@ 30EB7FB319D6F7EB0093795D /* main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = main.storyboard; sourceTree = ""; }; 30EC2AF719D74ED900F6600F /* PSRColoreSelectSliderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PSRColoreSelectSliderView.h; sourceTree = ""; }; 30EC2AF819D74ED900F6600F /* PSRColoreSelectSliderView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PSRColoreSelectSliderView.m; sourceTree = ""; }; - 30EC2AFA19D7505300F6600F /* PSRColoreSelectSliderViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PSRColoreSelectSliderViewController.h; sourceTree = ""; }; - 30EC2AFB19D7505300F6600F /* PSRColoreSelectSliderViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PSRColoreSelectSliderViewController.m; sourceTree = ""; }; + 30EC2AFD19D76E6E00F6600F /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; + 30EC2AFF19D7704300F6600F /* PSRFontChangeController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PSRFontChangeController.h; sourceTree = ""; }; + 30EC2B0019D7704300F6600F /* PSRFontChangeController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PSRFontChangeController.m; sourceTree = ""; }; + 30EC2B0219D7717500F6600F /* PSRColoreSelectSliderViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PSRColoreSelectSliderViewController.h; sourceTree = ""; }; + 30EC2B0319D7717500F6600F /* PSRColoreSelectSliderViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PSRColoreSelectSliderViewController.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -99,6 +104,7 @@ 1F42EFA4190978A700B91F5B = { isa = PBXGroup; children = ( + 30EC2AFD19D76E6E00F6600F /* Default-568h@2x.png */, 1F42EFB6190978A700B91F5B /* SimpleNotes */, 1F42EFCF190978A800B91F5B /* SimpleNotesTests */, 1F42EFAF190978A700B91F5B /* Frameworks */, @@ -138,8 +144,10 @@ 1F42EFEA190989DC00B91F5B /* PSRDetailViewController.m */, 30EC2AF719D74ED900F6600F /* PSRColoreSelectSliderView.h */, 30EC2AF819D74ED900F6600F /* PSRColoreSelectSliderView.m */, - 30EC2AFA19D7505300F6600F /* PSRColoreSelectSliderViewController.h */, - 30EC2AFB19D7505300F6600F /* PSRColoreSelectSliderViewController.m */, + 30EC2B0219D7717500F6600F /* PSRColoreSelectSliderViewController.h */, + 30EC2B0319D7717500F6600F /* PSRColoreSelectSliderViewController.m */, + 30EC2AFF19D7704300F6600F /* PSRFontChangeController.h */, + 30EC2B0019D7704300F6600F /* PSRFontChangeController.m */, 1F876B9C19165105009DA0BB /* yoda.png */, 1F42EFE5190978EC00B91F5B /* Model */, 1F42EFC2190978A700B91F5B /* Images.xcassets */, @@ -268,6 +276,7 @@ 1F42EFBB190978A700B91F5B /* InfoPlist.strings in Resources */, 1F42EFC3190978A700B91F5B /* Images.xcassets in Resources */, 30EB7FB419D6F7EB0093795D /* main.storyboard in Resources */, + 30EC2AFE19D76E6E00F6600F /* Default-568h@2x.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -293,7 +302,8 @@ 1F42EFE819097ED100B91F5B /* PSRMasterViewController.m in Sources */, 1F42EFBD190978A700B91F5B /* main.m in Sources */, 30EC2AF919D74ED900F6600F /* PSRColoreSelectSliderView.m in Sources */, - 30EC2AFC19D7505300F6600F /* PSRColoreSelectSliderViewController.m in Sources */, + 30EC2B0119D7704300F6600F /* PSRFontChangeController.m in Sources */, + 30EC2B0419D7717600F6600F /* PSRColoreSelectSliderViewController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/SimpleNotes/PSRColoreSelectSliderViewController.h b/SimpleNotes/PSRColoreSelectSliderViewController.h index e85fdf5..4b417d0 100644 --- a/SimpleNotes/PSRColoreSelectSliderViewController.h +++ b/SimpleNotes/PSRColoreSelectSliderViewController.h @@ -2,11 +2,11 @@ // PSRColoreSelectSliderViewController.h // SimpleNotes // -// Created by dimaBii on 9/27/14. +// Created by dimaBii on 9/28/14. // Copyright (c) 2014 Daniil Korotin. All rights reserved. // -#import +#import @class PSRColoreSelectSliderViewController; @@ -23,4 +23,4 @@ @property (nonatomic, strong) UIColor *SelectedColor; @property (nonatomic, weak) id delegate; -@end +@end \ No newline at end of file diff --git a/SimpleNotes/PSRColoreSelectSliderViewController.m b/SimpleNotes/PSRColoreSelectSliderViewController.m index d8c3222..882b810 100644 --- a/SimpleNotes/PSRColoreSelectSliderViewController.m +++ b/SimpleNotes/PSRColoreSelectSliderViewController.m @@ -2,13 +2,37 @@ // PSRColoreSelectSliderViewController.m // SimpleNotes // -// Created by dimaBii on 9/27/14. +// Created by dimaBii on 9/28/14. // Copyright (c) 2014 Daniil Korotin. All rights reserved. // #import "PSRColoreSelectSliderViewController.h" -#import "PSRColoreSelectSliderView.h" + +@interface PSRColoreSelectSliderViewController () + +@end @implementation PSRColoreSelectSliderViewController +/* +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) { + // Custom initialization + } + return self; +} +*/ +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} @end diff --git a/SimpleNotes/PSRDetailViewController.h b/SimpleNotes/PSRDetailViewController.h index 322f016..fd94543 100644 --- a/SimpleNotes/PSRDetailViewController.h +++ b/SimpleNotes/PSRDetailViewController.h @@ -8,8 +8,10 @@ #import #import "PSRNote.h" +#import "PSRColoreSelectSliderViewController.h" + +@interface PSRDetailViewController : UIViewController -@interface PSRDetailViewController : UIViewController @property (nonatomic, strong) UITextView *textView; @property (nonatomic, strong) PSRNote *note; diff --git a/SimpleNotes/PSRDetailViewController.m b/SimpleNotes/PSRDetailViewController.m index 2898719..2a19a9a 100644 --- a/SimpleNotes/PSRDetailViewController.m +++ b/SimpleNotes/PSRDetailViewController.m @@ -13,7 +13,7 @@ @interface PSRDetailViewController () @end @implementation PSRDetailViewController - +//@synthesize colorViewController; - (void)viewDidLoad { [super viewDidLoad]; @@ -31,7 +31,7 @@ - (void)viewDidLoad { UIBarButtonItem *cancelButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancel)]; UIBarButtonItem *colorChangeButton = [[UIBarButtonItem alloc]init]; - colorChangeButton.action = @selector(doTheThing); + colorChangeButton.action = @selector(changeColor); colorChangeButton.title = @"Color"; colorChangeButton.target = self; @@ -52,6 +52,20 @@ - (void) doTheThing { NSLog(@"Doing the thing"); } + +- (IBAction)changeColor { + + PSRColoreSelectSliderViewController *colorChangerView = [[PSRColoreSelectSliderViewController alloc]initWithNibName:@"colorChangerView" bundle:nil]; + + [self.navigationController pushViewController:colorChangerView animated:YES]; + + // colorChangerView = [self.storyboard instantiateViewControllerWithIdentifier:@"colorChangerView"]; + // [self.navigationController presentViewController:colorChangerView animated:YES completion:nil]; + + // [self presentViewController:colorChangerView animated:YES completion:nil]; + +} + - (void)viewWillDisappear:(BOOL)animated { self.note.text = self.textView.text; } diff --git a/SimpleNotes/PSRFontChangeController.h b/SimpleNotes/PSRFontChangeController.h new file mode 100644 index 0000000..b9089ae --- /dev/null +++ b/SimpleNotes/PSRFontChangeController.h @@ -0,0 +1,13 @@ +// +// PSRFontChangeController.h +// SimpleNotes +// +// Created by dimaBii on 9/28/14. +// Copyright (c) 2014 Daniil Korotin. All rights reserved. +// + +#import + +@interface PSRFontChangeController : UIViewController + +@end diff --git a/SimpleNotes/PSRFontChangeController.m b/SimpleNotes/PSRFontChangeController.m new file mode 100644 index 0000000..ab93984 --- /dev/null +++ b/SimpleNotes/PSRFontChangeController.m @@ -0,0 +1,38 @@ +// +// PSRFontChangeController.m +// SimpleNotes +// +// Created by dimaBii on 9/28/14. +// Copyright (c) 2014 Daniil Korotin. All rights reserved. +// + +#import "PSRFontChangeController.h" + +@interface PSRFontChangeController () + +@end + +@implementation PSRFontChangeController + +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) { + // Custom initialization + } + return self; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +@end diff --git a/SimpleNotes/main.storyboard b/SimpleNotes/main.storyboard index 25dad72..4fc6857 100644 --- a/SimpleNotes/main.storyboard +++ b/SimpleNotes/main.storyboard @@ -22,12 +22,12 @@ - + - + @@ -41,7 +41,6 @@ - @@ -50,6 +49,7 @@ +