Skip to content

Commit

Permalink
Autolaout constraint fixes. Metrics added.
Browse files Browse the repository at this point in the history
  • Loading branch information
tyburg committed Oct 18, 2024
1 parent b604945 commit 7ed981d
Show file tree
Hide file tree
Showing 20 changed files with 228 additions and 21 deletions.
1 change: 1 addition & 0 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ target 'mapcache-ios' do
pod 'geopackage-ios', '~> 8.0.4'
pod 'mgrs-ios', '~> 1.1.5'
pod 'gars-ios', '~> 1.1.4'
pod 'MatomoTracker', '~> 7.5'
end
20 changes: 16 additions & 4 deletions mapcache-ios.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
E3B7DD502475F1ED00215EF5 /* MCCreateLayerFieldViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E3B7DD4C2475F1EB00215EF5 /* MCCreateLayerFieldViewController.swift */; };
E3B7DD512475F1ED00215EF5 /* MCLayerCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = E3B7DD4E2475F1EC00215EF5 /* MCLayerCoordinator.swift */; };
E3B9753B1FB3DED400E33E0A /* MCHeaderCellDisplay.xib in Resources */ = {isa = PBXBuildFile; fileRef = E3B9753A1FB3DED400E33E0A /* MCHeaderCellDisplay.xib */; };
E3BD0DCB2CAB12A600AF6387 /* MCMetrics.swift in Sources */ = {isa = PBXBuildFile; fileRef = E3BD0DCA2CAB12A600AF6387 /* MCMetrics.swift */; };
E3BED1E0219116FA001AF654 /* MCSettingsCoordinator.m in Sources */ = {isa = PBXBuildFile; fileRef = E3BED1DF219116FA001AF654 /* MCSettingsCoordinator.m */; };
E3BED1E321911712001AF654 /* MCSettingsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E3BED1E221911712001AF654 /* MCSettingsViewController.m */; };
E3C5FC4824B7D38F00B5E12E /* MCTileMatrix.swift in Sources */ = {isa = PBXBuildFile; fileRef = E3C5FC4724B7D38F00B5E12E /* MCTileMatrix.swift */; };
Expand Down Expand Up @@ -372,6 +373,7 @@
E3B7DD4E2475F1EC00215EF5 /* MCLayerCoordinator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MCLayerCoordinator.swift; sourceTree = "<group>"; };
E3B7DD4F2475F1EC00215EF5 /* MCLayerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MCLayerViewController.m; sourceTree = "<group>"; };
E3B9753A1FB3DED400E33E0A /* MCHeaderCellDisplay.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MCHeaderCellDisplay.xib; sourceTree = "<group>"; };
E3BD0DCA2CAB12A600AF6387 /* MCMetrics.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MCMetrics.swift; sourceTree = "<group>"; };
E3BED1DE219116FA001AF654 /* MCSettingsCoordinator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCSettingsCoordinator.h; sourceTree = "<group>"; };
E3BED1DF219116FA001AF654 /* MCSettingsCoordinator.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MCSettingsCoordinator.m; sourceTree = "<group>"; };
E3BED1E121911712001AF654 /* MCSettingsViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCSettingsViewController.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -496,6 +498,7 @@
044648161B4C20360052913B /* manager */,
044648151B4C1A8D0052913B /* data */,
E3BED1DD219116C3001AF654 /* settings */,
E3BD0DC92CAB128D00AF6387 /* metrics */,
040136761AF94FB200C92AFC /* AppDelegate.h */,
040136771AF94FB200C92AFC /* AppDelegate.m */,
0401367F1AF94FB200C92AFC /* Main.storyboard */,
Expand Down Expand Up @@ -877,6 +880,14 @@
path = EditCells;
sourceTree = "<group>";
};
E3BD0DC92CAB128D00AF6387 /* metrics */ = {
isa = PBXGroup;
children = (
E3BD0DCA2CAB12A600AF6387 /* MCMetrics.swift */,
);
path = metrics;
sourceTree = "<group>";
};
E3BED1DD219116C3001AF654 /* settings */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -1223,6 +1234,7 @@
E33F557F1FCC956A00F252FD /* MCButtonCell.m in Sources */,
E3E4C435252CF77F0083635F /* MCTileServer.swift in Sources */,
04CCC85F1B60225C0001296D /* GPKGSKeyboardConstraint.m in Sources */,
E3BD0DCB2CAB12A600AF6387 /* MCMetrics.swift in Sources */,
040136781AF94FB200C92AFC /* AppDelegate.m in Sources */,
E3500E6322B4653B00164ABF /* MCDisclaimerViewController.m in Sources */,
044648021B4AF4250052913B /* MCTableTypes.m in Sources */,
Expand Down Expand Up @@ -1435,7 +1447,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 58;
CURRENT_PROJECT_VERSION = 59;
DEVELOPMENT_TEAM = ZL8G5D9G2H;
ENABLE_TESTABILITY = YES;
GCC_NO_COMMON_BLOCKS = YES;
Expand All @@ -1445,7 +1457,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.6.1;
MARKETING_VERSION = 2.6.2;
PRODUCT_BUNDLE_IDENTIFIER = mil.nga.mapcache;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
Expand All @@ -1464,7 +1476,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 58;
CURRENT_PROJECT_VERSION = 59;
DEVELOPMENT_TEAM = ZL8G5D9G2H;
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = "mapcache-ios/Info.plist";
Expand All @@ -1473,7 +1485,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.6.1;
MARKETING_VERSION = 2.6.2;
PRODUCT_BUNDLE_IDENTIFIER = mil.nga.mapcache;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
Expand Down
3 changes: 3 additions & 0 deletions mapcache-ios/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
_geoPackages = [[GPKGGeoPackageCache alloc] initWithManager:self.manager];
_tileServerRepository = [MCTileServerRepository shared];

