Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1053 from Esri/Ting/Update-Target-vNext
Browse files Browse the repository at this point in the history
Update: Bump version number and deployment target
  • Loading branch information
yo1995 authored Apr 19, 2021
2 parents 4cd508a + 28a0f72 commit e0ca9eb
Show file tree
Hide file tree
Showing 16 changed files with 67 additions and 140 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
name: README and metadata formatting

# Controls when the action will run.
# Below triggers the workflow on pull requests to `master` or `v.next` branch.
# Below triggers the workflow on pull requests to `main` or `v.next` branch.
on:
pull_request:
branches:
- master
- main
- v.next

# A workflow run is made up of one or more jobs that can run sequentially or
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This repository contains Swift sample code demonstrating the capabilities of [Ar

![Samples app](SamplesApp.png)

The ```master``` branch of this repository contains samples configured for the latest available version of ArcGIS Runtime SDK for iOS. For samples configured for older versions of the SDK, look under the [```Releases```](https://github.com/Esri/arcgis-runtime-samples-ios/releases) tab for a specific version.
The ```main``` branch of this repository contains samples configured for the latest available version of ArcGIS Runtime SDK for iOS. For samples configured for older versions of the SDK, look under the [```Releases```](https://github.com/Esri/arcgis-runtime-samples-ios/releases) tab for a specific version.

## Features

Expand All @@ -25,11 +25,11 @@ The ```master``` branch of this repository contains samples configured for the l

## Requirements

* [ArcGIS Runtime SDK for iOS](https://developers.arcgis.com/ios/) 100.10.0 (or newer)
* [ArcGIS Runtime Toolkit for iOS](https://github.com/Esri/arcgis-runtime-toolkit-ios) 100.10.0 (or newer)
* [ArcGIS Runtime SDK for iOS](https://developers.arcgis.com/ios/) 100.11.0 (or newer)
* [ArcGIS Runtime Toolkit for iOS](https://github.com/Esri/arcgis-runtime-toolkit-ios) 100.11.0 (or newer)
* Xcode 12.0 (or newer)

The *ArcGIS Runtime SDK Samples app* has a *Target SDK* version of *12.0*, meaning that it can run on devices with *iOS 12.0* or newer.
The *ArcGIS Runtime SDK Samples app* has a *Target SDK* version of *13.0*, meaning that it can run on devices with *iOS 13.0* or newer.

## Building samples using installed SDK

Expand Down Expand Up @@ -87,7 +87,7 @@ Note: Without licensing or licensing with invalid keys do not throw an exception

Visit the developer's website to learn more about [Licensing your ArcGIS Runtime App](https://developers.arcgis.com/pricing/licensing/) and [Security and authentication](https://developers.arcgis.com/documentation/mapping-apis-and-location-services/security-and-authentication/).

To learn more about `masquerade`, consult the [documentation](https://github.com/Esri/data-collection-ios/tree/master/docs#masquerade) of Esri's Data Collection app.
To learn more about `masquerade`, consult the [documentation](https://github.com/Esri/data-collection-ios/tree/main/docs#masquerade) of Esri's Data Collection app.

## Additional Resources

Expand Down Expand Up @@ -119,4 +119,4 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

A copy of the license is available in the repository's [LICENSE](https://github.com/Esri/arcgis-runtime-samples-ios/blob/master/LICENSE) file.
A copy of the license is available in the repository's [LICENSE](https://github.com/Esri/arcgis-runtime-samples-ios/blob/main/LICENSE) file.
10 changes: 6 additions & 4 deletions arcgis-ios-sdk-samples.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -5565,7 +5565,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -5616,7 +5616,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
Expand All @@ -5639,11 +5639,12 @@
EMBED_ASSET_PACKS_IN_PRODUCT_BUNDLE = YES;
ENABLE_BITCODE = YES;
INFOPLIST_FILE = "arcgis-ios-sdk-samples/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 100.10.0;
MARKETING_VERSION = 100.11.0;
OTHER_LDFLAGS = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = "com.esri.arcgis-ios-sdk-samples";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -5667,11 +5668,12 @@
EMBED_ASSET_PACKS_IN_PRODUCT_BUNDLE = YES;
ENABLE_BITCODE = YES;
INFOPLIST_FILE = "arcgis-ios-sdk-samples/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 100.10.0;
MARKETING_VERSION = 100.11.0;
OTHER_LDFLAGS = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = "com.esri.arcgis-ios-sdk-samples";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
51 changes: 20 additions & 31 deletions arcgis-ios-sdk-samples/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele
var categoryBrowserViewController: ContentCollectionViewController {
return (splitViewController.viewControllers.first as! UINavigationController).viewControllers.first as! ContentCollectionViewController
}

func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
if url.absoluteString.range(of: "auth", options: [], range: nil, locale: nil) != nil {
AGSApplicationDelegate.shared().application(app, open: url, options: options)
}
return true
}


func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
// Override point for customization after application launch.
let splitViewController = self.window!.rootViewController as! UISplitViewController
Expand Down Expand Up @@ -60,26 +53,26 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele

return true
}

func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}

func applicationDidEnterBackground(_ application: UIApplication) {
// 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.
}

func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
self.setTouchPref()
}

func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
Expand All @@ -101,25 +94,21 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele
// MARK: - Appearance modification

func modifyAppearance() {
let navigationBarAppearance = UINavigationBarAppearance()
navigationBarAppearance.configureWithTransparentBackground()
navigationBarAppearance.largeTitleTextAttributes = [.foregroundColor: UIColor.white]
navigationBarAppearance.titleTextAttributes = [.foregroundColor: UIColor.white]
navigationBarAppearance.backgroundColor = .accentColor

let navigationBarAppearanceProxy = UINavigationBar.appearance()
if #available(iOS 13.0, *) {
let navigationBarAppearance = UINavigationBarAppearance()
navigationBarAppearance.configureWithTransparentBackground()
navigationBarAppearance.largeTitleTextAttributes = [.foregroundColor: UIColor.white]
navigationBarAppearance.titleTextAttributes = [.foregroundColor: UIColor.white]
navigationBarAppearance.backgroundColor = .accentColor

navigationBarAppearanceProxy.standardAppearance = navigationBarAppearance
navigationBarAppearanceProxy.compactAppearance = navigationBarAppearance
navigationBarAppearanceProxy.scrollEdgeAppearance = navigationBarAppearance
} else {
navigationBarAppearanceProxy.largeTitleTextAttributes = [.foregroundColor: UIColor.white]
navigationBarAppearanceProxy.titleTextAttributes = [.foregroundColor: UIColor.white]
navigationBarAppearanceProxy.barTintColor = .accentColor
}
UISwitch.appearance().onTintColor = .accentColor
navigationBarAppearanceProxy.standardAppearance = navigationBarAppearance
navigationBarAppearanceProxy.compactAppearance = navigationBarAppearance
navigationBarAppearanceProxy.scrollEdgeAppearance = navigationBarAppearance
navigationBarAppearanceProxy.tintColor = .white

UISwitch.appearance().onTintColor = .accentColor
UIView.appearance(whenContainedInInstancesOf: [UIAlertController.self]).tintColor = .accentColor

if #available(iOS 14.0, *) {
// Nothing to do! iOS 14 handles global tint with accent color.
} else {
Expand All @@ -131,9 +120,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele
UIButton.appearance(whenContainedInInstancesOf: [AGSCallout.self]).tintColor = .accentColor
}
}

// MARK: - Split view

func splitViewController(_ splitViewController: UISplitViewController, collapseSecondary secondaryViewController: UIViewController, onto primaryViewController: UIViewController) -> Bool {
if secondaryViewController.restorationIdentifier == "DetailNavigationController" {
return true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ class NavigateARNavigatorViewController: UIViewController {
@IBAction func startTurnByTurn(_ sender: UIBarButtonItem) {
routeTracker = AGSRouteTracker(routeResult: routeResult, routeIndex: 0, skipCoincidentStops: true)
if routeTask.routeTaskInfo().supportsRerouting {
routeTracker?.enableRerouting(with: routeTask, routeParameters: routeParameters, strategy: .toNextStop, visitFirstStopOnStart: true ) { [weak self] (error: Error?) in
let reroutingParameters = AGSReroutingParameters(routeTask: routeTask, routeParameters: routeParameters)!
routeTracker?.enableRerouting(with: reroutingParameters) { [weak self] error in
if let error = error {
self?.presentAlert(error: error)
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class IntegratedWindowsAuthenticationPortalMapBrowserViewController: UITableView

/// Shows an activity indicator in the center of the table view.
func showActivityIndicator() {
let activityIndicatorView = UIActivityIndicatorView(style: .gray)
let activityIndicatorView = UIActivityIndicatorView(style: .medium)
activityIndicatorView.translatesAutoresizingMaskIntoConstraints = false
activityIndicatorView.startAnimating()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,7 @@ class SearchForWebmapByKeywordViewController: UICollectionViewController {

(navigationItem.rightBarButtonItem as! SourceCodeBarButtonItem).filenames = ["SearchForWebmapByKeywordViewController", "WebMapCell", "WebMapViewController"]

if #available(iOS 13, *) {
// for iOS 13 this must be added in viewDidLoad
// for iOS 12, it gets added in viewDidAppear, because for iOS 12 it doesn't
// show up if added here.
addSearchController()
}
}

override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
if navigationItem.searchController == nil {
addSearchController()
}
addSearchController()
}

private func addSearchController() {
Expand All @@ -66,31 +54,11 @@ class SearchForWebmapByKeywordViewController: UICollectionViewController {
let searchBar = searchController.searchBar
searchBar.autocapitalizationType = .none

if #available(iOS 13, *) {
// Change the backgroundColor to differentiate from nav bar color.
searchBar.searchTextField.backgroundColor = .tertiarySystemBackground
// Set the color of the insertion cursor as well as the text. The text is default to black color whereas the cursor is white.
searchBar.searchTextField.tintColor = .label
} else {
// This code is required to make the search bar look decent on iOS 12
// This does not work on iOS 13, where the search bar looks different.
// Different meaning - not as good as iOS 12 looks like with this fix,
// but at least acceptable and a bit better than what it would look like
// on 12 without this fix.
// Set the color of "Cancel" text, to mimic the settings on iOS 12. On iOS 13 it is default to white.
searchBar.tintColor = .white

// find the text field to customize its appearance
if let textfield = searchBar.value(forKey: "searchField") as? UITextField {
// set the color of the insertion cursor
textfield.tintColor = UIColor.darkText
if let backgroundview = textfield.subviews.first {
backgroundview.backgroundColor = UIColor.white
backgroundview.layer.cornerRadius = 12
backgroundview.clipsToBounds = true
}
}
}
// Change the backgroundColor to differentiate from nav bar color.
searchBar.searchTextField.backgroundColor = .tertiarySystemBackground
// Set the color of the insertion cursor as well as the text.
// The text is default to black color whereas the cursor is white.
searchBar.searchTextField.tintColor = .label

// embed the search bar under the title in the navigation bar
navigationItem.searchController = searchController
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,42 +44,22 @@ class ContentCollectionViewController: UICollectionViewController, UICollectionV
let searchBar = searchController.searchBar
searchBar.autocapitalizationType = .none

if #available(iOS 13, *) {
// Change the backgroundColor to differentiate from nav bar color.
searchBar.searchTextField.backgroundColor = .tertiarySystemBackground
// Set the color of the insertion cursor as well as the text. The text is default to black color whereas the cursor is white.
searchBar.searchTextField.tintColor = .label
} else {
// This code is required to make the search bar look decent on iOS 12
// This does not work on iOS 13, where the search bar looks different.
// Different meaning - not as good as iOS 12 looks like with this fix,
// but at least acceptable and a bit better than what it would look like
// on 12 without this fix.
// Set the color of "Cancel" text, to mimic the settings on iOS 12. On iOS 13 it is default to white.
searchBar.tintColor = .white

// find the text field to customize its appearance
if let textfield = searchBar.value(forKey: "searchField") as? UITextField {
// set the color of the insertion cursor
textfield.tintColor = UIColor.darkText
if let backgroundview = textfield.subviews.first {
backgroundview.backgroundColor = UIColor.white
backgroundview.layer.cornerRadius = 12
backgroundview.clipsToBounds = true
}
}
}
// Change the backgroundColor to differentiate from nav bar color.
searchBar.searchTextField.backgroundColor = .tertiarySystemBackground
// Set the color of the insertion cursor as well as the text.
// The text is default to black color whereas the cursor is white.
searchBar.searchTextField.tintColor = .label

// embed the search bar under the title in the navigation bar
navigationItem.searchController = searchController
}

// MARK: UICollectionViewDataSource

override func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return categories.count
}

override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "CategoryCell", for: indexPath) as! CategoryCell

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ private class ProgressViewController: UIViewController {
view.backgroundColor = backgroundColor(for: traitCollection.userInterfaceStyle)
}

private func backgroundColor(for userInterfaceStyle: UIUserInterfaceStyle) -> UIColor {
func backgroundColor(for userInterfaceStyle: UIUserInterfaceStyle) -> UIColor {
let backgroundColor: UIColor
switch userInterfaceStyle {
case .dark:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ class SourceCodeViewController: UIViewController, UIAdaptivePresentationControll
@IBOutlet var toolbarTitleButton: UIBarButtonItem! {
didSet {
if filenames.count <= 1 {
if #available(iOS 13.0, *) {
toolbarTitleButton.tintColor = UIColor.label
} else {
toolbarTitleButton.tintColor = UIColor.black
}
toolbarTitleButton.tintColor = .label
}
toolbarTitleButton.possibleTitles = Set(filenames)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class DownloadProgressView: UIView {
private func show() {
self.frame = UIScreen.main.bounds

if let newWindow = UIApplication.shared.keyWindow {
if let newWindow = UIApplication.shared.windows.first(where: \.isKeyWindow) {
newWindow.addSubview(self)
}
}
Expand Down
Loading

0 comments on commit e0ca9eb

Please sign in to comment.