Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added [email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions SimpleNotes.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 30EC2AFD19D76E6E00F6600F /* [email protected] */; };
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 */
Expand Down Expand Up @@ -62,6 +67,14 @@
1F42EFE9190989DC00B91F5B /* PSRDetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PSRDetailViewController.h; sourceTree = "<group>"; };
1F42EFEA190989DC00B91F5B /* PSRDetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PSRDetailViewController.m; sourceTree = "<group>"; };
1F876B9C19165105009DA0BB /* yoda.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = yoda.png; sourceTree = "<group>"; };
30EB7FB319D6F7EB0093795D /* main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = main.storyboard; sourceTree = "<group>"; };
30EC2AF719D74ED900F6600F /* PSRColoreSelectSliderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PSRColoreSelectSliderView.h; sourceTree = "<group>"; };
30EC2AF819D74ED900F6600F /* PSRColoreSelectSliderView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PSRColoreSelectSliderView.m; sourceTree = "<group>"; };
30EC2AFD19D76E6E00F6600F /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
30EC2AFF19D7704300F6600F /* PSRFontChangeController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PSRFontChangeController.h; sourceTree = "<group>"; };
30EC2B0019D7704300F6600F /* PSRFontChangeController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PSRFontChangeController.m; sourceTree = "<group>"; };
30EC2B0219D7717500F6600F /* PSRColoreSelectSliderViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PSRColoreSelectSliderViewController.h; sourceTree = "<group>"; };
30EC2B0319D7717500F6600F /* PSRColoreSelectSliderViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PSRColoreSelectSliderViewController.m; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -91,6 +104,7 @@
1F42EFA4190978A700B91F5B = {
isa = PBXGroup;
children = (
30EC2AFD19D76E6E00F6600F /* [email protected] */,
1F42EFB6190978A700B91F5B /* SimpleNotes */,
1F42EFCF190978A800B91F5B /* SimpleNotesTests */,
1F42EFAF190978A700B91F5B /* Frameworks */,
Expand Down Expand Up @@ -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 */,
Expand Down Expand Up @@ -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 /* [email protected] in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -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;
};
Expand Down Expand Up @@ -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;
};
Expand All @@ -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;
};
Expand Down
6 changes: 4 additions & 2 deletions SimpleNotes/PSRAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
18 changes: 18 additions & 0 deletions SimpleNotes/PSRColoreSelectSliderView.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// PSRColoreSelectSliderView.h
// SimpleNotes
//
// Created by dimaBii on 9/27/14.
// Copyright (c) 2014 Daniil Korotin. All rights reserved.
//

#import <UIKit/UIKit.h>

@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
31 changes: 31 additions & 0 deletions SimpleNotes/PSRColoreSelectSliderView.m
Original file line number Diff line number Diff line change
@@ -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
26 changes: 26 additions & 0 deletions SimpleNotes/PSRColoreSelectSliderViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//
// PSRColoreSelectSliderViewController.h
// SimpleNotes
//
// Created by dimaBii on 9/28/14.
// Copyright (c) 2014 Daniil Korotin. All rights reserved.
//

#import <UIKit/UIKit.h>

@class PSRColoreSelectSliderViewController;

@protocol PSRColoreSelectSliderViewControllerDelegate <NSObject>

-(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 <PSRColoreSelectSliderViewControllerDelegate> delegate;

@end
38 changes: 38 additions & 0 deletions SimpleNotes/PSRColoreSelectSliderViewController.m
Original file line number Diff line number Diff line change
@@ -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
4 changes: 3 additions & 1 deletion SimpleNotes/PSRDetailViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@

#import <UIKit/UIKit.h>
#import "PSRNote.h"
#import "PSRColoreSelectSliderViewController.h"

@interface PSRDetailViewController : UIViewController<PSRColoreSelectSliderViewControllerDelegate>

@interface PSRDetailViewController : UIViewController

@property (nonatomic, strong) UITextView *textView;
@property (nonatomic, strong) PSRNote *note;
Expand Down
36 changes: 34 additions & 2 deletions SimpleNotes/PSRDetailViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand All @@ -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 {
Expand Down
13 changes: 13 additions & 0 deletions SimpleNotes/PSRFontChangeController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// PSRFontChangeController.h
// SimpleNotes
//
// Created by dimaBii on 9/28/14.
// Copyright (c) 2014 Daniil Korotin. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface PSRFontChangeController : UIViewController

@end
38 changes: 38 additions & 0 deletions SimpleNotes/PSRFontChangeController.m
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion SimpleNotes/PSRNote.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 6 additions & 0 deletions SimpleNotes/PSRNote.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 {
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions SimpleNotes/SimpleNotes-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIMainStoryboardFile</key>
<string>main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
Loading