[[MCMetrics shared] appLaunch];

return YES;
}

Expand All @@ -79,6 +81,7 @@ - (void)applicationWillResignActive:(UIApplication *)application {
- (void)applicationDidEnterBackground:(UIApplication *)application {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
[[MCMetrics shared] dispatch];
}

- (void)applicationWillEnterForeground:(UIApplication *)application {
Expand Down
7 changes: 7 additions & 0 deletions mapcache-ios/geopackage/MCCreateGeoPacakgeViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

#import "MCCreateGeoPacakgeViewController.h"
#import "mapcache_ios-Swift.h"

@interface MCCreateGeoPacakgeViewController ()
@property (nonatomic, strong) NSMutableArray *cellArray;
Expand Down Expand Up @@ -49,6 +50,12 @@ - (void)viewDidLoad {
}


- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
[[MCMetrics shared] newGeoPackage];
}


- (void) initCellArray {
_cellArray = [[NSMutableArray alloc] init];

Expand Down
2 changes: 2 additions & 0 deletions mapcache-ios/geopackage/MCGeoPackageList.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

#import "MCGeoPackageList.h"
#import "mapcache_ios-Swift.h"

@interface MCGeoPackageList()
@property (strong, nonatomic) NSMutableArray *childCoordinators;
Expand Down Expand Up @@ -56,6 +57,7 @@ - (void) viewWillAppear:(BOOL)animated {
- (void) viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
[self showSwipeHelp];
[[MCMetrics shared] showGeoPackageList];
}


Expand Down
7 changes: 7 additions & 0 deletions mapcache-ios/geopackage/MCGeopackageSingleViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

#import "MCGeopackageSingleViewController.h"
#import "mapcache_ios-Swift.h"

@interface MCGeopackageSingleViewController ()
@property (nonatomic, strong) NSMutableArray *cellArray;
Expand Down Expand Up @@ -55,6 +56,12 @@ - (void) viewDidLoad {
}


- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
[[MCMetrics shared] geoPackageDetails];
}


- (void) didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ - (void) viewDidLoad {
} else {
[self.layerButton setHidden:YES];
}

[[MCMetrics shared] tileLayerBoundingBox];
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

#import "MCFeatureLayerDetailsViewController.h"
#import "mapcache_ios-Swift.h"

@interface MCFeatureLayerDetailsViewController ()
@property (strong, nonatomic) NSMutableArray *cellArray;
Expand Down Expand Up @@ -53,6 +54,8 @@ - (void)viewDidLoad {
self.tableView.separatorStyle = UIAccessibilityTraitNone;
[self.view addSubview:self.tableView];
[self addCloseButton];

[[MCMetrics shared] featureLayerDetails];
}

- (void)didReceiveMemoryWarning {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ - (void)viewDidLoad {
[self addAndConstrainSubview:self.tableView];
[self addDragHandle];
[self addCloseButton];

[[MCMetrics shared] tileLayerChooseServer];
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ - (void)viewDidLoad {
[self.view addSubview:self.tableView];
[self addDragHandle];
[self addCloseButton];

[[MCMetrics shared] tileLayerDetails];
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

#import "MCTileServerHelpViewController.h"
#import "mapcache_ios-Swift.h"

@interface MCTileServerHelpViewController ()
@property (nonatomic, strong) NSMutableArray *cellArray;
Expand Down Expand Up @@ -40,6 +41,7 @@ - (void)viewDidLoad {
[self.view addSubview:self.tableView];
// [self addDragHandle];
// [self addCloseButton];
[[MCMetrics shared] newServerHelp];
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

#import "MCZoomAndQualityViewController.h"
#import "mapcache_ios-Swift.h"

@interface MCZoomAndQualityViewController ()
@property (nonatomic, strong) UITableView *tableView;
Expand Down Expand Up @@ -50,6 +51,7 @@ - (void)viewDidLoad {
[self addDragHandle];
[self addCloseButton];

[[MCMetrics shared] tileLayerZoomSettings];
// Uncomment the following line to preserve selection between presentations.
// self.clearsSelectionOnViewWillAppear = NO;
}
Expand Down
10 changes: 10 additions & 0 deletions mapcache-ios/layer/MCLayerViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,16 @@ - (void)viewDidLoad {
}


- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
if(_featureTable != nil) {
[[MCMetrics shared] featureLayerDetails];
} else {
[[MCMetrics shared] tileLayerDetails];
}
}


- (void) registerCellTypes {
[self.tableView registerNib:[UINib nibWithNibName:@"MCHeaderCellDisplay" bundle:nil] forCellReuseIdentifier:@"header"];
[self.tableView registerNib:[UINib nibWithNibName:@"MCFeatureLayerOperationsCell" bundle:nil] forCellReuseIdentifier:@"featureButtons"];
Expand Down
6 changes: 6 additions & 0 deletions mapcache-ios/map/MCMapPointAttachmentViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ class MCMapPointAttachmentViewController: NGADrawerViewController, UITableViewDe
}


override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
MCMetrics.shared.viewFeatureAttachment()
}


func registerCellTypes() {
self.tableView.register(UINib.init(nibName: "MCImageCell", bundle: nil), forCellReuseIdentifier: "image")
self.tableView.register(UINib.init(nibName: "MCDualButtonCell", bundle: nil), forCellReuseIdentifier: "dualButtons")
Expand Down
4 changes: 3 additions & 1 deletion mapcache-ios/map/MCMapPointDataViewController.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//
//
// MCMapPointDataViewController.m
// mapcache-ios
//
Expand Down Expand Up @@ -90,8 +90,10 @@ - (void)viewDidAppear:(BOOL)animated {

if (self.mode == MCPointViewModeEdit) {
[self showEditMode];
[[MCMetrics shared] newFeature];
} else {
[self showDisplayMode];
[[MCMetrics shared] showFeature];
}
}

Expand Down
11 changes: 7 additions & 4 deletions mapcache-ios/map/MCMapViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ - (void)viewDidLoad {

self.bookmarkOverlay = [[MKTileOverlay alloc] init];
[self.mapView addOverlay:_bookmarkOverlay];

[[MCMetrics shared] showMap];
}

- (void) viewWillAppear:(BOOL)animated {
Expand Down Expand Up @@ -782,10 +784,11 @@ -(void) updateInBackgroundWithZoom: (BOOL) zoom andFilter: (BOOL) filter{
GPKGGeoPackage *geoPacakge;
@try {
geoPacakge = [self.manager open:database.name];
[self.tileHelper prepareTilesForGeoPackage:geoPacakge andDatabase:database];

[self.featureHelper prepareFeaturesWithGeoPackage:geoPacakge andDatabase:database andUpdateId: (int)updateId andFeatureUpdateId: (int)featureUpdateId andZoom: (int)zoom andMaxFeatures: (int)maxFeatures andMapViewBoundingBox: (GPKGBoundingBox *)mapViewBoundingBox andToleranceDistance: (double)toleranceDistance andFilter:(BOOL) filter];

if(geoPacakge != nil) {
[self.tileHelper prepareTilesForGeoPackage:geoPacakge andDatabase:database];

[self.featureHelper prepareFeaturesWithGeoPackage:geoPacakge andDatabase:database andUpdateId: (int)updateId andFeatureUpdateId: (int)featureUpdateId andZoom: (int)zoom andMaxFeatures: (int)maxFeatures andMapViewBoundingBox: (GPKGBoundingBox *)mapViewBoundingBox andToleranceDistance: (double)toleranceDistance andFilter:(BOOL) filter];
}
} @catch (NSException *exception) {
NSLog(@"MCMapController - Error reading geopackage %@, error: %@", database, [exception description]);
}
Expand Down
Loading

0 comments on commit 7ed981d

Please sign in to comment.