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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
[submodule "TwUITests/specta"]
path = TwUITests/specta
url = git://github.com/petejkim/specta.git
[submodule "MTAnimation-TwUI"]
path = MTAnimation-TwUI
url = https://github.com/mysterioustrousers/MTAnimation-TwUI
199 changes: 44 additions & 155 deletions ExampleProject/Example.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion ExampleProject/Example/Example-Prefix.pch
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
//

#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#import <Cocoa/Cocoa.h>
#import <AtoZ/AtoZ.h>
#endif
3 changes: 2 additions & 1 deletion ExampleProject/Example/ExampleAppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
*/

#import <Cocoa/Cocoa.h>
#import "TUIKit.h"
//#import "TUIKit.h"
#import <AtoZ/AtoZ.h>

@interface ExampleAppDelegate : NSObject <NSApplicationDelegate>
{
Expand Down
3 changes: 2 additions & 1 deletion ExampleProject/Example/ExampleScrollView.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
limitations under the License.
*/

#import "TUIKit.h"
//#import "TUIKit.h"
#import <AtoZ/AtoZ.h>
#import "ExampleTabBar.h"

@interface ExampleScrollView : TUIView
Expand Down
3 changes: 1 addition & 2 deletions ExampleProject/Example/ExampleSectionHeaderView.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#import <Cocoa/Cocoa.h>

#import "TUIKit.h"
//#import "TUIKit.h"

@interface ExampleSectionHeaderView : TUITableViewSectionHeader {

Expand Down
4 changes: 2 additions & 2 deletions ExampleProject/Example/ExampleTabBar.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
limitations under the License.
*/

#import "TUIKit.h"

//#import "TUIKit.h"
#import <AtoZ/AtoZ.h>
@class ExampleTabBar;

@protocol ExampleTabBarDelegate <NSObject>
Expand Down
11 changes: 6 additions & 5 deletions ExampleProject/Example/ExampleTabBar.m
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,10 @@ - (void)cancelTrackingWithEvent:(NSEvent *)event {
// When the tab is tapped with two fingers, let it pulse, otherwise
// do nothing. To let it pulse, use the selected property and toggle it.
- (void)touchesBeganWithEvent:(NSEvent *)event {
if([self touchesMatchingPhase:NSTouchPhaseTouching forEvent:event].count != 2)
return;

// if([self touchesMatchingPhase:NSTouchPhaseTouching forEvent:event].count != 2)
// if([event touchesMatchingPhase:NSTouchPhaseTouching forEvent:event].count != 2)
// return;

// Using -redraw within an animation block lets us crossfade
// the tab selection. When we finish this animation, queue
// the pulsing with a timer set repeat the -flash method.
Expand Down Expand Up @@ -154,8 +155,8 @@ - (id)initWithNumberOfTabs:(NSUInteger)count {

for(int i = 0; i < count; ++i) {
ExampleTab *tab = [[ExampleTab alloc] initWithFrame:CGRectZero];
tab.acceptsTouchEvents = YES;
tab.wantsRestingTouches = YES;
// tab.acceptsTouchEvents = YES;
// tab.wantsRestingTouches = YES;
tab.tag = i;

// The layout of an individual tab is a function of the superview bounds,
Expand Down
2 changes: 1 addition & 1 deletion ExampleProject/Example/ExampleTableViewCell.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
limitations under the License.
*/

#import "TUIKit.h"
//#import "TUIKit.h"

@interface ExampleTableViewCell : TUITableViewCell

Expand Down
6 changes: 4 additions & 2 deletions ExampleProject/Example/ExampleTableViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
//
//

#import "TUIKit.h"
#import "TUITableOutlineView.h"
//#import "TUIKit.h"
//#import "TUITableOulineView.h"
#import <AtoZ/AtoZ.h>
//#import "TUITableOutlineView.h"

@interface ExampleTableViewController : TUIViewController <TUITableViewDelegate, TUITableViewDataSource>

Expand Down
32 changes: 17 additions & 15 deletions ExampleProject/Example/ExampleTableViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#import "ExampleTableViewController.h"
#import "ExampleSectionHeaderView.h"
#import "ExampleTableViewCell.h"
#import "TUICGAdditions.h"
//#import "TUICGAdditions.h"

@implementation ExampleTableViewController

Expand All @@ -23,15 +23,15 @@ - (void)viewDidLoad {
self.tableView.dataSource = self;
self.tableView.delegate = self;
self.tableView.allowsMultipleSelection = YES;
self.tableView.backgroundColor = [NSColor grayColor];
self.tableView.backgroundColor = GRAY2;
[self.tableView reloadData];
self.tableView.maintainContentOffsetAfterReload = YES;
self.tableView.autoresizingMask = TUIViewAutoresizingFlexibleSize;

TUILabel *footerLabel = [[TUILabel alloc] initWithFrame:CGRectMake(0, 0, _tableView.frame.size.width, 44)];
TUILabel *footerLabel = [TUILabel.alloc initWithFrame:CGRectMake(0, 0, _tableView.frame.size.width, 44)];
footerLabel.alignment = TUITextAlignmentCenter;
footerLabel.backgroundColor = [NSColor clearColor];
footerLabel.font = [NSFont fontWithName:@"HelveticaNeue-Bold" size:15];
footerLabel.font = [NSFont fontWithName:@"UbuntuMono-Bold" size:15];
footerLabel.text = @"Example Footer View";
self.tableView.footerView = footerLabel;
self.tableView.footerView.backgroundColor = [NSColor redColor];
Expand All @@ -40,7 +40,7 @@ - (void)viewDidLoad {
[reloadButton addActionForControlEvents:TUIControlEventMouseUpInside block:^{
[self.tableView reloadData];
}];
[reloadButton setImage:[NSImage imageNamed:NSImageNameRefreshTemplate] forState:TUIControlStateNormal];
[reloadButton setImage:NSIMG.randomMonoIcon forState:TUIControlStateNormal];
reloadButton.frame = CGRectMake(10, 10, 24, 24);

[self.tableView.footerView addSubview:reloadButton];
Expand All @@ -51,27 +51,27 @@ - (void)viewDidLoad {
- (NSInteger)numberOfSectionsInTableView:(TUITableView *)tableView {
return 8;
}

static AZIndexedObjects *set = nil;
- (NSInteger)tableView:(TUITableView *)table numberOfRowsInSection:(NSInteger)section {
// return 5;
// NSLog(@"RQ NUMS");
if ([(TUITableOutlineView *)table sectionIsOpened:section] ) {
switch (section) {
case 0: return 10;
case 1: return 4;
case 3: return 20;
default: return 5;
}
if ([(TUITableOulineView *)table sectionIsOpened:section] ) {

set = set ?: AZIndexedObjects.new;
NSN* ct = set[section];
if (!ct)
set[section] = ct = @(RAND_INT_VAL(2, 10));
return [ct integerValue];
}
return 1;
}

- (CGFloat)tableView:(TUITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 50.0;
return 30.0;
}

- (TUIView *)tableView:(TUITableView *)tableView headerViewForSection:(NSInteger)section {
return nil;

ExampleSectionHeaderView *header = [[ExampleSectionHeaderView alloc] initWithFrame:CGRectMake(0, 0, 100, 32)];
TUIAttributedString *title = [TUIAttributedString stringWithString:[NSString stringWithFormat:@"Example Section %d", (int)section]];
title.color = [NSColor blackColor];
Expand Down Expand Up @@ -219,6 +219,8 @@ - (void)tableView:(TUITableView *)tableView moveRows:(NSArray *)arrayOfIdexes to
}

-(NSIndexPath *)tableView:(TUITableView *)tableView targetIndexPathForMoveFromRowAtIndexPath:(NSIndexPath *)fromPath toProposedIndexPath:(NSIndexPath *)proposedPath {

AZLOGCMD;
// optionally revise the drag-to-reorder drop target index path by returning a different index path
// than proposedPath. if proposedPath is suitable, return that. if this method is not implemented,
// proposedPath is used by default.
Expand Down
4 changes: 2 additions & 2 deletions ExampleProject/Example/ExampleView.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
See the License for the specific language governing permissions and
limitations under the License.
*/

#import "TUIKit.h"
#import <AtoZ/AtoZ.h>
//#import "TUIKit.h"
#import "ExampleTabBar.h"

@interface ExampleView : TUIView <ExampleTabBarDelegate>
Expand Down
29 changes: 0 additions & 29 deletions ExampleProject/Example/en.lproj/Credits.rtf

This file was deleted.

2 changes: 0 additions & 2 deletions ExampleProject/Example/en.lproj/InfoPlist.strings

This file was deleted.

3 changes: 2 additions & 1 deletion ExampleProject/Example/main.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
*/

#import <Cocoa/Cocoa.h>
#import "TUIKit.h"
//#import "TUIKit.h"
//#import <AtoZ/AtoZ.h>

/*
Notes:
Expand Down
1 change: 1 addition & 0 deletions MTAnimation-TwUI
Submodule MTAnimation-TwUI added at 0da59a
Loading