diff --git a/Default-568h@2x.png b/Default-568h@2x.png new file mode 100644 index 0000000..0891b7a Binary files /dev/null and b/Default-568h@2x.png differ diff --git a/SimpleNotes.xcodeproj/project.pbxproj b/SimpleNotes.xcodeproj/project.pbxproj index c4c896e..c36422c 100644 --- a/SimpleNotes.xcodeproj/project.pbxproj +++ b/SimpleNotes.xcodeproj/project.pbxproj @@ -24,6 +24,11 @@ 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 */; }; + 30EC2AF919D74ED900F6600F /* PSRColoreSelectSliderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 30EC2AF819D74ED900F6600F /* PSRColoreSelectSliderView.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 */ @@ -62,6 +67,14 @@ 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 = ""; }; + 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 = ""; }; + 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 */ @@ -91,6 +104,7 @@ 1F42EFA4190978A700B91F5B = { isa = PBXGroup; children = ( + 30EC2AFD19D76E6E00F6600F /* Default-568h@2x.png */, 1F42EFB6190978A700B91F5B /* SimpleNotes */, 1F42EFCF190978A800B91F5B /* SimpleNotesTests */, 1F42EFAF190978A700B91F5B /* Frameworks */, @@ -125,8 +139,15 @@ 1F42EFC0190978A700B91F5B /* PSRAppDelegate.m */, 1F42EFE619097ED100B91F5B /* PSRMasterViewController.h */, 1F42EFE719097ED100B91F5B /* PSRMasterViewController.m */, + 30EB7FB319D6F7EB0093795D /* main.storyboard */, 1F42EFE9190989DC00B91F5B /* PSRDetailViewController.h */, 1F42EFEA190989DC00B91F5B /* PSRDetailViewController.m */, + 30EC2AF719D74ED900F6600F /* PSRColoreSelectSliderView.h */, + 30EC2AF819D74ED900F6600F /* PSRColoreSelectSliderView.m */, + 30EC2B0219D7717500F6600F /* PSRColoreSelectSliderViewController.h */, + 30EC2B0319D7717500F6600F /* PSRColoreSelectSliderViewController.m */, + 30EC2AFF19D7704300F6600F /* PSRFontChangeController.h */, + 30EC2B0019D7704300F6600F /* PSRFontChangeController.m */, 1F876B9C19165105009DA0BB /* yoda.png */, 1F42EFE5190978EC00B91F5B /* Model */, 1F42EFC2190978A700B91F5B /* Images.xcassets */, @@ -254,6 +275,8 @@ 1F876B9D19165105009DA0BB /* yoda.png in Resources */, 1F42EFBB190978A700B91F5B /* InfoPlist.strings in Resources */, 1F42EFC3190978A700B91F5B /* Images.xcassets in Resources */, + 30EB7FB419D6F7EB0093795D /* main.storyboard in Resources */, + 30EC2AFE19D76E6E00F6600F /* Default-568h@2x.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -278,6 +301,9 @@ 1F42EFEB190989DC00B91F5B /* PSRDetailViewController.m in Sources */, 1F42EFE819097ED100B91F5B /* PSRMasterViewController.m in Sources */, 1F42EFBD190978A700B91F5B /* main.m in Sources */, + 30EC2AF919D74ED900F6600F /* PSRColoreSelectSliderView.m in Sources */, + 30EC2B0119D7704300F6600F /* PSRFontChangeController.m in Sources */, + 30EC2B0419D7717600F6600F /* PSRColoreSelectSliderViewController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -397,6 +423,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 +437,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/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..4b417d0 --- /dev/null +++ b/SimpleNotes/PSRColoreSelectSliderViewController.h @@ -0,0 +1,26 @@ +// +// PSRColoreSelectSliderViewController.h +// SimpleNotes +// +// Created by dimaBii on 9/28/14. +// Copyright (c) 2014 Daniil Korotin. All rights reserved. +// + +#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 diff --git a/SimpleNotes/PSRColoreSelectSliderViewController.m b/SimpleNotes/PSRColoreSelectSliderViewController.m new file mode 100644 index 0000000..882b810 --- /dev/null +++ b/SimpleNotes/PSRColoreSelectSliderViewController.m @@ -0,0 +1,38 @@ +// +// PSRColoreSelectSliderViewController.m +// SimpleNotes +// +// Created by dimaBii on 9/28/14. +// Copyright (c) 2014 Daniil Korotin. All rights reserved. +// + +#import "PSRColoreSelectSliderViewController.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 bd286d2..2a19a9a 100644 --- a/SimpleNotes/PSRDetailViewController.m +++ b/SimpleNotes/PSRDetailViewController.m @@ -13,9 +13,11 @@ @interface PSRDetailViewController () @end @implementation PSRDetailViewController - +//@synthesize colorViewController; - (void)viewDidLoad { [super viewDidLoad]; + + self.view.backgroundColor = [UIColor whiteColor]; self.textView = [[UITextView alloc] initWithFrame:self.view.bounds]; [self.view addSubview:self.textView]; @@ -27,11 +29,41 @@ - (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(changeColor); + 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"); + +} + +- (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 { 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/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..61957dc 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 = @"AmericanTypewriter"; } 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/SimpleNotes-Info.plist b/SimpleNotes/SimpleNotes-Info.plist index 4edabad..367c814 100644 --- a/SimpleNotes/SimpleNotes-Info.plist +++ b/SimpleNotes/SimpleNotes-Info.plist @@ -24,6 +24,8 @@ 1.0 LSRequiresIPhoneOS + UIMainStoryboardFile + main UIRequiredDeviceCapabilities armv7 @@ -31,8 +33,6 @@ UISupportedInterfaceOrientations UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight diff --git a/SimpleNotes/main.storyboard b/SimpleNotes/main.storyboard new file mode 100644 index 0000000..4fc6857 --- /dev/null +++ b/SimpleNotes/main.storyboard @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file