Skip to content

Commit fb6bbb9

Browse files
committed
Initial Commit
0 parents  commit fb6bbb9

36 files changed

+272
-0
lines changed

IBAppDelegate.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#import <UIKit/UIKit.h>
2+
3+
@interface IBAppDelegate : UIResponder <UIApplicationDelegate>
4+
5+
@property (nonatomic, strong) UIWindow *window;
6+
@property (nonatomic, strong) UINavigationController *rootViewController;
7+
8+
@end

IBAppDelegate.m

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#import "IBAppDelegate.h"
2+
#import "IBRootViewController.h"
3+
4+
@implementation IBAppDelegate
5+
6+
- (void)applicationDidFinishLaunching:(UIApplication *)application {
7+
_window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
8+
_rootViewController = [[UINavigationController alloc] initWithRootViewController:[[IBRootViewController alloc] init]];
9+
_window.rootViewController = _rootViewController;
10+
[_window makeKeyAndVisible];
11+
}
12+
13+
@end

IBRootViewController.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#import <UIKit/UIKit.h>
2+
3+
@interface IBRootViewController : UITableViewController
4+
5+
@end

IBRootViewController.m

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#import "IBRootViewController.h"
2+
3+
@interface IBRootViewController ()
4+
@property (nonatomic, strong) NSMutableArray * objects;
5+
@end
6+
7+
@implementation IBRootViewController
8+
9+
- (void)loadView {
10+
[super loadView];
11+
12+
_objects = [NSMutableArray array];
13+
14+
self.title = @"WiFi List";
15+
self.navigationItem.leftBarButtonItem = self.editButtonItem;
16+
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(addButtonTapped:)];
17+
}
18+
19+
- (void)addButtonTapped:(id)sender {
20+
[_objects insertObject:[NSDate date] atIndex:0];
21+
[self.tableView insertRowsAtIndexPaths:@[ [NSIndexPath indexPathForRow:0 inSection:0] ] withRowAnimation:UITableViewRowAnimationAutomatic];
22+
}
23+
24+
#pragma mark - Table View Data Source
25+
26+
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
27+
return 1;
28+
}
29+
30+
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
31+
return _objects.count;
32+
}
33+
34+
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
35+
static NSString *CellIdentifier = @"Cell";
36+
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
37+
38+
if (!cell) {
39+
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
40+
}
41+
42+
NSDate *date = _objects[indexPath.row];
43+
cell.textLabel.text = date.description;
44+
return cell;
45+
}
46+
47+
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
48+
[_objects removeObjectAtIndex:indexPath.row];
49+
[tableView deleteRowsAtIndexPaths:@[ indexPath ] withRowAnimation:UITableViewRowAnimationAutomatic];
50+
}
51+
52+
#pragma mark - Table View Delegate
53+
54+
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
55+
[tableView deselectRowAtIndexPath:indexPath animated:YES];
56+
}
57+
58+
@end

Makefile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
THEOS_DEVICE_IP = 192.168.1.31
2+
3+
TARGET = iphone:13.3:12.0
4+
5+
export GO_EASY_ON_ME=1
6+
ARCHS = arm64 arm64e
7+
8+
INSTALL_TARGET_PROCESSES = WiFiList
9+
10+
include $(THEOS)/makefiles/common.mk
11+
12+
APPLICATION_NAME = WiFiList
13+
14+
WiFiList_FILES = main.m IBAppDelegate.m IBRootViewController.m
15+
WiFiList_FRAMEWORKS = UIKit CoreGraphics
16+
WiFiList_PRIVATE_FRAMEWORKS = MobileWiFi
17+
WiFiList_CFLAGS = -fobjc-arc
18+
19+
include $(THEOS_MAKE_PATH)/application.mk

Resources/AppIcon29x29.png

Loading

Resources/[email protected]

Loading

Resources/[email protected]

Loading

Resources/AppIcon40x40.png

Loading

Resources/[email protected]

Loading

0 commit comments

Comments
 (0)