From 35310e33ea0ec419ff7b9234805a9e45844be0dd Mon Sep 17 00:00:00 2001 From: Apple <> Date: Wed, 17 Jun 2020 11:00:09 -0800 Subject: [PATCH] Upgrade for iOS 14 --- LICENSE/LICENSE.txt | 0 README.md | 50 +++- UIKitCatalog.xcodeproj/project.pbxproj | 282 ++++++++++++------ .../ActivityIndicatorViewController.swift | 0 .../AlertControllerViewController.swift | 0 UIKitCatalog/AppDelegate.swift | 22 +- .../AppIcon.appiconset/Contents.json | 0 UIKitCatalog/Assets.xcassets/Contents.json | 0 .../Flowers_1.imageset/Contents.json | 0 .../Flowers_1.imageset/Flowers_1.png | Bin .../Flowers_2.imageset/Contents.json | 0 .../Flowers_2.imageset/Flowers_2.png | Bin .../Contents.json | 0 .../search_bar_background_3x.png | Bin .../search_bar_bg_1x.png | Bin .../search_bar_bg_2x.png | Bin .../slider_blue_track.imageset/Contents.json | 0 .../slider_blue_track_1x.png | Bin .../slider_blue_track_2x.png | Bin .../slider_blue_track_3x.png | Bin .../slider_green_track.imageset/Contents.json | 0 .../slider_green_track_1x.png | Bin .../slider_green_track_2x.png | Bin .../slider_green_track_3x.png | Bin .../Contents.json | 0 .../stepper_and_segment_background_1x.png | Bin .../stepper_and_segment_background_2x.png | Bin .../stepper_and_segment_background_3x.png | Bin .../Contents.json | 0 ...per_and_segment_background_disabled_1x.png | Bin ...per_and_segment_background_disabled_2x.png | Bin ...per_and_segment_background_disabled_3x.png | Bin .../Contents.json | 0 ..._and_segment_background_highlighted_1x.png | Bin ..._and_segment_background_highlighted_2x.png | Bin ..._and_segment_background_highlighted_3x.png | Bin .../Contents.json | 0 .../stepper_and_segment_divider_3x.png | Bin ...stepper_and_segment_segment_divider_1x.png | Bin ...stepper_and_segment_segment_divider_2x.png | Bin .../stepper_decrement.imageset/Contents.json | 0 .../decrement_1x.png | Bin .../decrement_2x.png | Bin .../stepper_decrement_3x.png | Bin .../stepper_increment.imageset/Contents.json | 0 .../increment_1x.png | Bin .../increment_2x.png | Bin .../stepper_increment_3x.png | Bin .../Contents.json | 0 .../increment_disabled_1x.png | Bin .../increment_disabled_2x.png | Bin .../stepper_increment_disabled_3x.png | Bin .../Contents.json | 0 .../increment_highlighted_1x.png | Bin .../increment_highlighted_2x.png | Bin .../stepper_increment_highlighted_3x.png | Bin .../Contents.json | 0 .../text_field_background_1x.png | Bin .../text_field_background_2x.png | Bin .../text_field_background_3x.png | Bin .../Contents.json | 0 .../text_field_purple_right_view_1x.png | Bin .../text_field_purple_right_view_2x.png | Bin .../text_field_purple_right_view_3x.png | Bin .../Contents.json | 0 .../Sunset_5.png | Bin .../Contents.json | 0 .../Contents.json | 0 .../Contents.json | 0 .../toolbar_background.imageset/Contents.json | 0 .../toolbar_background_1x.png | Bin .../toolbar_background_2x.png | Bin .../toolbar_background_3x.png | Bin .../x_icon.imageset/Contents.json | 0 .../x_icon.imageset/x_icon_1x.png | Bin .../x_icon.imageset/x_icon_2x.png | Bin .../x_icon.imageset/x_icon_3x.png | Bin ...ActivityIndicatorViewController.storyboard | 0 .../AlertControllerViewController.storyboard | 0 .../ButtonViewController.storyboard | 45 ++- .../ColorPickerViewController.storyboard | 60 ++++ UIKitCatalog/Base.lproj/Credits.rtf | 4 +- ...CustomPageControlViewController.storyboard | 59 ++++ .../CustomSearchBarViewController.storyboard | 50 ++++ .../CustomToolbarViewController.storyboard | 49 +++ .../DatePickerController.storyboard | 25 +- ...efaultPageControlViewController.storyboard | 59 ++++ .../DefaultSearchBarViewController.storyboard | 54 ++++ .../DefaultToolbarViewController.storyboard | 49 +++ .../FontPickerViewController.storyboard | 62 ++++ .../ImagePickerViewController.storyboard | 59 ++++ .../Base.lproj/ImageViewController.storyboard | 0 UIKitCatalog/Base.lproj/InfoPlist.strings | 4 +- .../Base.lproj/LaunchScreen.storyboard | 10 +- UIKitCatalog/Base.lproj/Localizable.strings | 47 ++- UIKitCatalog/Base.lproj/Main.storyboard | 186 +++++------- .../PageControlViewController.storyboard | 53 ---- .../PickerViewController.storyboard | 22 +- .../ProgressViewController.storyboard | 0 .../SearchViewControllers.storyboard | 230 -------------- .../SegmentedControlViewController.storyboard | 51 +++- .../SliderViewController.storyboard | 0 .../Base.lproj/StackViewController.storyboard | 0 .../StepperViewController.storyboard | 0 .../SwitchViewController.storyboard | 0 .../TextFieldViewController.storyboard | 0 .../Base.lproj/TextViewController.storyboard | 0 .../TintedToolbarViewController.storyboard | 49 +++ .../ToolbarViewControllers.storyboard | 204 ------------- .../Base.lproj/WebViewController.storyboard | 0 UIKitCatalog/Base.lproj/content.html | 0 UIKitCatalog/BaseTableViewController.swift | 114 ------- UIKitCatalog/ButtonViewController.swift | 18 ++ UIKitCatalog/ColorPickerViewController.swift | 66 ++++ .../CustomPageControlViewController.swift | 92 ++++++ .../CustomSearchBarViewController.swift | 0 .../CustomToolbarViewController.swift | 0 UIKitCatalog/DatePickerController.swift | 11 + ...=> DefaultPageControlViewController.swift} | 2 +- .../DefaultSearchBarViewController.swift | 0 .../DefaultToolbarViewController.swift | 14 +- UIKitCatalog/DetailViewManager.swift | 76 ----- UIKitCatalog/FontPickerViewController.swift | 54 ++++ UIKitCatalog/ImagePickerViewController.swift | 45 +++ UIKitCatalog/ImageViewController.swift | 0 UIKitCatalog/MasterViewController.swift | 92 ------ UIKitCatalog/OutlineViewController.swift | 259 ++++++++++++++++ UIKitCatalog/PickerViewController.swift | 0 UIKitCatalog/ProgressViewController.swift | 0 UIKitCatalog/SceneDelegate.swift | 74 +++++ .../SearchBarsTableViewController.swift | 30 -- .../SegmentedControlViewController.swift | 25 +- UIKitCatalog/SliderViewController.swift | 0 UIKitCatalog/StackViewController.swift | 0 UIKitCatalog/StepperViewController.swift | 2 + UIKitCatalog/SwitchViewController.swift | 0 UIKitCatalog/TextFieldViewController.swift | 0 UIKitCatalog/TextViewController.swift | 0 .../TintedToolbarViewController.swift | 0 .../ToolbarsTableViewController.swift | 31 -- UIKitCatalog/UIKitCatalog-Info.plist | 27 +- UIKitCatalog/UIKitCatalog.entitlements | 0 .../UIViewController+SizeChange.swift | 21 -- UIKitCatalog/WebViewController.swift | 0 144 files changed, 1702 insertions(+), 1136 deletions(-) mode change 100644 => 100755 LICENSE/LICENSE.txt mode change 100644 => 100755 README.md mode change 100644 => 100755 UIKitCatalog/ActivityIndicatorViewController.swift mode change 100644 => 100755 UIKitCatalog/AlertControllerViewController.swift mode change 100644 => 100755 UIKitCatalog/AppDelegate.swift mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/AppIcon.appiconset/Contents.json mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/Contents.json mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/Flowers_1.imageset/Contents.json mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/Flowers_1.imageset/Flowers_1.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/Flowers_2.imageset/Contents.json mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/Flowers_2.imageset/Flowers_2.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/search_bar_background.imageset/Contents.json mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/search_bar_background.imageset/search_bar_background_3x.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/search_bar_background.imageset/search_bar_bg_1x.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/search_bar_background.imageset/search_bar_bg_2x.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/slider_blue_track.imageset/Contents.json mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/slider_blue_track.imageset/slider_blue_track_1x.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/slider_blue_track.imageset/slider_blue_track_2x.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/slider_blue_track.imageset/slider_blue_track_3x.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/slider_green_track.imageset/Contents.json mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/slider_green_track.imageset/slider_green_track_1x.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/slider_green_track.imageset/slider_green_track_2x.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/slider_green_track.imageset/slider_green_track_3x.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/stepper_and_segment_background.imageset/Contents.json mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/stepper_and_segment_background.imageset/stepper_and_segment_background_1x.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/stepper_and_segment_background.imageset/stepper_and_segment_background_2x.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/stepper_and_segment_background.imageset/stepper_and_segment_background_3x.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/stepper_and_segment_background_disabled.imageset/Contents.json mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/stepper_and_segment_background_disabled.imageset/stepper_and_segment_background_disabled_1x.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/stepper_and_segment_background_disabled.imageset/stepper_and_segment_background_disabled_2x.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/stepper_and_segment_background_disabled.imageset/stepper_and_segment_background_disabled_3x.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/stepper_and_segment_background_highlighted.imageset/Contents.json mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/stepper_and_segment_background_highlighted.imageset/stepper_and_segment_background_highlighted_1x.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/stepper_and_segment_background_highlighted.imageset/stepper_and_segment_background_highlighted_2x.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/stepper_and_segment_background_highlighted.imageset/stepper_and_segment_background_highlighted_3x.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/stepper_and_segment_segment_divider.imageset/Contents.json mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/stepper_and_segment_segment_divider.imageset/stepper_and_segment_divider_3x.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/stepper_and_segment_segment_divider.imageset/stepper_and_segment_segment_divider_1x.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/stepper_and_segment_segment_divider.imageset/stepper_and_segment_segment_divider_2x.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/stepper_decrement.imageset/Contents.json mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/stepper_decrement.imageset/decrement_1x.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/stepper_decrement.imageset/decrement_2x.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/stepper_decrement.imageset/stepper_decrement_3x.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/stepper_increment.imageset/Contents.json mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/stepper_increment.imageset/increment_1x.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/stepper_increment.imageset/increment_2x.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/stepper_increment.imageset/stepper_increment_3x.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/stepper_increment_disabled.imageset/Contents.json mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/stepper_increment_disabled.imageset/increment_disabled_1x.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/stepper_increment_disabled.imageset/increment_disabled_2x.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/stepper_increment_disabled.imageset/stepper_increment_disabled_3x.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/stepper_increment_highlighted.imageset/Contents.json mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/stepper_increment_highlighted.imageset/increment_highlighted_1x.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/stepper_increment_highlighted.imageset/increment_highlighted_2x.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/stepper_increment_highlighted.imageset/stepper_increment_highlighted_3x.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/text_field_background.imageset/Contents.json mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/text_field_background.imageset/text_field_background_1x.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/text_field_background.imageset/text_field_background_2x.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/text_field_background.imageset/text_field_background_3x.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/text_field_purple_right_view.imageset/Contents.json mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/text_field_purple_right_view.imageset/text_field_purple_right_view_1x.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/text_field_purple_right_view.imageset/text_field_purple_right_view_2x.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/text_field_purple_right_view.imageset/text_field_purple_right_view_3x.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/text_view_attachment.imageset/Contents.json mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/text_view_attachment.imageset/Sunset_5.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/text_view_background.colorset/Contents.json mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/tinted_segmented_control.colorset/Contents.json mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/tinted_stepper_control.colorset/Contents.json mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/toolbar_background.imageset/Contents.json mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/toolbar_background.imageset/toolbar_background_1x.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/toolbar_background.imageset/toolbar_background_2x.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/toolbar_background.imageset/toolbar_background_3x.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/x_icon.imageset/Contents.json mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/x_icon.imageset/x_icon_1x.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/x_icon.imageset/x_icon_2x.png mode change 100644 => 100755 UIKitCatalog/Assets.xcassets/x_icon.imageset/x_icon_3x.png mode change 100644 => 100755 UIKitCatalog/Base.lproj/ActivityIndicatorViewController.storyboard mode change 100644 => 100755 UIKitCatalog/Base.lproj/AlertControllerViewController.storyboard mode change 100644 => 100755 UIKitCatalog/Base.lproj/ButtonViewController.storyboard create mode 100755 UIKitCatalog/Base.lproj/ColorPickerViewController.storyboard create mode 100755 UIKitCatalog/Base.lproj/CustomPageControlViewController.storyboard create mode 100755 UIKitCatalog/Base.lproj/CustomSearchBarViewController.storyboard create mode 100755 UIKitCatalog/Base.lproj/CustomToolbarViewController.storyboard mode change 100644 => 100755 UIKitCatalog/Base.lproj/DatePickerController.storyboard create mode 100755 UIKitCatalog/Base.lproj/DefaultPageControlViewController.storyboard create mode 100755 UIKitCatalog/Base.lproj/DefaultSearchBarViewController.storyboard create mode 100755 UIKitCatalog/Base.lproj/DefaultToolbarViewController.storyboard create mode 100755 UIKitCatalog/Base.lproj/FontPickerViewController.storyboard create mode 100755 UIKitCatalog/Base.lproj/ImagePickerViewController.storyboard mode change 100644 => 100755 UIKitCatalog/Base.lproj/ImageViewController.storyboard mode change 100644 => 100755 UIKitCatalog/Base.lproj/InfoPlist.strings mode change 100644 => 100755 UIKitCatalog/Base.lproj/LaunchScreen.storyboard mode change 100644 => 100755 UIKitCatalog/Base.lproj/Localizable.strings delete mode 100644 UIKitCatalog/Base.lproj/PageControlViewController.storyboard mode change 100644 => 100755 UIKitCatalog/Base.lproj/PickerViewController.storyboard mode change 100644 => 100755 UIKitCatalog/Base.lproj/ProgressViewController.storyboard delete mode 100644 UIKitCatalog/Base.lproj/SearchViewControllers.storyboard mode change 100644 => 100755 UIKitCatalog/Base.lproj/SegmentedControlViewController.storyboard mode change 100644 => 100755 UIKitCatalog/Base.lproj/SliderViewController.storyboard mode change 100644 => 100755 UIKitCatalog/Base.lproj/StackViewController.storyboard mode change 100644 => 100755 UIKitCatalog/Base.lproj/StepperViewController.storyboard mode change 100644 => 100755 UIKitCatalog/Base.lproj/SwitchViewController.storyboard mode change 100644 => 100755 UIKitCatalog/Base.lproj/TextFieldViewController.storyboard mode change 100644 => 100755 UIKitCatalog/Base.lproj/TextViewController.storyboard create mode 100755 UIKitCatalog/Base.lproj/TintedToolbarViewController.storyboard delete mode 100644 UIKitCatalog/Base.lproj/ToolbarViewControllers.storyboard mode change 100644 => 100755 UIKitCatalog/Base.lproj/WebViewController.storyboard mode change 100644 => 100755 UIKitCatalog/Base.lproj/content.html delete mode 100644 UIKitCatalog/BaseTableViewController.swift mode change 100644 => 100755 UIKitCatalog/ButtonViewController.swift create mode 100755 UIKitCatalog/ColorPickerViewController.swift create mode 100755 UIKitCatalog/CustomPageControlViewController.swift mode change 100644 => 100755 UIKitCatalog/CustomSearchBarViewController.swift mode change 100644 => 100755 UIKitCatalog/CustomToolbarViewController.swift mode change 100644 => 100755 UIKitCatalog/DatePickerController.swift rename UIKitCatalog/{PageControlViewController.swift => DefaultPageControlViewController.swift} (99%) mode change 100644 => 100755 mode change 100644 => 100755 UIKitCatalog/DefaultSearchBarViewController.swift mode change 100644 => 100755 UIKitCatalog/DefaultToolbarViewController.swift delete mode 100644 UIKitCatalog/DetailViewManager.swift create mode 100755 UIKitCatalog/FontPickerViewController.swift create mode 100755 UIKitCatalog/ImagePickerViewController.swift mode change 100644 => 100755 UIKitCatalog/ImageViewController.swift delete mode 100644 UIKitCatalog/MasterViewController.swift create mode 100755 UIKitCatalog/OutlineViewController.swift mode change 100644 => 100755 UIKitCatalog/PickerViewController.swift mode change 100644 => 100755 UIKitCatalog/ProgressViewController.swift create mode 100755 UIKitCatalog/SceneDelegate.swift delete mode 100644 UIKitCatalog/SearchBarsTableViewController.swift mode change 100644 => 100755 UIKitCatalog/SegmentedControlViewController.swift mode change 100644 => 100755 UIKitCatalog/SliderViewController.swift mode change 100644 => 100755 UIKitCatalog/StackViewController.swift mode change 100644 => 100755 UIKitCatalog/StepperViewController.swift mode change 100644 => 100755 UIKitCatalog/SwitchViewController.swift mode change 100644 => 100755 UIKitCatalog/TextFieldViewController.swift mode change 100644 => 100755 UIKitCatalog/TextViewController.swift mode change 100644 => 100755 UIKitCatalog/TintedToolbarViewController.swift delete mode 100644 UIKitCatalog/ToolbarsTableViewController.swift mode change 100644 => 100755 UIKitCatalog/UIKitCatalog-Info.plist mode change 100644 => 100755 UIKitCatalog/UIKitCatalog.entitlements delete mode 100644 UIKitCatalog/UIViewController+SizeChange.swift mode change 100644 => 100755 UIKitCatalog/WebViewController.swift diff --git a/LICENSE/LICENSE.txt b/LICENSE/LICENSE.txt old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 index ad548d7..b929055 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # UIKit Catalog: Creating and Customizing Views and Controls -Customize the user interface of your iOS apps and Mac apps built with Mac Catalyst by using views and controls in UIKit. +Customize your app's user interface with views and controls in UIKit. ## Overview -This sample guides you through several types of customizations that you can apply in your iOS apps and Mac apps built using Mac Catalyst. The sample uses a split view controller architecture for navigating UIKit views and controls. The primary view controller (`MasterViewController`) shows the available views and controls. Selecting one shows the secondary view controller associated with it. +This sample guides you through several types of customizations that you can make in your iOS app. The sample uses a split view controller architecture for navigating UIKit views and controls. The primary view controller (`MasterViewController`) shows the available views and controls. Selecting one shows the secondary view controller associated with it. -The name of each secondary view controller reflects its *target item*. For example, the `AlertControllerViewController` class shows how to use a `UIAlertController` object. The only exceptions to this rule are `UISearchBar` and `UIToolbar`; the sample demonstrates these APIs in multiple view controllers to explain how their controls function and how to customize them. To demonstrate how to manage the complexity of your storyboards, all view controllers are hosted in a separate storyboard and loaded when needed. +The name of each secondary view controller reflects its *target item*. For example, the `AlertControllerViewController` class shows how to use a `UIAlertController` object. The only exceptions to this rule are `UISearchBar` and `UIToolbar`; the sample demonstrates these APIs in multiple view controllers to explain how their controls function and how to customize them. To demonstrate how to manage the complexity of your storyboards, the app hosts all view controllers in a separate storyboard and loaded when needed. This sample demonstrates the following views and controls (several of which are referenced in the sections below): @@ -14,9 +14,12 @@ This sample demonstrates the following views and controls (several of which are * [`UIAlertController`](https://developer.apple.com/documentation/uikit/uialertcontroller) * [`UIButton`](https://developer.apple.com/documentation/uikit/uibutton) * [`UIDatePicker`](https://developer.apple.com/documentation/uikit/uidatepicker) +* [`UIPickerView`](https://developer.apple.com/documentation/uikit/uipickerview) +* [`UIColorPickerViewController`](https://developer.apple.com/documentation/uikit/uicolorpickerviewcontroller) +* [`UIFontPickerViewController`](https://developer.apple.com/documentation/uikit/uifontpickerviewcontroller) +* [`UIImagePickerViewController`](https://developer.apple.com/documentation/uikit/uiimagepickercontroller) * [`UIImageView`](https://developer.apple.com/documentation/uikit/uiimageview) * [`UIPageControl`](https://developer.apple.com/documentation/uikit/uipagecontrol) -* [`UIPickerView`](https://developer.apple.com/documentation/uikit/uipickerview) * [`UIProgressView`](https://developer.apple.com/documentation/uikit/uiprogressview) * [`UISearchBar`](https://developer.apple.com/documentation/uikit/uisearchbar) * [`UISegmentedControl`](https://developer.apple.com/documentation/uikit/uisegmentedcontrol) @@ -60,7 +63,7 @@ func pickerView(_ pickerView: UIPickerView, accessibilityLabelForComponent compo 3. Add handlers for actions that the user may take. 4. Present the alert controller. -The `showSimpleAlert` function uses the `NSLocalizedString` function to retrieve the alert messages in the user’s preferred language. This function uses those strings to create and configure the `UIAlertController` object. Although the button in the alert has the title OK, the sample uses a cancel action to ensure that the alert controller applies the proper styling to the button: +The `showSimpleAlert` function uses the `NSLocalizedString` function to retrieve the alert messages in the user’s preferred language. The `showSimpleAlert` function uses those strings to create and configure the `UIAlertController` object. Although the button in the alert has the title OK, the sample uses a cancel action to ensure that the alert controller applies the proper styling to the button: ``` swift func showSimpleAlert() { @@ -84,7 +87,7 @@ func showSimpleAlert() { ## Customize the Appearance of Sliders -This sample demonstrates different ways to display a `UISlider`, a control used to select a single value from a continuous range of values. You customize the appearance of a slider by assigning stretchable images for left-side tracking, right-side tracking, and the thumb. In this example, the track image is stretchable and is one pixel wide. Make the track images wider to provide rounded corners, but be sure to set these images' `capInsets` property to allow room for the corners. +This sample demonstrates different ways to display a `UISlider`, a control used to select a single value from a continuous range of values. You customize the appearance of a slider by assigning stretchable images for left-side tracking, right-side tracking, and the thumb. In this example, the track image is stretchable and is one pixel wide. Make the track images wider to provide rounded corners, but be sure to set these images' `capInsets` property to allow for the corners. The `configureCustomSlider` function sets up a custom slider: @@ -200,7 +203,40 @@ func configurePageControl() { pageControl.pageIndicatorTintColor = UIColor.systemGreen pageControl.currentPageIndicatorTintColor = UIColor.systemPurple - + pageControl.addTarget(self, action: #selector(PageControlViewController.pageControlValueDidChange), for: .valueChanged) } ``` + +## Add Menus to Your Controls + +You can attach menus to controls like `UIButton` and `UIBarButtonItem`. Create menus with the [`UIAction`](https://developer.apple.com/documentation/uikit/uiaction) class, and attach a menu to each control by setting the [`UIMenu`](https://developer.apple.com/documentation/uikit/uimenu) property. + +Attach a menu to a `UIButton` as shown here: + +``` swift +func configureMenuButton() { + let buttonTitle = NSLocalizedString("Button", comment: "") + menuButton.setTitle(buttonTitle, for: .normal) + + let items = (1...5).map { + UIAction(title: String(format: NSLocalizedString("ItemTitle", comment: ""), $0.description), handler: menuHandler) + } + menuButton.menu = UIMenu(title: NSLocalizedString("ChooseItemTitle", comment: ""), children: items) + menuButton.showsMenuAsPrimaryAction = true +} +``` + +Create a `UIBarButtonItem` with a menu attached as shown here: + +``` swift +var customTitleBarButtonItem: UIBarButtonItem { + let buttonMenu = UIMenu(title: "", + children: (1...5).map { + UIAction(title: "Option \($0)", handler: menuHandler) + }) + return UIBarButtonItem(image: UIImage(systemName: "list.number"), menu: buttonMenu) +} +``` + + diff --git a/UIKitCatalog.xcodeproj/project.pbxproj b/UIKitCatalog.xcodeproj/project.pbxproj index a234a1c..aaf177c 100644 --- a/UIKitCatalog.xcodeproj/project.pbxproj +++ b/UIKitCatalog.xcodeproj/project.pbxproj @@ -17,8 +17,7 @@ 2200542B18BC54EC002A6E8B /* DefaultSearchBarViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2200542518BC54EC002A6E8B /* DefaultSearchBarViewController.swift */; }; 2200542C18BC54EC002A6E8B /* DefaultToolbarViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2200542618BC54EC002A6E8B /* DefaultToolbarViewController.swift */; }; 2200543C18BC54F5002A6E8B /* ImageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2200542D18BC54F5002A6E8B /* ImageViewController.swift */; }; - 2200543F18BC54F5002A6E8B /* PageControlViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2200543018BC54F5002A6E8B /* PageControlViewController.swift */; }; - 2200544018BC54F5002A6E8B /* PickerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2200543118BC54F5002A6E8B /* PickerViewController.swift */; }; + 2200543F18BC54F5002A6E8B /* DefaultPageControlViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2200543018BC54F5002A6E8B /* DefaultPageControlViewController.swift */; }; 2200544118BC54F5002A6E8B /* ProgressViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2200543218BC54F5002A6E8B /* ProgressViewController.swift */; }; 2200544218BC54F5002A6E8B /* SegmentedControlViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2200543318BC54F5002A6E8B /* SegmentedControlViewController.swift */; }; 2200544318BC54F5002A6E8B /* SliderViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2200543418BC54F5002A6E8B /* SliderViewController.swift */; }; @@ -31,27 +30,35 @@ 228DBA0818BC53F1002BA12A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 228DBA0718BC53F1002BA12A /* Assets.xcassets */; }; 3E5C084E1974991E00969DD7 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3E5C08501974991E00969DD7 /* Main.storyboard */; }; 5312D0F222848B0200048DE2 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 5312D0F022848B0200048DE2 /* Credits.rtf */; }; - 533BD78D1F8BE1A6007D5C3B /* DetailViewManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 533BD78C1F8BE1A6007D5C3B /* DetailViewManager.swift */; }; - 533BD7951F8BF6A4007D5C3B /* UIViewController+SizeChange.swift in Sources */ = {isa = PBXBuildFile; fileRef = 533BD7941F8BF6A4007D5C3B /* UIViewController+SizeChange.swift */; }; - 533BD7971F8BF8B0007D5C3B /* BaseTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 533BD7961F8BF8B0007D5C3B /* BaseTableViewController.swift */; }; - 533BD7BC1F8D2B08007D5C3B /* SearchBarsTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 533BD7BA1F8D2B07007D5C3B /* SearchBarsTableViewController.swift */; }; - 533BD7BD1F8D2B08007D5C3B /* ToolbarsTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 533BD7BB1F8D2B07007D5C3B /* ToolbarsTableViewController.swift */; }; - 5341627C1F291F310007BCCA /* ToolbarViewControllers.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5341627A1F291F310007BCCA /* ToolbarViewControllers.storyboard */; }; + 5340A1B62496CF64004F3666 /* DefaultToolbarViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5340A1B02496CF64004F3666 /* DefaultToolbarViewController.storyboard */; }; + 5340A1B72496CF64004F3666 /* CustomToolbarViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5340A1B22496CF64004F3666 /* CustomToolbarViewController.storyboard */; }; + 5340A1B82496CF64004F3666 /* TintedToolbarViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5340A1B42496CF64004F3666 /* TintedToolbarViewController.storyboard */; }; + 5340A1B92496D670004F3666 /* PickerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2200543118BC54F5002A6E8B /* PickerViewController.swift */; }; + 535D32B224970EF10011E153 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 535D32B124970EF10011E153 /* SceneDelegate.swift */; }; + 5364C08C249696D7009A9A52 /* OutlineViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5364C08A249696D7009A9A52 /* OutlineViewController.swift */; }; + 5364C0922496BEFD009A9A52 /* DefaultSearchBarViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5364C08E2496BEFD009A9A52 /* DefaultSearchBarViewController.storyboard */; }; + 5364C0932496BEFD009A9A52 /* CustomSearchBarViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5364C0902496BEFD009A9A52 /* CustomSearchBarViewController.storyboard */; }; + 5364C0992496C2B3009A9A52 /* DefaultPageControlViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5364C0952496C2B3009A9A52 /* DefaultPageControlViewController.storyboard */; }; + 5364C09A2496C2B3009A9A52 /* CustomPageControlViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5364C0972496C2B3009A9A52 /* CustomPageControlViewController.storyboard */; }; 53654E232298881200B999C7 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 53654E222298881200B999C7 /* WebKit.framework */; }; - 537357141F291E6700FAB742 /* SearchViewControllers.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 537357121F291E6700FAB742 /* SearchViewControllers.storyboard */; }; 538B36F41F2A8E06002AE100 /* DatePickerController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 538B36F21F2A8D97002AE100 /* DatePickerController.storyboard */; }; 538B36F71F2A8E8A002AE100 /* TextViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 538B36F51F2A8E66002AE100 /* TextViewController.storyboard */; }; 539029FF1F2A53AD009775E3 /* AlertControllerViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 539029FD1F2A53AD009775E3 /* AlertControllerViewController.storyboard */; }; 539C6BAE1F27F4980006C5A9 /* ActivityIndicatorViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 539C6BA81F27F4980006C5A9 /* ActivityIndicatorViewController.storyboard */; }; 539C6BAF1F27F4980006C5A9 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 539C6BAA1F27F4980006C5A9 /* LaunchScreen.storyboard */; }; 539C6BB01F27F4980006C5A9 /* WebViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 539C6BAC1F27F4980006C5A9 /* WebViewController.storyboard */; }; - 539C6BB21F27F4A70006C5A9 /* MasterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 539C6BB11F27F4A70006C5A9 /* MasterViewController.swift */; }; + 53A266B52491ED77008EADBB /* ImagePickerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53A266AE2491ED77008EADBB /* ImagePickerViewController.swift */; }; + 53A266B62491ED77008EADBB /* CustomPageControlViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53A266AF2491ED77008EADBB /* CustomPageControlViewController.swift */; }; + 53A266B82491ED77008EADBB /* ColorPickerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53A266B12491ED77008EADBB /* ColorPickerViewController.swift */; }; + 53A266B92491ED77008EADBB /* FontPickerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53A266B22491ED77008EADBB /* FontPickerViewController.swift */; }; + 53A266C22491ED9E008EADBB /* ImagePickerViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 53A266BA2491ED9E008EADBB /* ImagePickerViewController.storyboard */; }; + 53A266C42491ED9E008EADBB /* ColorPickerViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 53A266BE2491ED9E008EADBB /* ColorPickerViewController.storyboard */; }; + 53A266C52491ED9E008EADBB /* FontPickerViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 53A266C02491ED9E008EADBB /* FontPickerViewController.storyboard */; }; 53B791DA1F85505400AB2FA6 /* content.html in Resources */ = {isa = PBXBuildFile; fileRef = 53B791D41F854B4700AB2FA6 /* content.html */; }; 53B791DB1F85505700AB2FA6 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 53B791D61F854B4700AB2FA6 /* InfoPlist.strings */; }; 53B791DC1F85505A00AB2FA6 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 53B791D81F854B4800AB2FA6 /* Localizable.strings */; }; 53CE5AD81F2A89E500D8A656 /* ButtonViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 53CE5AD61F2A89E500D8A656 /* ButtonViewController.storyboard */; }; 53CE5ADE1F2A8A3D00D8A656 /* ImageViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 53CE5ADC1F2A8A3D00D8A656 /* ImageViewController.storyboard */; }; - 53CE5AE31F2A8AD200D8A656 /* PageControlViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 53CE5AE11F2A8AD200D8A656 /* PageControlViewController.storyboard */; }; 53CE5AE61F2A8AEF00D8A656 /* PickerViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 53CE5AE41F2A8AEF00D8A656 /* PickerViewController.storyboard */; }; 53CE5AE91F2A8B1000D8A656 /* ProgressViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 53CE5AE71F2A8B1000D8A656 /* ProgressViewController.storyboard */; }; 53CE5AEC1F2A8B2F00D8A656 /* SegmentedControlViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 53CE5AEA1F2A8B2F00D8A656 /* SegmentedControlViewController.storyboard */; }; @@ -74,7 +81,7 @@ 2200542518BC54EC002A6E8B /* DefaultSearchBarViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DefaultSearchBarViewController.swift; sourceTree = ""; }; 2200542618BC54EC002A6E8B /* DefaultToolbarViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = DefaultToolbarViewController.swift; sourceTree = ""; }; 2200542D18BC54F5002A6E8B /* ImageViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = ImageViewController.swift; sourceTree = ""; }; - 2200543018BC54F5002A6E8B /* PageControlViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = PageControlViewController.swift; sourceTree = ""; }; + 2200543018BC54F5002A6E8B /* DefaultPageControlViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = DefaultPageControlViewController.swift; sourceTree = ""; }; 2200543118BC54F5002A6E8B /* PickerViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = PickerViewController.swift; sourceTree = ""; }; 2200543218BC54F5002A6E8B /* ProgressViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = ProgressViewController.swift; sourceTree = ""; }; 2200543318BC54F5002A6E8B /* SegmentedControlViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = SegmentedControlViewController.swift; sourceTree = ""; }; @@ -90,28 +97,35 @@ 228DBA0718BC53F1002BA12A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 3E5C084F1974991E00969DD7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 5312D0F122848B0200048DE2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = Base; path = Base.lproj/Credits.rtf; sourceTree = ""; }; - 533BD78C1F8BE1A6007D5C3B /* DetailViewManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetailViewManager.swift; sourceTree = ""; }; - 533BD7941F8BF6A4007D5C3B /* UIViewController+SizeChange.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIViewController+SizeChange.swift"; sourceTree = ""; }; - 533BD7961F8BF8B0007D5C3B /* BaseTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseTableViewController.swift; sourceTree = ""; }; - 533BD7BA1F8D2B07007D5C3B /* SearchBarsTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchBarsTableViewController.swift; sourceTree = ""; }; - 533BD7BB1F8D2B07007D5C3B /* ToolbarsTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToolbarsTableViewController.swift; sourceTree = ""; }; - 5341627B1F291F310007BCCA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/ToolbarViewControllers.storyboard; sourceTree = ""; }; + 5340A1B12496CF64004F3666 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/DefaultToolbarViewController.storyboard; sourceTree = ""; }; + 5340A1B32496CF64004F3666 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/CustomToolbarViewController.storyboard; sourceTree = ""; }; + 5340A1B52496CF64004F3666 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/TintedToolbarViewController.storyboard; sourceTree = ""; }; 5359C3081F194CF0007F0EC7 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; + 535D32B124970EF10011E153 /* SceneDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + 5364C08A249696D7009A9A52 /* OutlineViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OutlineViewController.swift; sourceTree = ""; }; + 5364C08F2496BEFD009A9A52 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/DefaultSearchBarViewController.storyboard; sourceTree = ""; }; + 5364C0912496BEFD009A9A52 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/CustomSearchBarViewController.storyboard; sourceTree = ""; }; + 5364C0962496C2B3009A9A52 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/DefaultPageControlViewController.storyboard; sourceTree = ""; }; + 5364C0982496C2B3009A9A52 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/CustomPageControlViewController.storyboard; sourceTree = ""; }; 53654E222298881200B999C7 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; }; - 537357131F291E6700FAB742 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/SearchViewControllers.storyboard; sourceTree = ""; }; 538B36F31F2A8D97002AE100 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/DatePickerController.storyboard; sourceTree = ""; }; 538B36F61F2A8E66002AE100 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/TextViewController.storyboard; sourceTree = ""; }; 539029FE1F2A53AD009775E3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/AlertControllerViewController.storyboard; sourceTree = ""; }; 539C6BA91F27F4980006C5A9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/ActivityIndicatorViewController.storyboard; sourceTree = ""; }; 539C6BAB1F27F4980006C5A9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 539C6BAD1F27F4980006C5A9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/WebViewController.storyboard; sourceTree = ""; }; - 539C6BB11F27F4A70006C5A9 /* MasterViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MasterViewController.swift; sourceTree = ""; }; + 53A266AE2491ED77008EADBB /* ImagePickerViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImagePickerViewController.swift; sourceTree = ""; }; + 53A266AF2491ED77008EADBB /* CustomPageControlViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CustomPageControlViewController.swift; sourceTree = ""; }; + 53A266B12491ED77008EADBB /* ColorPickerViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ColorPickerViewController.swift; sourceTree = ""; }; + 53A266B22491ED77008EADBB /* FontPickerViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FontPickerViewController.swift; sourceTree = ""; }; + 53A266BB2491ED9E008EADBB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/ImagePickerViewController.storyboard; sourceTree = ""; }; + 53A266BF2491ED9E008EADBB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/ColorPickerViewController.storyboard; sourceTree = ""; }; + 53A266C12491ED9E008EADBB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/FontPickerViewController.storyboard; sourceTree = ""; }; 53B791D51F854B4700AB2FA6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.html; name = Base; path = Base.lproj/content.html; sourceTree = ""; }; 53B791D71F854B4700AB2FA6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Base; path = Base.lproj/InfoPlist.strings; sourceTree = ""; }; 53B791D91F854B4800AB2FA6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Base; path = Base.lproj/Localizable.strings; sourceTree = ""; }; 53CE5AD71F2A89E500D8A656 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/ButtonViewController.storyboard; sourceTree = ""; }; 53CE5ADD1F2A8A3D00D8A656 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/ImageViewController.storyboard; sourceTree = ""; }; - 53CE5AE21F2A8AD200D8A656 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/PageControlViewController.storyboard; sourceTree = ""; }; 53CE5AE51F2A8AEF00D8A656 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/PickerViewController.storyboard; sourceTree = ""; }; 53CE5AE81F2A8B1000D8A656 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/ProgressViewController.storyboard; sourceTree = ""; }; 53CE5AEB1F2A8B2F00D8A656 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/SegmentedControlViewController.storyboard; sourceTree = ""; }; @@ -171,7 +185,9 @@ children = ( 53DDE73C22776382000006CF /* UIKitCatalog.entitlements */, 3E2459D41931CCB5002D3369 /* Application */, - 3E1DA7601931CC99000114A9 /* View Controllers */, + 3E1DA7601931CC99000114A9 /* Controls */, + 539383DE2492800100A489A9 /* Views */, + 539383DF2492801000A489A9 /* Pickers */, 228DBA0718BC53F1002BA12A /* Assets.xcassets */, 228DB9F618BC53F1002BA12A /* Supporting Files */, ); @@ -195,9 +211,10 @@ 22B7BB9718BC601D006C4AD5 /* Search */ = { isa = PBXGroup; children = ( - 533BD7BA1F8D2B07007D5C3B /* SearchBarsTableViewController.swift */, - 3E6AE84D196B1FC10062A3E1 /* Search Bar */, - 537357121F291E6700FAB742 /* SearchViewControllers.storyboard */, + 2200542518BC54EC002A6E8B /* DefaultSearchBarViewController.swift */, + 2200542218BC54EC002A6E8B /* CustomSearchBarViewController.swift */, + 5364C0902496BEFD009A9A52 /* CustomSearchBarViewController.storyboard */, + 5364C08E2496BEFD009A9A52 /* DefaultSearchBarViewController.storyboard */, ); name = Search; sourceTree = ""; @@ -205,75 +222,56 @@ 22B7BB9818BC6024006C4AD5 /* Toolbar */ = { isa = PBXGroup; children = ( - 533BD7BB1F8D2B07007D5C3B /* ToolbarsTableViewController.swift */, 2200542618BC54EC002A6E8B /* DefaultToolbarViewController.swift */, 2200543A18BC54F5002A6E8B /* TintedToolbarViewController.swift */, 2200542318BC54EC002A6E8B /* CustomToolbarViewController.swift */, - 5341627A1F291F310007BCCA /* ToolbarViewControllers.storyboard */, + 5340A1B22496CF64004F3666 /* CustomToolbarViewController.storyboard */, + 5340A1B02496CF64004F3666 /* DefaultToolbarViewController.storyboard */, + 5340A1B42496CF64004F3666 /* TintedToolbarViewController.storyboard */, ); name = Toolbar; sourceTree = ""; }; - 3E1DA7601931CC99000114A9 /* View Controllers */ = { + 3E1DA7601931CC99000114A9 /* Controls */ = { isa = PBXGroup; children = ( - 2200541A18BC54E8002A6E8B /* ActivityIndicatorViewController.swift */, - 539C6BA81F27F4980006C5A9 /* ActivityIndicatorViewController.storyboard */, - 2200541B18BC54E8002A6E8B /* AlertControllerViewController.swift */, - 539029FD1F2A53AD009775E3 /* AlertControllerViewController.storyboard */, 2200542118BC54EC002A6E8B /* ButtonViewController.swift */, 53CE5AD61F2A89E500D8A656 /* ButtonViewController.storyboard */, - 2200542418BC54EC002A6E8B /* DatePickerController.swift */, - 538B36F21F2A8D97002AE100 /* DatePickerController.storyboard */, - 2200542D18BC54F5002A6E8B /* ImageViewController.swift */, - 53CE5ADC1F2A8A3D00D8A656 /* ImageViewController.storyboard */, - 2200543018BC54F5002A6E8B /* PageControlViewController.swift */, - 53CE5AE11F2A8AD200D8A656 /* PageControlViewController.storyboard */, - 2200543118BC54F5002A6E8B /* PickerViewController.swift */, - 53CE5AE41F2A8AEF00D8A656 /* PickerViewController.storyboard */, - 2200543218BC54F5002A6E8B /* ProgressViewController.swift */, - 53CE5AE71F2A8B1000D8A656 /* ProgressViewController.storyboard */, + 5364C0942496C22D009A9A52 /* Page Control */, + 22B7BB9718BC601D006C4AD5 /* Search */, 2200543318BC54F5002A6E8B /* SegmentedControlViewController.swift */, 53CE5AEA1F2A8B2F00D8A656 /* SegmentedControlViewController.storyboard */, 2200543418BC54F5002A6E8B /* SliderViewController.swift */, 53CE5AED1F2A8B4F00D8A656 /* SliderViewController.storyboard */, - B50F41071B1D284700E5147D /* StackViewController.swift */, - 53CE5AF01F2A8B8300D8A656 /* StackViewController.storyboard */, 2200543618BC54F5002A6E8B /* StepperViewController.swift */, 53CE5AF31F2A8BB000D8A656 /* StepperViewController.storyboard */, 2200543718BC54F5002A6E8B /* SwitchViewController.swift */, 53CE5AF61F2A8BD000D8A656 /* SwitchViewController.storyboard */, 2200543818BC54F5002A6E8B /* TextFieldViewController.swift */, 53CE5AF91F2A8BEB00D8A656 /* TextFieldViewController.storyboard */, - 2200543918BC54F5002A6E8B /* TextViewController.swift */, - 538B36F51F2A8E66002AE100 /* TextViewController.storyboard */, - 2200543B18BC54F5002A6E8B /* WebViewController.swift */, - 539C6BAC1F27F4980006C5A9 /* WebViewController.storyboard */, - 22B7BB9718BC601D006C4AD5 /* Search */, - 22B7BB9818BC6024006C4AD5 /* Toolbar */, ); - name = "View Controllers"; + name = Controls; sourceTree = ""; }; 3E2459D41931CCB5002D3369 /* Application */ = { isa = PBXGroup; children = ( 2200541C18BC54E8002A6E8B /* AppDelegate.swift */, - 533BD78C1F8BE1A6007D5C3B /* DetailViewManager.swift */, - 539C6BB11F27F4A70006C5A9 /* MasterViewController.swift */, - 533BD7941F8BF6A4007D5C3B /* UIViewController+SizeChange.swift */, - 533BD7961F8BF8B0007D5C3B /* BaseTableViewController.swift */, + 535D32B124970EF10011E153 /* SceneDelegate.swift */, + 5364C08A249696D7009A9A52 /* OutlineViewController.swift */, ); name = Application; sourceTree = ""; }; - 3E6AE84D196B1FC10062A3E1 /* Search Bar */ = { + 5364C0942496C22D009A9A52 /* Page Control */ = { isa = PBXGroup; children = ( - 2200542518BC54EC002A6E8B /* DefaultSearchBarViewController.swift */, - 2200542218BC54EC002A6E8B /* CustomSearchBarViewController.swift */, + 2200543018BC54F5002A6E8B /* DefaultPageControlViewController.swift */, + 53A266AF2491ED77008EADBB /* CustomPageControlViewController.swift */, + 5364C0972496C2B3009A9A52 /* CustomPageControlViewController.storyboard */, + 5364C0952496C2B3009A9A52 /* DefaultPageControlViewController.storyboard */, ); - name = "Search Bar"; + name = "Page Control"; sourceTree = ""; }; 53654E212298881100B999C7 /* Frameworks */ = { @@ -284,6 +282,45 @@ name = Frameworks; sourceTree = ""; }; + 539383DE2492800100A489A9 /* Views */ = { + isa = PBXGroup; + children = ( + 2200541A18BC54E8002A6E8B /* ActivityIndicatorViewController.swift */, + 539C6BA81F27F4980006C5A9 /* ActivityIndicatorViewController.storyboard */, + 2200541B18BC54E8002A6E8B /* AlertControllerViewController.swift */, + 539029FD1F2A53AD009775E3 /* AlertControllerViewController.storyboard */, + 2200542D18BC54F5002A6E8B /* ImageViewController.swift */, + 53CE5ADC1F2A8A3D00D8A656 /* ImageViewController.storyboard */, + 2200543218BC54F5002A6E8B /* ProgressViewController.swift */, + 53CE5AE71F2A8B1000D8A656 /* ProgressViewController.storyboard */, + B50F41071B1D284700E5147D /* StackViewController.swift */, + 53CE5AF01F2A8B8300D8A656 /* StackViewController.storyboard */, + 2200543918BC54F5002A6E8B /* TextViewController.swift */, + 538B36F51F2A8E66002AE100 /* TextViewController.storyboard */, + 22B7BB9818BC6024006C4AD5 /* Toolbar */, + 2200543B18BC54F5002A6E8B /* WebViewController.swift */, + 539C6BAC1F27F4980006C5A9 /* WebViewController.storyboard */, + ); + name = Views; + sourceTree = ""; + }; + 539383DF2492801000A489A9 /* Pickers */ = { + isa = PBXGroup; + children = ( + 2200542418BC54EC002A6E8B /* DatePickerController.swift */, + 538B36F21F2A8D97002AE100 /* DatePickerController.storyboard */, + 2200543118BC54F5002A6E8B /* PickerViewController.swift */, + 53CE5AE41F2A8AEF00D8A656 /* PickerViewController.storyboard */, + 53A266B12491ED77008EADBB /* ColorPickerViewController.swift */, + 53A266BE2491ED9E008EADBB /* ColorPickerViewController.storyboard */, + 53A266B22491ED77008EADBB /* FontPickerViewController.swift */, + 53A266C02491ED9E008EADBB /* FontPickerViewController.storyboard */, + 53A266AE2491ED77008EADBB /* ImagePickerViewController.swift */, + 53A266BA2491ED9E008EADBB /* ImagePickerViewController.storyboard */, + ); + name = Pickers; + sourceTree = ""; + }; D9361AEE59ED9397893793F6 /* LICENSE */ = { isa = PBXGroup; children = ( @@ -320,7 +357,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0700; - LastUpgradeCheck = 1100; + LastUpgradeCheck = 1200; ORGANIZATIONNAME = Apple; TargetAttributes = { 228DB9F218BC53F1002BA12A = { @@ -352,29 +389,36 @@ buildActionMask = 2147483647; files = ( 539C6BB01F27F4980006C5A9 /* WebViewController.storyboard in Resources */, + 5364C09A2496C2B3009A9A52 /* CustomPageControlViewController.storyboard in Resources */, 53CE5AD81F2A89E500D8A656 /* ButtonViewController.storyboard in Resources */, + 53A266C42491ED9E008EADBB /* ColorPickerViewController.storyboard in Resources */, 53CE5AEF1F2A8B4F00D8A656 /* SliderViewController.storyboard in Resources */, - 537357141F291E6700FAB742 /* SearchViewControllers.storyboard in Resources */, + 53A266C52491ED9E008EADBB /* FontPickerViewController.storyboard in Resources */, + 5364C0922496BEFD009A9A52 /* DefaultSearchBarViewController.storyboard in Resources */, 53CE5AE91F2A8B1000D8A656 /* ProgressViewController.storyboard in Resources */, + 53A266C22491ED9E008EADBB /* ImagePickerViewController.storyboard in Resources */, + 5364C0992496C2B3009A9A52 /* DefaultPageControlViewController.storyboard in Resources */, + 5340A1B72496CF64004F3666 /* CustomToolbarViewController.storyboard in Resources */, 53CE5AE61F2A8AEF00D8A656 /* PickerViewController.storyboard in Resources */, 53B791DA1F85505400AB2FA6 /* content.html in Resources */, 3E5C084E1974991E00969DD7 /* Main.storyboard in Resources */, 53CE5AEC1F2A8B2F00D8A656 /* SegmentedControlViewController.storyboard in Resources */, + 5364C0932496BEFD009A9A52 /* CustomSearchBarViewController.storyboard in Resources */, 53B791DB1F85505700AB2FA6 /* InfoPlist.strings in Resources */, 539C6BAE1F27F4980006C5A9 /* ActivityIndicatorViewController.storyboard in Resources */, 53CE5AFB1F2A8BEB00D8A656 /* TextFieldViewController.storyboard in Resources */, - 5341627C1F291F310007BCCA /* ToolbarViewControllers.storyboard in Resources */, 53B791DC1F85505A00AB2FA6 /* Localizable.strings in Resources */, 228DBA0818BC53F1002BA12A /* Assets.xcassets in Resources */, 538B36F41F2A8E06002AE100 /* DatePickerController.storyboard in Resources */, - 53CE5AE31F2A8AD200D8A656 /* PageControlViewController.storyboard in Resources */, 53CE5AF21F2A8B8300D8A656 /* StackViewController.storyboard in Resources */, + 5340A1B82496CF64004F3666 /* TintedToolbarViewController.storyboard in Resources */, 538B36F71F2A8E8A002AE100 /* TextViewController.storyboard in Resources */, 539C6BAF1F27F4980006C5A9 /* LaunchScreen.storyboard in Resources */, 5312D0F222848B0200048DE2 /* Credits.rtf in Resources */, 539029FF1F2A53AD009775E3 /* AlertControllerViewController.storyboard in Resources */, 53CE5AF51F2A8BB000D8A656 /* StepperViewController.storyboard in Resources */, 53CE5AF81F2A8BD000D8A656 /* SwitchViewController.storyboard in Resources */, + 5340A1B62496CF64004F3666 /* DefaultToolbarViewController.storyboard in Resources */, 53CE5ADE1F2A8A3D00D8A656 /* ImageViewController.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -386,34 +430,34 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 2200544018BC54F5002A6E8B /* PickerViewController.swift in Sources */, - 2200543F18BC54F5002A6E8B /* PageControlViewController.swift in Sources */, - 533BD7951F8BF6A4007D5C3B /* UIViewController+SizeChange.swift in Sources */, + 2200543F18BC54F5002A6E8B /* DefaultPageControlViewController.swift in Sources */, 2200544918BC54F5002A6E8B /* TintedToolbarViewController.swift in Sources */, + 5364C08C249696D7009A9A52 /* OutlineViewController.swift in Sources */, 2200544318BC54F5002A6E8B /* SliderViewController.swift in Sources */, 2200544218BC54F5002A6E8B /* SegmentedControlViewController.swift in Sources */, 2200544A18BC54F5002A6E8B /* WebViewController.swift in Sources */, 2200542018BC54E8002A6E8B /* AppDelegate.swift in Sources */, - 539C6BB21F27F4A70006C5A9 /* MasterViewController.swift in Sources */, + 5340A1B92496D670004F3666 /* PickerViewController.swift in Sources */, + 53A266B92491ED77008EADBB /* FontPickerViewController.swift in Sources */, 2200541F18BC54E8002A6E8B /* AlertControllerViewController.swift in Sources */, 2200542C18BC54EC002A6E8B /* DefaultToolbarViewController.swift in Sources */, 2200543C18BC54F5002A6E8B /* ImageViewController.swift in Sources */, 2200541E18BC54E8002A6E8B /* ActivityIndicatorViewController.swift in Sources */, - 533BD7BD1F8D2B08007D5C3B /* ToolbarsTableViewController.swift in Sources */, 2200544618BC54F5002A6E8B /* SwitchViewController.swift in Sources */, - 533BD7971F8BF8B0007D5C3B /* BaseTableViewController.swift in Sources */, B50F41081B1D284700E5147D /* StackViewController.swift in Sources */, + 535D32B224970EF10011E153 /* SceneDelegate.swift in Sources */, 2200544118BC54F5002A6E8B /* ProgressViewController.swift in Sources */, 2200544718BC54F5002A6E8B /* TextFieldViewController.swift in Sources */, 2200544818BC54F5002A6E8B /* TextViewController.swift in Sources */, 2200542B18BC54EC002A6E8B /* DefaultSearchBarViewController.swift in Sources */, 2200544518BC54F5002A6E8B /* StepperViewController.swift in Sources */, + 53A266B62491ED77008EADBB /* CustomPageControlViewController.swift in Sources */, + 53A266B82491ED77008EADBB /* ColorPickerViewController.swift in Sources */, 2200542818BC54EC002A6E8B /* CustomSearchBarViewController.swift in Sources */, - 533BD7BC1F8D2B08007D5C3B /* SearchBarsTableViewController.swift in Sources */, + 53A266B52491ED77008EADBB /* ImagePickerViewController.swift in Sources */, 2200542918BC54EC002A6E8B /* CustomToolbarViewController.swift in Sources */, 2200542A18BC54EC002A6E8B /* DatePickerController.swift in Sources */, 2200542718BC54EC002A6E8B /* ButtonViewController.swift in Sources */, - 533BD78D1F8BE1A6007D5C3B /* DetailViewManager.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -436,20 +480,60 @@ name = Credits.rtf; sourceTree = ""; }; - 5341627A1F291F310007BCCA /* ToolbarViewControllers.storyboard */ = { + 5340A1B02496CF64004F3666 /* DefaultToolbarViewController.storyboard */ = { isa = PBXVariantGroup; children = ( - 5341627B1F291F310007BCCA /* Base */, + 5340A1B12496CF64004F3666 /* Base */, ); - name = ToolbarViewControllers.storyboard; + name = DefaultToolbarViewController.storyboard; sourceTree = ""; }; - 537357121F291E6700FAB742 /* SearchViewControllers.storyboard */ = { + 5340A1B22496CF64004F3666 /* CustomToolbarViewController.storyboard */ = { isa = PBXVariantGroup; children = ( - 537357131F291E6700FAB742 /* Base */, + 5340A1B32496CF64004F3666 /* Base */, ); - name = SearchViewControllers.storyboard; + name = CustomToolbarViewController.storyboard; + sourceTree = ""; + }; + 5340A1B42496CF64004F3666 /* TintedToolbarViewController.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 5340A1B52496CF64004F3666 /* Base */, + ); + name = TintedToolbarViewController.storyboard; + sourceTree = ""; + }; + 5364C08E2496BEFD009A9A52 /* DefaultSearchBarViewController.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 5364C08F2496BEFD009A9A52 /* Base */, + ); + name = DefaultSearchBarViewController.storyboard; + sourceTree = ""; + }; + 5364C0902496BEFD009A9A52 /* CustomSearchBarViewController.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 5364C0912496BEFD009A9A52 /* Base */, + ); + name = CustomSearchBarViewController.storyboard; + sourceTree = ""; + }; + 5364C0952496C2B3009A9A52 /* DefaultPageControlViewController.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 5364C0962496C2B3009A9A52 /* Base */, + ); + name = DefaultPageControlViewController.storyboard; + sourceTree = ""; + }; + 5364C0972496C2B3009A9A52 /* CustomPageControlViewController.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 5364C0982496C2B3009A9A52 /* Base */, + ); + name = CustomPageControlViewController.storyboard; sourceTree = ""; }; 538B36F21F2A8D97002AE100 /* DatePickerController.storyboard */ = { @@ -500,6 +584,30 @@ name = WebViewController.storyboard; sourceTree = ""; }; + 53A266BA2491ED9E008EADBB /* ImagePickerViewController.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 53A266BB2491ED9E008EADBB /* Base */, + ); + name = ImagePickerViewController.storyboard; + sourceTree = ""; + }; + 53A266BE2491ED9E008EADBB /* ColorPickerViewController.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 53A266BF2491ED9E008EADBB /* Base */, + ); + name = ColorPickerViewController.storyboard; + sourceTree = ""; + }; + 53A266C02491ED9E008EADBB /* FontPickerViewController.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 53A266C12491ED9E008EADBB /* Base */, + ); + name = FontPickerViewController.storyboard; + sourceTree = ""; + }; 53B791D41F854B4700AB2FA6 /* content.html */ = { isa = PBXVariantGroup; children = ( @@ -540,14 +648,6 @@ name = ImageViewController.storyboard; sourceTree = ""; }; - 53CE5AE11F2A8AD200D8A656 /* PageControlViewController.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 53CE5AE21F2A8AD200D8A656 /* Base */, - ); - name = PageControlViewController.storyboard; - sourceTree = ""; - }; 53CE5AE41F2A8AEF00D8A656 /* PickerViewController.storyboard */ = { isa = PBXVariantGroup; children = ( @@ -639,6 +739,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -663,7 +764,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_VERSION = ""; @@ -695,6 +796,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -712,7 +814,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; SDKROOT = iphoneos; SWIFT_VERSION = ""; TARGETED_DEVICE_FAMILY = "1,2"; @@ -729,8 +831,9 @@ "CODE_SIGN_IDENTITY[sdk=macosx*]" = "-"; DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = "$(SRCROOT)/UIKitCatalog/UIKitCatalog-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; + MARKETING_VERSION = 16; PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.${PRODUCT_NAME:rfc1034identifier}${SAMPLE_CODE_DISAMBIGUATOR}"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -750,8 +853,9 @@ "CODE_SIGN_IDENTITY[sdk=macosx*]" = "-"; DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = "$(SRCROOT)/UIKitCatalog/UIKitCatalog-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; + MARKETING_VERSION = 16; PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.${PRODUCT_NAME:rfc1034identifier}${SAMPLE_CODE_DISAMBIGUATOR}"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/UIKitCatalog/ActivityIndicatorViewController.swift b/UIKitCatalog/ActivityIndicatorViewController.swift old mode 100644 new mode 100755 diff --git a/UIKitCatalog/AlertControllerViewController.swift b/UIKitCatalog/AlertControllerViewController.swift old mode 100644 new mode 100755 diff --git a/UIKitCatalog/AppDelegate.swift b/UIKitCatalog/AppDelegate.swift old mode 100644 new mode 100755 index 6ca2aab..6c41f8e --- a/UIKitCatalog/AppDelegate.swift +++ b/UIKitCatalog/AppDelegate.swift @@ -8,29 +8,11 @@ The application-specific delegate class. import UIKit @UIApplicationMain -class AppDelegate: NSObject, UIApplicationDelegate, UISplitViewControllerDelegate { - // MARK: - Properties - - var window: UIWindow? - - /** The detailViewManager is responsible for maintaining the UISplitViewController delegation - and for managing the detail view controller of the split view. - */ - var detailViewManager = DetailViewManager() - - // MARK: - UIApplicationDelegate +class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - if let splitViewController = window!.rootViewController as? UISplitViewController { - splitViewController.preferredDisplayMode = .allVisible - splitViewController.delegate = detailViewManager - detailViewManager.splitViewController = splitViewController - - // Set the master view controller table view with translucent background. - splitViewController.primaryBackgroundStyle = .sidebar - } - return true } } + diff --git a/UIKitCatalog/Assets.xcassets/AppIcon.appiconset/Contents.json b/UIKitCatalog/Assets.xcassets/AppIcon.appiconset/Contents.json old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/Contents.json b/UIKitCatalog/Assets.xcassets/Contents.json old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/Flowers_1.imageset/Contents.json b/UIKitCatalog/Assets.xcassets/Flowers_1.imageset/Contents.json old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/Flowers_1.imageset/Flowers_1.png b/UIKitCatalog/Assets.xcassets/Flowers_1.imageset/Flowers_1.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/Flowers_2.imageset/Contents.json b/UIKitCatalog/Assets.xcassets/Flowers_2.imageset/Contents.json old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/Flowers_2.imageset/Flowers_2.png b/UIKitCatalog/Assets.xcassets/Flowers_2.imageset/Flowers_2.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/search_bar_background.imageset/Contents.json b/UIKitCatalog/Assets.xcassets/search_bar_background.imageset/Contents.json old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/search_bar_background.imageset/search_bar_background_3x.png b/UIKitCatalog/Assets.xcassets/search_bar_background.imageset/search_bar_background_3x.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/search_bar_background.imageset/search_bar_bg_1x.png b/UIKitCatalog/Assets.xcassets/search_bar_background.imageset/search_bar_bg_1x.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/search_bar_background.imageset/search_bar_bg_2x.png b/UIKitCatalog/Assets.xcassets/search_bar_background.imageset/search_bar_bg_2x.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/slider_blue_track.imageset/Contents.json b/UIKitCatalog/Assets.xcassets/slider_blue_track.imageset/Contents.json old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/slider_blue_track.imageset/slider_blue_track_1x.png b/UIKitCatalog/Assets.xcassets/slider_blue_track.imageset/slider_blue_track_1x.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/slider_blue_track.imageset/slider_blue_track_2x.png b/UIKitCatalog/Assets.xcassets/slider_blue_track.imageset/slider_blue_track_2x.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/slider_blue_track.imageset/slider_blue_track_3x.png b/UIKitCatalog/Assets.xcassets/slider_blue_track.imageset/slider_blue_track_3x.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/slider_green_track.imageset/Contents.json b/UIKitCatalog/Assets.xcassets/slider_green_track.imageset/Contents.json old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/slider_green_track.imageset/slider_green_track_1x.png b/UIKitCatalog/Assets.xcassets/slider_green_track.imageset/slider_green_track_1x.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/slider_green_track.imageset/slider_green_track_2x.png b/UIKitCatalog/Assets.xcassets/slider_green_track.imageset/slider_green_track_2x.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/slider_green_track.imageset/slider_green_track_3x.png b/UIKitCatalog/Assets.xcassets/slider_green_track.imageset/slider_green_track_3x.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/stepper_and_segment_background.imageset/Contents.json b/UIKitCatalog/Assets.xcassets/stepper_and_segment_background.imageset/Contents.json old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/stepper_and_segment_background.imageset/stepper_and_segment_background_1x.png b/UIKitCatalog/Assets.xcassets/stepper_and_segment_background.imageset/stepper_and_segment_background_1x.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/stepper_and_segment_background.imageset/stepper_and_segment_background_2x.png b/UIKitCatalog/Assets.xcassets/stepper_and_segment_background.imageset/stepper_and_segment_background_2x.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/stepper_and_segment_background.imageset/stepper_and_segment_background_3x.png b/UIKitCatalog/Assets.xcassets/stepper_and_segment_background.imageset/stepper_and_segment_background_3x.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/stepper_and_segment_background_disabled.imageset/Contents.json b/UIKitCatalog/Assets.xcassets/stepper_and_segment_background_disabled.imageset/Contents.json old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/stepper_and_segment_background_disabled.imageset/stepper_and_segment_background_disabled_1x.png b/UIKitCatalog/Assets.xcassets/stepper_and_segment_background_disabled.imageset/stepper_and_segment_background_disabled_1x.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/stepper_and_segment_background_disabled.imageset/stepper_and_segment_background_disabled_2x.png b/UIKitCatalog/Assets.xcassets/stepper_and_segment_background_disabled.imageset/stepper_and_segment_background_disabled_2x.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/stepper_and_segment_background_disabled.imageset/stepper_and_segment_background_disabled_3x.png b/UIKitCatalog/Assets.xcassets/stepper_and_segment_background_disabled.imageset/stepper_and_segment_background_disabled_3x.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/stepper_and_segment_background_highlighted.imageset/Contents.json b/UIKitCatalog/Assets.xcassets/stepper_and_segment_background_highlighted.imageset/Contents.json old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/stepper_and_segment_background_highlighted.imageset/stepper_and_segment_background_highlighted_1x.png b/UIKitCatalog/Assets.xcassets/stepper_and_segment_background_highlighted.imageset/stepper_and_segment_background_highlighted_1x.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/stepper_and_segment_background_highlighted.imageset/stepper_and_segment_background_highlighted_2x.png b/UIKitCatalog/Assets.xcassets/stepper_and_segment_background_highlighted.imageset/stepper_and_segment_background_highlighted_2x.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/stepper_and_segment_background_highlighted.imageset/stepper_and_segment_background_highlighted_3x.png b/UIKitCatalog/Assets.xcassets/stepper_and_segment_background_highlighted.imageset/stepper_and_segment_background_highlighted_3x.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/stepper_and_segment_segment_divider.imageset/Contents.json b/UIKitCatalog/Assets.xcassets/stepper_and_segment_segment_divider.imageset/Contents.json old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/stepper_and_segment_segment_divider.imageset/stepper_and_segment_divider_3x.png b/UIKitCatalog/Assets.xcassets/stepper_and_segment_segment_divider.imageset/stepper_and_segment_divider_3x.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/stepper_and_segment_segment_divider.imageset/stepper_and_segment_segment_divider_1x.png b/UIKitCatalog/Assets.xcassets/stepper_and_segment_segment_divider.imageset/stepper_and_segment_segment_divider_1x.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/stepper_and_segment_segment_divider.imageset/stepper_and_segment_segment_divider_2x.png b/UIKitCatalog/Assets.xcassets/stepper_and_segment_segment_divider.imageset/stepper_and_segment_segment_divider_2x.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/stepper_decrement.imageset/Contents.json b/UIKitCatalog/Assets.xcassets/stepper_decrement.imageset/Contents.json old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/stepper_decrement.imageset/decrement_1x.png b/UIKitCatalog/Assets.xcassets/stepper_decrement.imageset/decrement_1x.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/stepper_decrement.imageset/decrement_2x.png b/UIKitCatalog/Assets.xcassets/stepper_decrement.imageset/decrement_2x.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/stepper_decrement.imageset/stepper_decrement_3x.png b/UIKitCatalog/Assets.xcassets/stepper_decrement.imageset/stepper_decrement_3x.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/stepper_increment.imageset/Contents.json b/UIKitCatalog/Assets.xcassets/stepper_increment.imageset/Contents.json old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/stepper_increment.imageset/increment_1x.png b/UIKitCatalog/Assets.xcassets/stepper_increment.imageset/increment_1x.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/stepper_increment.imageset/increment_2x.png b/UIKitCatalog/Assets.xcassets/stepper_increment.imageset/increment_2x.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/stepper_increment.imageset/stepper_increment_3x.png b/UIKitCatalog/Assets.xcassets/stepper_increment.imageset/stepper_increment_3x.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/stepper_increment_disabled.imageset/Contents.json b/UIKitCatalog/Assets.xcassets/stepper_increment_disabled.imageset/Contents.json old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/stepper_increment_disabled.imageset/increment_disabled_1x.png b/UIKitCatalog/Assets.xcassets/stepper_increment_disabled.imageset/increment_disabled_1x.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/stepper_increment_disabled.imageset/increment_disabled_2x.png b/UIKitCatalog/Assets.xcassets/stepper_increment_disabled.imageset/increment_disabled_2x.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/stepper_increment_disabled.imageset/stepper_increment_disabled_3x.png b/UIKitCatalog/Assets.xcassets/stepper_increment_disabled.imageset/stepper_increment_disabled_3x.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/stepper_increment_highlighted.imageset/Contents.json b/UIKitCatalog/Assets.xcassets/stepper_increment_highlighted.imageset/Contents.json old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/stepper_increment_highlighted.imageset/increment_highlighted_1x.png b/UIKitCatalog/Assets.xcassets/stepper_increment_highlighted.imageset/increment_highlighted_1x.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/stepper_increment_highlighted.imageset/increment_highlighted_2x.png b/UIKitCatalog/Assets.xcassets/stepper_increment_highlighted.imageset/increment_highlighted_2x.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/stepper_increment_highlighted.imageset/stepper_increment_highlighted_3x.png b/UIKitCatalog/Assets.xcassets/stepper_increment_highlighted.imageset/stepper_increment_highlighted_3x.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/text_field_background.imageset/Contents.json b/UIKitCatalog/Assets.xcassets/text_field_background.imageset/Contents.json old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/text_field_background.imageset/text_field_background_1x.png b/UIKitCatalog/Assets.xcassets/text_field_background.imageset/text_field_background_1x.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/text_field_background.imageset/text_field_background_2x.png b/UIKitCatalog/Assets.xcassets/text_field_background.imageset/text_field_background_2x.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/text_field_background.imageset/text_field_background_3x.png b/UIKitCatalog/Assets.xcassets/text_field_background.imageset/text_field_background_3x.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/text_field_purple_right_view.imageset/Contents.json b/UIKitCatalog/Assets.xcassets/text_field_purple_right_view.imageset/Contents.json old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/text_field_purple_right_view.imageset/text_field_purple_right_view_1x.png b/UIKitCatalog/Assets.xcassets/text_field_purple_right_view.imageset/text_field_purple_right_view_1x.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/text_field_purple_right_view.imageset/text_field_purple_right_view_2x.png b/UIKitCatalog/Assets.xcassets/text_field_purple_right_view.imageset/text_field_purple_right_view_2x.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/text_field_purple_right_view.imageset/text_field_purple_right_view_3x.png b/UIKitCatalog/Assets.xcassets/text_field_purple_right_view.imageset/text_field_purple_right_view_3x.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/text_view_attachment.imageset/Contents.json b/UIKitCatalog/Assets.xcassets/text_view_attachment.imageset/Contents.json old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/text_view_attachment.imageset/Sunset_5.png b/UIKitCatalog/Assets.xcassets/text_view_attachment.imageset/Sunset_5.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/text_view_background.colorset/Contents.json b/UIKitCatalog/Assets.xcassets/text_view_background.colorset/Contents.json old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/tinted_segmented_control.colorset/Contents.json b/UIKitCatalog/Assets.xcassets/tinted_segmented_control.colorset/Contents.json old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/tinted_stepper_control.colorset/Contents.json b/UIKitCatalog/Assets.xcassets/tinted_stepper_control.colorset/Contents.json old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/toolbar_background.imageset/Contents.json b/UIKitCatalog/Assets.xcassets/toolbar_background.imageset/Contents.json old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/toolbar_background.imageset/toolbar_background_1x.png b/UIKitCatalog/Assets.xcassets/toolbar_background.imageset/toolbar_background_1x.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/toolbar_background.imageset/toolbar_background_2x.png b/UIKitCatalog/Assets.xcassets/toolbar_background.imageset/toolbar_background_2x.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/toolbar_background.imageset/toolbar_background_3x.png b/UIKitCatalog/Assets.xcassets/toolbar_background.imageset/toolbar_background_3x.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/x_icon.imageset/Contents.json b/UIKitCatalog/Assets.xcassets/x_icon.imageset/Contents.json old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/x_icon.imageset/x_icon_1x.png b/UIKitCatalog/Assets.xcassets/x_icon.imageset/x_icon_1x.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/x_icon.imageset/x_icon_2x.png b/UIKitCatalog/Assets.xcassets/x_icon.imageset/x_icon_2x.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Assets.xcassets/x_icon.imageset/x_icon_3x.png b/UIKitCatalog/Assets.xcassets/x_icon.imageset/x_icon_3x.png old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Base.lproj/ActivityIndicatorViewController.storyboard b/UIKitCatalog/Base.lproj/ActivityIndicatorViewController.storyboard old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Base.lproj/AlertControllerViewController.storyboard b/UIKitCatalog/Base.lproj/AlertControllerViewController.storyboard old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Base.lproj/ButtonViewController.storyboard b/UIKitCatalog/Base.lproj/ButtonViewController.storyboard old mode 100644 new mode 100755 index 2c316fa..acc1027 --- a/UIKitCatalog/Base.lproj/ButtonViewController.storyboard +++ b/UIKitCatalog/Base.lproj/ButtonViewController.storyboard @@ -1,8 +1,9 @@ - + - + + @@ -13,7 +14,7 @@ - + @@ -24,7 +25,7 @@ - @@ -88,7 +89,7 @@ - @@ -136,7 +137,7 @@ - @@ -157,7 +158,7 @@ - @@ -170,6 +171,28 @@ + + + + + + + + + + + + + + + + + + + @@ -181,6 +204,7 @@ + @@ -193,4 +217,9 @@ + + + + + diff --git a/UIKitCatalog/Base.lproj/ColorPickerViewController.storyboard b/UIKitCatalog/Base.lproj/ColorPickerViewController.storyboard new file mode 100755 index 0000000..9fee52f --- /dev/null +++ b/UIKitCatalog/Base.lproj/ColorPickerViewController.storyboard @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/UIKitCatalog/Base.lproj/Credits.rtf b/UIKitCatalog/Base.lproj/Credits.rtf index b0ce7b8..ce687fd 100755 --- a/UIKitCatalog/Base.lproj/Credits.rtf +++ b/UIKitCatalog/Base.lproj/Credits.rtf @@ -1,9 +1,9 @@ -{\rtf1\ansi\ansicpg1252\cocoartf2467 +{\rtf1\ansi\ansicpg1252\cocoartf2513 \cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} {\colortbl;\red255\green255\blue255;\red0\green0\blue0;} {\*\expandedcolortbl;;\cssrgb\c0\c0\c0\cname textColor;} \vieww9000\viewh8400\viewkind0 \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\qc\partightenfactor0 -\f0\fs20 \cf2 Demonstrates how to use UIKit's views and controls.\ +\f0\fs20 \cf2 Demonstrates how to use UIKit's views, controls and pickers.\ } \ No newline at end of file diff --git a/UIKitCatalog/Base.lproj/CustomPageControlViewController.storyboard b/UIKitCatalog/Base.lproj/CustomPageControlViewController.storyboard new file mode 100755 index 0000000..6b60d8e --- /dev/null +++ b/UIKitCatalog/Base.lproj/CustomPageControlViewController.storyboard @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/UIKitCatalog/Base.lproj/CustomSearchBarViewController.storyboard b/UIKitCatalog/Base.lproj/CustomSearchBarViewController.storyboard new file mode 100755 index 0000000..bd83634 --- /dev/null +++ b/UIKitCatalog/Base.lproj/CustomSearchBarViewController.storyboard @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/UIKitCatalog/Base.lproj/CustomToolbarViewController.storyboard b/UIKitCatalog/Base.lproj/CustomToolbarViewController.storyboard new file mode 100755 index 0000000..80366b5 --- /dev/null +++ b/UIKitCatalog/Base.lproj/CustomToolbarViewController.storyboard @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/UIKitCatalog/Base.lproj/DatePickerController.storyboard b/UIKitCatalog/Base.lproj/DatePickerController.storyboard old mode 100644 new mode 100755 index ea030c7..2d752ae --- a/UIKitCatalog/Base.lproj/DatePickerController.storyboard +++ b/UIKitCatalog/Base.lproj/DatePickerController.storyboard @@ -1,16 +1,17 @@ - + - + + - + @@ -19,21 +20,21 @@ - + + - + - @@ -47,4 +48,12 @@ + + + + + + + + diff --git a/UIKitCatalog/Base.lproj/DefaultPageControlViewController.storyboard b/UIKitCatalog/Base.lproj/DefaultPageControlViewController.storyboard new file mode 100755 index 0000000..aac4dff --- /dev/null +++ b/UIKitCatalog/Base.lproj/DefaultPageControlViewController.storyboard @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/UIKitCatalog/Base.lproj/DefaultSearchBarViewController.storyboard b/UIKitCatalog/Base.lproj/DefaultSearchBarViewController.storyboard new file mode 100755 index 0000000..3053676 --- /dev/null +++ b/UIKitCatalog/Base.lproj/DefaultSearchBarViewController.storyboard @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + Title + Title + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/UIKitCatalog/Base.lproj/DefaultToolbarViewController.storyboard b/UIKitCatalog/Base.lproj/DefaultToolbarViewController.storyboard new file mode 100755 index 0000000..248ff50 --- /dev/null +++ b/UIKitCatalog/Base.lproj/DefaultToolbarViewController.storyboard @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/UIKitCatalog/Base.lproj/FontPickerViewController.storyboard b/UIKitCatalog/Base.lproj/FontPickerViewController.storyboard new file mode 100755 index 0000000..3459af1 --- /dev/null +++ b/UIKitCatalog/Base.lproj/FontPickerViewController.storyboard @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/UIKitCatalog/Base.lproj/ImagePickerViewController.storyboard b/UIKitCatalog/Base.lproj/ImagePickerViewController.storyboard new file mode 100755 index 0000000..c0c7476 --- /dev/null +++ b/UIKitCatalog/Base.lproj/ImagePickerViewController.storyboard @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/UIKitCatalog/Base.lproj/ImageViewController.storyboard b/UIKitCatalog/Base.lproj/ImageViewController.storyboard old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Base.lproj/InfoPlist.strings b/UIKitCatalog/Base.lproj/InfoPlist.strings old mode 100644 new mode 100755 index 8b1af5f..25c271e --- a/UIKitCatalog/Base.lproj/InfoPlist.strings +++ b/UIKitCatalog/Base.lproj/InfoPlist.strings @@ -5,5 +5,5 @@ Abstract: Localized versions of Info.plist keys. */ -CFBundleGetInfoString = "v15.0, Copyright 2008-2019, Apple Inc."; -NSHumanReadableCopyright = "Copyright © 2008-2019, Apple Inc."; +CFBundleGetInfoString = "v16.0, Copyright 2008-2020, Apple Inc."; +NSHumanReadableCopyright = "Copyright © 2008-2020, Apple Inc."; diff --git a/UIKitCatalog/Base.lproj/LaunchScreen.storyboard b/UIKitCatalog/Base.lproj/LaunchScreen.storyboard old mode 100644 new mode 100755 index 1ec8e6d..24eb015 --- a/UIKitCatalog/Base.lproj/LaunchScreen.storyboard +++ b/UIKitCatalog/Base.lproj/LaunchScreen.storyboard @@ -1,8 +1,8 @@ - + - + @@ -23,17 +23,17 @@ - + - + - + diff --git a/UIKitCatalog/Base.lproj/Localizable.strings b/UIKitCatalog/Base.lproj/Localizable.strings old mode 100644 new mode 100755 index 09fdffd..a1732cc --- a/UIKitCatalog/Base.lproj/Localizable.strings +++ b/UIKitCatalog/Base.lproj/Localizable.strings @@ -17,7 +17,6 @@ Strings used across the application via the NSLocalizedString API. "Button" = "Button"; "X Button" = "X Button"; "Image" = "Image"; -"Action" = "Action"; "bold" = "bold"; "highlighted" = "highlighted"; "underlined" = "underlined"; @@ -33,5 +32,49 @@ Strings used across the application via the NSLocalizedString API. "Gift" = "Gift"; "Burst" = "Burst"; -"UIKitCatalog" = "UIKitCatalog"; "An error occurred:" = "An error occurred:"; + +"ButtonsTitle" = "Buttons"; +"PageControlTitle" = "Page Controls"; +"SearchBarsTitle" = "Search Bars"; +"SegmentedControlsTitle" = "Segmented Controls"; +"SlidersTitle" = "Sliders"; +"SteppersTitle" = "Steppers"; +"SwitchesTitle" = "Switches"; +"TextFieldsTitle" = "Text Fields"; + +"ActivityIndicatorsTitle" = "Activity Indicators"; +"AlertControllersTitle" = "Alert Controllers"; +"ImageViewTitle" = "Image View"; +"ProgressViewsTitle" = "Progress Views"; +"StackViewsTitle" = "Stack Views"; +"TextViewTitle" = "Text View"; +"ToolbarsTitle" = "Toolbars"; +"WebViewTitle" = "Web View"; + +"DatePickerTitle" = "Date Picker"; +"PickerViewTitle" = "Picker View"; +"ColorPickerTitle" = "Color Picker"; +"FontPickerTitle" = "Font Picker"; +"ImagePickerTitle" = "Image Picker"; + +"DefaultSearchBarTitle" = "Default Search Bar"; +"CustomSearchBarTitle" = "Custom Search Bar"; + +"DefaultToolBarTitle" = "Default Toolbar"; +"TintedToolbarTitle" = "Tinted Toolbar"; +"CustomToolbarBarTitle" = "Custom Toolbar"; + +"ChooseItemTitle" = "Choose an item:"; +"ItemTitle" = "Item %@"; + +"SampleFontTitle" = "Sample Font"; + +"CheckTitle" = "Check"; +"SearchTitle" = "Search"; +"ToolsTitle" = "Tools"; + +"DefaultPageControlTitle" = "Page Control"; +"CustomPageControlTitle" = "Custom Page Control"; + + diff --git a/UIKitCatalog/Base.lproj/Main.storyboard b/UIKitCatalog/Base.lproj/Main.storyboard index 700b5c9..3c61f95 100755 --- a/UIKitCatalog/Base.lproj/Main.storyboard +++ b/UIKitCatalog/Base.lproj/Main.storyboard @@ -1,149 +1,105 @@ - - + + - + + + - - + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - + + - - - - - + + - - - - + - + - + - - + + - - - + + + - + - + - + + + + + + + + + + + + + + + + + - + - - + - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + diff --git a/UIKitCatalog/Base.lproj/PageControlViewController.storyboard b/UIKitCatalog/Base.lproj/PageControlViewController.storyboard deleted file mode 100644 index 901a0b0..0000000 --- a/UIKitCatalog/Base.lproj/PageControlViewController.storyboard +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/UIKitCatalog/Base.lproj/PickerViewController.storyboard b/UIKitCatalog/Base.lproj/PickerViewController.storyboard old mode 100644 new mode 100755 index f32f93d..f520951 --- a/UIKitCatalog/Base.lproj/PickerViewController.storyboard +++ b/UIKitCatalog/Base.lproj/PickerViewController.storyboard @@ -1,16 +1,18 @@ - + - + + - + + @@ -29,7 +31,8 @@ - + + @@ -38,18 +41,21 @@ - - + - - + + + + + + diff --git a/UIKitCatalog/Base.lproj/ProgressViewController.storyboard b/UIKitCatalog/Base.lproj/ProgressViewController.storyboard old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Base.lproj/SearchViewControllers.storyboard b/UIKitCatalog/Base.lproj/SearchViewControllers.storyboard deleted file mode 100644 index 9ce2687..0000000 --- a/UIKitCatalog/Base.lproj/SearchViewControllers.storyboard +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Title - Title - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/UIKitCatalog/Base.lproj/SegmentedControlViewController.storyboard b/UIKitCatalog/Base.lproj/SegmentedControlViewController.storyboard old mode 100644 new mode 100755 index 860eba8..67ae311 --- a/UIKitCatalog/Base.lproj/SegmentedControlViewController.storyboard +++ b/UIKitCatalog/Base.lproj/SegmentedControlViewController.storyboard @@ -1,8 +1,8 @@ - - + + - + @@ -13,7 +13,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -54,7 +54,7 @@ - + @@ -83,7 +83,7 @@ - + @@ -112,7 +112,7 @@ - + @@ -131,6 +131,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -140,6 +169,7 @@ + @@ -151,4 +181,9 @@ + + + + + diff --git a/UIKitCatalog/Base.lproj/SliderViewController.storyboard b/UIKitCatalog/Base.lproj/SliderViewController.storyboard old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Base.lproj/StackViewController.storyboard b/UIKitCatalog/Base.lproj/StackViewController.storyboard old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Base.lproj/StepperViewController.storyboard b/UIKitCatalog/Base.lproj/StepperViewController.storyboard old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Base.lproj/SwitchViewController.storyboard b/UIKitCatalog/Base.lproj/SwitchViewController.storyboard old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Base.lproj/TextFieldViewController.storyboard b/UIKitCatalog/Base.lproj/TextFieldViewController.storyboard old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Base.lproj/TextViewController.storyboard b/UIKitCatalog/Base.lproj/TextViewController.storyboard old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Base.lproj/TintedToolbarViewController.storyboard b/UIKitCatalog/Base.lproj/TintedToolbarViewController.storyboard new file mode 100755 index 0000000..b5b460b --- /dev/null +++ b/UIKitCatalog/Base.lproj/TintedToolbarViewController.storyboard @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/UIKitCatalog/Base.lproj/ToolbarViewControllers.storyboard b/UIKitCatalog/Base.lproj/ToolbarViewControllers.storyboard deleted file mode 100644 index 3eb720d..0000000 --- a/UIKitCatalog/Base.lproj/ToolbarViewControllers.storyboard +++ /dev/null @@ -1,204 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/UIKitCatalog/Base.lproj/WebViewController.storyboard b/UIKitCatalog/Base.lproj/WebViewController.storyboard old mode 100644 new mode 100755 diff --git a/UIKitCatalog/Base.lproj/content.html b/UIKitCatalog/Base.lproj/content.html old mode 100644 new mode 100755 diff --git a/UIKitCatalog/BaseTableViewController.swift b/UIKitCatalog/BaseTableViewController.swift deleted file mode 100644 index 627173c..0000000 --- a/UIKitCatalog/BaseTableViewController.swift +++ /dev/null @@ -1,114 +0,0 @@ -/* -See LICENSE folder for this sample’s licensing information. - -Abstract: -Base class for any UITableViewController that is the master of the split view controller for - adaptability between regular and compact mode. -*/ - -import UIKit - -class BaseTableViewController: UITableViewController { - var savedSelectionIndexPath: IndexPath? - private var detailTargetChange: NSObjectProtocol! - - // MARK: - View Life Cycle - - override func viewDidLoad() { - super.viewDidLoad() - - navigationController?.delegate = self // So we can listen when we come and go on the nav stack. - - detailTargetChange = NotificationCenter.default.addObserver( - forName: UIViewController.showDetailTargetDidChangeNotification, - object: nil, - queue: OperationQueue.main) { [weak self] (_) in - // Whenever the target for showDetailViewController changes, update all of our cells - // to ensure they have the right accessory type. - // - guard let self = self else { return } - - for cell in self.tableView.visibleCells { - let indexPath = self.tableView.indexPath(for: cell) - self.tableView.delegate?.tableView!(self.tableView, willDisplay: cell, forRowAt: indexPath!) - } - } - } - - override func viewWillAppear(_ animated: Bool) { - clearsSelectionOnViewWillAppear = splitViewController!.isCollapsed - super.viewWillAppear(animated) - } - - // MARK: Utility functions - - func configureCell(cell: UITableViewCell, indexPath: IndexPath) { - // For subclasses to override. - } - - func isTwoLevelCell(indexPath: IndexPath) -> Bool { - // For subclasses to override. - return false - } - - func splitViewWantsToShowDetail() -> Bool { - return splitViewController?.traitCollection.horizontalSizeClass == .regular - } - - func pushOrPresentViewController(viewController: UIViewController, cellIndexPath: IndexPath) { - if splitViewWantsToShowDetail() { - if isTwoLevelCell(indexPath: cellIndexPath) { - navigationController?.pushViewController(viewController, animated: true) // Just push instead of replace. - tableView.deselectRow(at: cellIndexPath, animated: false) - } else { - let navVC = UINavigationController(rootViewController: viewController) - splitViewController?.showDetailViewController(navVC, sender: navVC) // Replace the detail view controller. - } - } else { - navigationController?.pushViewController(viewController, animated: true) // Just push instead of replace. - } - } - - func pushOrPresentStoryboard(storyboardName: String, cellIndexPath: IndexPath) { - let exampleStoryboard = UIStoryboard(name: storyboardName, bundle: nil) - if let exampleViewController = exampleStoryboard.instantiateInitialViewController() { - pushOrPresentViewController(viewController: exampleViewController, cellIndexPath: cellIndexPath) - } - } - -} - -// MARK: - UITableViewDelegate - -extension BaseTableViewController { - override func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) { - if splitViewWantsToShowDetail() { - cell.accessoryType = .none - if self.savedSelectionIndexPath != nil { - self.tableView.selectRow(at: savedSelectionIndexPath, animated: true, scrollPosition: .none) - } - } else { - cell.accessoryType = .disclosureIndicator - tableView.deselectRow(at: indexPath, animated: false) - } - - configureCell(cell: cell, indexPath: indexPath as IndexPath) - } - - override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { - savedSelectionIndexPath = indexPath - } - -} - -// MARK: - UINavigationControllerDelegate - -extension BaseTableViewController: UINavigationControllerDelegate { - func navigationController(_ navigationController: UINavigationController, didShow viewController: UIViewController, animated: Bool) { - if viewController == self { - // We re-appeared on the nav stack (likely because we manually popped) so our saved selection should be cleared. - savedSelectionIndexPath = nil - } - } - -} diff --git a/UIKitCatalog/ButtonViewController.swift b/UIKitCatalog/ButtonViewController.swift old mode 100644 new mode 100755 index 8db6d91..a380b0d --- a/UIKitCatalog/ButtonViewController.swift +++ b/UIKitCatalog/ButtonViewController.swift @@ -21,6 +21,7 @@ class ButtonViewController: UITableViewController { @IBOutlet weak var attributedTextButton: UIButton! @IBOutlet weak var symbolButton: UIButton! @IBOutlet weak var symbolTextButton: UIButton! + @IBOutlet weak var menuButton: UIButton! // MARK: - View Life Cycle @@ -35,6 +36,7 @@ class ButtonViewController: UITableViewController { configureAttributedTextSystemButton() configureSymbolButton() configureSymbolTextButton() + configureMenuButton() } // MARK: - Configuration @@ -124,6 +126,21 @@ class ButtonViewController: UITableViewController { symbolTextButton.setPreferredSymbolConfiguration(config, forImageIn: .normal) } + func menuHandler(action: UIAction) { + Swift.debugPrint("Menu Action '\(action.title)'") + } + + func configureMenuButton() { + let buttonTitle = NSLocalizedString("Button", comment: "") + menuButton.setTitle(buttonTitle, for: .normal) + + let items = (1...5).map { + UIAction(title: String(format: NSLocalizedString("ItemTitle", comment: ""), $0.description), handler: menuHandler) + } + menuButton.menu = UIMenu(title: NSLocalizedString("ChooseItemTitle", comment: ""), children: items) + menuButton.showsMenuAsPrimaryAction = true + } + // MARK: - Actions @objc @@ -131,3 +148,4 @@ class ButtonViewController: UITableViewController { print("A button was clicked: \(sender).") } } + diff --git a/UIKitCatalog/ColorPickerViewController.swift b/UIKitCatalog/ColorPickerViewController.swift new file mode 100755 index 0000000..7d30f19 --- /dev/null +++ b/UIKitCatalog/ColorPickerViewController.swift @@ -0,0 +1,66 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view controller that demonstrates how to use `UIColorPickerViewController`. +*/ + +import UIKit + +class ColorPickerViewController: UIViewController, UIColorPickerViewControllerDelegate { + + // MARK: - Properties + + var colorPicker: UIColorPickerViewController! + @IBOutlet var colorView: UIView! + + // MARK: - View Life Cycle + + override func viewDidLoad() { + super.viewDidLoad() + + configureColorPicker() + } + + func configureColorPicker() { + colorPicker = UIColorPickerViewController() + colorPicker.supportsAlpha = true + colorPicker.selectedColor = UIColor.blue + colorPicker.delegate = self + } + + @IBAction func presentColorPicker(_: AnyObject) { + present(colorPicker, animated: true, completion: nil) + } + + // MARK: - UIColorPickerViewControllerDelegate + + func colorPickerViewControllerDidSelectColor(_ viewController: UIColorPickerViewController) { + // User has chosen a color. + let chosenColor = viewController.selectedColor + colorView.backgroundColor = chosenColor + + Swift.debugPrint("\(chosenColor)") + } + + func colorPickerViewControllerDidFinish(_ viewController: UIColorPickerViewController) { + /** In presentations (except popovers) the color picker shows a close button. If the close button is tapped, + the view controller is dismissed and `colorPickerViewControllerDidFinish:` is called. Can be used to + animate alongside the dismissal. + */ + } + +} + +extension UIColor { + var colorComponents: (red: CGFloat, green: CGFloat, blue: CGFloat, alpha: CGFloat)? { + guard let components = self.cgColor.components else { return nil } + + return ( + red: components[0], + green: components[1], + blue: components[2], + alpha: components[3] + ) + } +} diff --git a/UIKitCatalog/CustomPageControlViewController.swift b/UIKitCatalog/CustomPageControlViewController.swift new file mode 100755 index 0000000..7f2d316 --- /dev/null +++ b/UIKitCatalog/CustomPageControlViewController.swift @@ -0,0 +1,92 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view controller that demonstrates how to use a customized `UIPageControl`. +*/ + +import UIKit + +class CustomPageControlViewController: UIViewController { + // MARK: - Properties + + @IBOutlet weak var pageControl: UIPageControl! + + @IBOutlet weak var colorView: UIView! + + // Colors that correspond to the selected page. Used as the background color for `colorView`. + let colors = [ + UIColor.black, + UIColor.systemGray, + UIColor.systemRed, + UIColor.systemGreen, + UIColor.systemBlue, + UIColor.systemPink, + UIColor.systemYellow, + UIColor.systemIndigo, + UIColor.systemOrange, + UIColor.systemPurple, + UIColor.systemGray2, + UIColor.systemGray3, + UIColor.systemGray4, + UIColor.systemGray5 + ] + + let images = [ + UIImage(systemName: "square.fill"), + UIImage(systemName: "square"), + UIImage(systemName: "triangle.fill"), + UIImage(systemName: "triangle"), + UIImage(systemName: "circle.fill"), + UIImage(systemName: "circle"), + UIImage(systemName: "star.fill"), + UIImage(systemName: "star"), + UIImage(systemName: "staroflife"), + UIImage(systemName: "staroflife.fill"), + UIImage(systemName: "heart.fill"), + UIImage(systemName: "heart"), + UIImage(systemName: "moon"), + UIImage(systemName: "moon.fill") + ] + + // MARK: - View Life Cycle + + override func viewDidLoad() { + super.viewDidLoad() + + configurePageControl() + pageControlValueDidChange() + } + + // MARK: - Configuration + + func configurePageControl() { + // The total number of available pages is based on the number of available colors. + pageControl.numberOfPages = colors.count + pageControl.currentPage = 2 + + pageControl.currentPageIndicatorTintColor = UIColor.systemPurple + + // Prominent background style. + pageControl.backgroundStyle = .prominent + + // Set custom indicator images. + for (index, image) in images.enumerated() { + pageControl.setIndicatorImage(image, forPage: index) + } + + pageControl.addTarget(self, + action: #selector(PageControlViewController.pageControlValueDidChange), + for: .valueChanged) + } + + // MARK: - Actions + + @objc + func pageControlValueDidChange() { + // Note: gesture swiping between pages is provided by `UIPageViewController` and not `UIPageControl`. + print("The page control changed its current page to \(pageControl.currentPage).") + + colorView.backgroundColor = colors[pageControl.currentPage] + } +} diff --git a/UIKitCatalog/CustomSearchBarViewController.swift b/UIKitCatalog/CustomSearchBarViewController.swift old mode 100644 new mode 100755 diff --git a/UIKitCatalog/CustomToolbarViewController.swift b/UIKitCatalog/CustomToolbarViewController.swift old mode 100644 new mode 100755 diff --git a/UIKitCatalog/DatePickerController.swift b/UIKitCatalog/DatePickerController.swift old mode 100644 new mode 100755 index f131adf..3a39a7f --- a/UIKitCatalog/DatePickerController.swift +++ b/UIKitCatalog/DatePickerController.swift @@ -43,6 +43,9 @@ class DatePickerController: UIViewController { let now = Date() datePicker.minimumDate = now + // Decide the best date picker style based on the trait collection's vertical size. + datePicker.preferredDatePickerStyle = traitCollection.verticalSizeClass == .compact ? .compact : .inline + var dateComponents = DateComponents() dateComponents.day = 7 @@ -56,10 +59,18 @@ class DatePickerController: UIViewController { updateDatePickerLabel() } + override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { + // Adjust the date picker style due to the trait collection's vertical size. + super.traitCollectionDidChange(previousTraitCollection) + datePicker.preferredDatePickerStyle = traitCollection.verticalSizeClass == .compact ? .compact : .inline + } + // MARK: - Actions @objc func updateDatePickerLabel() { dateLabel.text = dateFormatter.string(from: datePicker.date) + + Swift.debugPrint("Chosen date: \(dateFormatter.string(from: datePicker.date))") } } diff --git a/UIKitCatalog/PageControlViewController.swift b/UIKitCatalog/DefaultPageControlViewController.swift old mode 100644 new mode 100755 similarity index 99% rename from UIKitCatalog/PageControlViewController.swift rename to UIKitCatalog/DefaultPageControlViewController.swift index 79577e8..65c5ca6 --- a/UIKitCatalog/PageControlViewController.swift +++ b/UIKitCatalog/DefaultPageControlViewController.swift @@ -46,7 +46,7 @@ class PageControlViewController: UIViewController { pageControl.pageIndicatorTintColor = UIColor.systemGreen pageControl.currentPageIndicatorTintColor = UIColor.systemPurple - + pageControl.addTarget(self, action: #selector(PageControlViewController.pageControlValueDidChange), for: .valueChanged) } diff --git a/UIKitCatalog/DefaultSearchBarViewController.swift b/UIKitCatalog/DefaultSearchBarViewController.swift old mode 100644 new mode 100755 diff --git a/UIKitCatalog/DefaultToolbarViewController.swift b/UIKitCatalog/DefaultToolbarViewController.swift old mode 100644 new mode 100755 index 72aeea3..bd7839a --- a/UIKitCatalog/DefaultToolbarViewController.swift +++ b/UIKitCatalog/DefaultToolbarViewController.swift @@ -39,12 +39,16 @@ class DefaultToolbarViewController: UIViewController { action: nil) } + func menuHandler(action: UIAction) { + Swift.debugPrint("Menu Action '\(action.title)'") + } + var customTitleBarButtonItem: UIBarButtonItem { - let customTitle = NSLocalizedString("Action", comment: "") - return UIBarButtonItem(title: customTitle, - style: .plain, - target: self, - action: #selector(DefaultToolbarViewController.barButtonItemClicked(_:))) + let buttonMenu = UIMenu(title: "", + children: (1...5).map { + UIAction(title: "Option \($0)", handler: menuHandler) + }) + return UIBarButtonItem(image: UIImage(systemName: "list.number"), menu: buttonMenu) } // MARK: - Actions diff --git a/UIKitCatalog/DetailViewManager.swift b/UIKitCatalog/DetailViewManager.swift deleted file mode 100644 index e5c35d4..0000000 --- a/UIKitCatalog/DetailViewManager.swift +++ /dev/null @@ -1,76 +0,0 @@ -/* -See LICENSE folder for this sample’s licensing information. - -Abstract: -Manages how to handle the detail view controller for our split view controller. -*/ - -import UIKit - -class DetailViewManager: NSObject, UISplitViewControllerDelegate { - var splitViewController: UISplitViewController? = nil { - didSet { - splitViewController?.delegate = self - splitViewController?.preferredDisplayMode = .allVisible - } - } - - /// Swaps out the detail for view controller for the Split View Controller this instance is managing. - func setDetailViewController(detailViewController: UIViewController) { - var viewControllers: [UIViewController] = (splitViewController?.viewControllers)! - if viewControllers.count > 1 { - viewControllers[1] = detailViewController - } - splitViewController?.viewControllers = viewControllers - } - - /** Set the default plain detail view controller (called by PageOneViewController, - that is, in case a selected item is deleted in a split view controller) - */ - func setDefaultDetailViewController() { - let initialDetailViewController = splitViewController?.storyboard?.instantiateViewController(withIdentifier: "navInitialDetail") - setDetailViewController(detailViewController: initialDetailViewController!) - } - - // MARK: - UISplitViewControllerDelegate - - func targetDisplayModeForAction(in splitViewController: UISplitViewController) -> UISplitViewController.DisplayMode { - return .allVisible - } - - func splitViewController(_ splitViewController: UISplitViewController, - collapseSecondary secondaryViewController: UIViewController, - onto primaryViewController: UIViewController) -> Bool { - return true - } - - func splitViewController(_ splitViewController: UISplitViewController, - separateSecondaryFrom primaryViewController: UIViewController) -> UIViewController? { - var returnSecondaryVC: UIViewController? = nil - - if let primaryVC = primaryViewController as? UINavigationController { - let selectedVC = primaryVC.topViewController - if selectedVC is UINavigationController { - if let navVC = selectedVC as? UINavigationController { - let currentVC = navVC.visibleViewController - - if currentVC?.popDueToSizeChange != nil { - currentVC?.popDueToSizeChange() - } - - // The currentVC has popped, now obtain it's ancestor vc in the table. - let currentVC2 = navVC.visibleViewController - if currentVC2 is BaseTableViewController { - let baseTableViewVC = currentVC2 as? BaseTableViewController - if baseTableViewVC?.tableView.indexPathForSelectedRow == nil { - // The table has no selection, make the detail empty. - returnSecondaryVC = splitViewController.storyboard?.instantiateViewController(withIdentifier: "navInitialDetail") - } - } - } - } - } - - return returnSecondaryVC - } -} diff --git a/UIKitCatalog/FontPickerViewController.swift b/UIKitCatalog/FontPickerViewController.swift new file mode 100755 index 0000000..a72572d --- /dev/null +++ b/UIKitCatalog/FontPickerViewController.swift @@ -0,0 +1,54 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view controller that demonstrates how to use `UIFontPickerViewController`. +*/ + +import UIKit + +class FontPickerViewController: UIViewController, UIFontPickerViewControllerDelegate { + + // MARK: - Properties + + var fontPicker: UIFontPickerViewController! + @IBOutlet var fontLabel: UILabel! + + // MARK: - View Life Cycle + + override func viewDidLoad() { + super.viewDidLoad() + + configureFontPicker() + } + + func configureFontPicker() { + let configuration = UIFontPickerViewController.Configuration() + configuration.includeFaces = true + configuration.displayUsingSystemFont = false + configuration.filteredTraits = [.classModernSerifs] + + fontPicker = UIFontPickerViewController(configuration: configuration) + fontPicker.delegate = self + } + + @IBAction func presentFontPicker(_: AnyObject) { + present(fontPicker, animated: true) + } + + // MARK: - UIFontPickerViewControllerDelegate + + func fontPickerViewControllerDidCancel(_ viewController: UIFontPickerViewController) { + //.. + } + + func fontPickerViewControllerDidPickFont(_ viewController: UIFontPickerViewController) { + guard let fontDescriptor = viewController.selectedFontDescriptor else { return } + let font = UIFont(descriptor: fontDescriptor, size: 48.0) + fontLabel.font = font + fontLabel.text = NSLocalizedString("SampleFontTitle", comment: "") + + Swift.debugPrint("Chosen font: \(font)") + } + +} diff --git a/UIKitCatalog/ImagePickerViewController.swift b/UIKitCatalog/ImagePickerViewController.swift new file mode 100755 index 0000000..b2bb197 --- /dev/null +++ b/UIKitCatalog/ImagePickerViewController.swift @@ -0,0 +1,45 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A view controller that demonstrates how to use `UIFontPickerViewController`. +*/ + +import UIKit + +class ImagePickerViewController: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate { + + // MARK: - Properties + var imagePicker: UIImagePickerController! + @IBOutlet var imageView: UIImageView! + + // MARK: - View Life Cycle + + override func viewDidLoad() { + super.viewDidLoad() + + configureImagePicker() + } + + func configureImagePicker() { + imagePicker = UIImagePickerController() + imagePicker.delegate = self + imagePicker.mediaTypes = ["public.image"] + imagePicker.sourceType = .photoLibrary + } + + @IBAction func presentImagePicker(_: AnyObject) { + present(imagePicker, animated: true) + } + + // MARK: - UIImagePickerControllerDelegate + + func imagePickerController(_ picker: UIImagePickerController, + didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey: Any]) { + if let image = info[UIImagePickerController.InfoKey.originalImage] as? UIImage { + imageView.image = image + } + picker.dismiss(animated: true, completion: nil) + } + +} diff --git a/UIKitCatalog/ImageViewController.swift b/UIKitCatalog/ImageViewController.swift old mode 100644 new mode 100755 diff --git a/UIKitCatalog/MasterViewController.swift b/UIKitCatalog/MasterViewController.swift deleted file mode 100644 index a02b935..0000000 --- a/UIKitCatalog/MasterViewController.swift +++ /dev/null @@ -1,92 +0,0 @@ -/* -See LICENSE folder for this sample’s licensing information. - -Abstract: -The primary table view controller displaying all the UIKit examples. -*/ - -import UIKit - -class MasterViewController: BaseTableViewController { - - struct Example { - var title: String - var subTitle: String - var twoLevel: Bool - } - - var exampleList = [ - // This is a list of examples offered by this sample. - Example(title: "Activity Indicators", subTitle: "ActivityIndicatorViewController", twoLevel: false), - Example(title: "Alert Controller", subTitle: "AlertControllerViewController", twoLevel: false), - Example(title: "Buttons", subTitle: "ButtonViewController", twoLevel: false), - Example(title: "Date Picker", subTitle: "DatePickerController", twoLevel: false), - Example(title: "Image View", subTitle: "ImageViewController", twoLevel: false), - Example(title: "Page Control", subTitle: "PageControlViewController", twoLevel: false), - Example(title: "Picker View", subTitle: "PickerViewController", twoLevel: false), - Example(title: "Progress Views", subTitle: "ProgressViewController", twoLevel: false), - Example(title: "Search", subTitle: "SearchViewControllers", twoLevel: true), - Example(title: "Segmented Controls", subTitle: "SegmentedControlViewController", twoLevel: false), - Example(title: "Sliders", subTitle: "SliderViewController", twoLevel: false), - Example(title: "Stack Views", subTitle: "StackViewController", twoLevel: false), - Example(title: "Steppers", subTitle: "StepperViewController", twoLevel: false), - Example(title: "Switches", subTitle: "SwitchViewController", twoLevel: false), - Example(title: "Text Fields", subTitle: "TextFieldViewController", twoLevel: false), - Example(title: "Text View", subTitle: "TextViewController", twoLevel: false), - Example(title: "Toolbars", subTitle: "ToolbarViewControllers", twoLevel: true), - Example(title: "Web View", subTitle: "WebViewController", twoLevel: false) - ] - - override func viewDidLoad() { - super.viewDidLoad() - //.. - } - - override func isTwoLevelCell(indexPath: IndexPath) -> Bool { - var twoLevelCell = false - twoLevelCell = exampleList[indexPath.row].twoLevel - return twoLevelCell - } - - override func configureCell(cell: UITableViewCell, indexPath: IndexPath) { - let splitViewWantsToShowDetail = splitViewController?.traitCollection.horizontalSizeClass == .regular - if splitViewWantsToShowDetail { - if isTwoLevelCell(indexPath: indexPath) { - cell.accessoryType = .disclosureIndicator - } - } else { - // For two level table views in split view master/detail mode we don't navigate but just present. - if isTwoLevelCell(indexPath: indexPath) { - cell.accessoryType = isTwoLevelCell(indexPath: indexPath) ? .disclosureIndicator : .none - } - } - } - -} - -// MARK: - UITableViewDataSource - -extension MasterViewController { - override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - return exampleList.count - } - - override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) - let example = exampleList[indexPath.row] - cell.textLabel?.text = example.title - cell.detailTextLabel?.text = example.subTitle - return cell - } -} - -// MARK: - UITableViewDelegate - -extension MasterViewController { - override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { - let example = exampleList[indexPath.row] - pushOrPresentStoryboard(storyboardName: example.subTitle, cellIndexPath: indexPath) - } - -} - diff --git a/UIKitCatalog/OutlineViewController.swift b/UIKitCatalog/OutlineViewController.swift new file mode 100755 index 0000000..81579b7 --- /dev/null +++ b/UIKitCatalog/OutlineViewController.swift @@ -0,0 +1,259 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +A simple outline view for the sample app's main UI +*/ + +import UIKit + +class OutlineViewController: UIViewController { + + enum Section { + case main + } + + class OutlineItem: Identifiable, Hashable { + let title: String + let subitems: [OutlineItem] + let storyboardName: String? + let imageName: String? + + init(title: String, imageName: String?, storyboardName: String? = nil, subitems: [OutlineItem] = []) { + self.title = title + self.subitems = subitems + self.storyboardName = storyboardName + self.imageName = imageName + } + + func hash(into hasher: inout Hasher) { + hasher.combine(id) + } + + static func == (lhs: OutlineItem, rhs: OutlineItem) -> Bool { + return lhs.id == rhs.id + } + + } + + var dataSource: UICollectionViewDiffableDataSource! = nil + var outlineCollectionView: UICollectionView! = nil + + override func viewDidLoad() { + super.viewDidLoad() + + configureCollectionView() + configureDataSource() + + // Listen for when a split view controller is expanded or collapsed. + NotificationCenter.default.addObserver(self, + selector: #selector(showDetailTargetDidChange(_:)), + name: UIViewController.showDetailTargetDidChangeNotification, + object: nil) + } + + // Posted when a split view controller is expanded or collapsed. + @objc + func showDetailTargetDidChange(_ notification: NSNotification) { + // Reaload the data source, the disclosure indicators need to change (push vs. present on a cell). + var snapshot = dataSource.snapshot() + snapshot.reloadItems(menuItems) + dataSource.apply(snapshot, animatingDifferences: false) + } + + deinit { + NotificationCenter.default.removeObserver(self, name: UIViewController.showDetailTargetDidChangeNotification, object: nil) + } + + private lazy var menuItems: [OutlineItem] = { + return [ + OutlineItem(title: "Controls", imageName: "slider.horizontal.3", subitems: [ + OutlineItem(title: NSLocalizedString("ButtonsTitle", comment: ""), imageName: nil, + storyboardName: "ButtonViewController"), + + OutlineItem(title: NSLocalizedString("PageControlTitle", comment: ""), imageName: nil, subitems: [ + OutlineItem(title: NSLocalizedString("DefaultPageControlTitle", comment: ""), imageName: nil, + storyboardName: "DefaultPageControlViewController"), + OutlineItem(title: NSLocalizedString("CustomPageControlTitle", comment: ""), imageName: nil, + storyboardName: "CustomPageControlViewController") + ]), + + OutlineItem(title: NSLocalizedString("SearchBarsTitle", comment: ""), imageName: nil, subitems: [ + OutlineItem(title: NSLocalizedString("DefaultSearchBarTitle", comment: ""), imageName: nil, + storyboardName: "DefaultSearchBarViewController"), + OutlineItem(title: NSLocalizedString("CustomSearchBarTitle", comment: ""), imageName: nil, + storyboardName: "CustomSearchBarViewController") + ]), + + OutlineItem(title: NSLocalizedString("SegmentedControlsTitle", comment: ""), imageName: nil, + storyboardName: "SegmentedControlViewController"), + OutlineItem(title: NSLocalizedString("SlidersTitle", comment: ""), imageName: nil, + storyboardName: "SliderViewController"), + OutlineItem(title: NSLocalizedString("SteppersTitle", comment: ""), imageName: nil, + storyboardName: "StepperViewController"), + OutlineItem(title: NSLocalizedString("SwitchesTitle", comment: ""), imageName: nil, + storyboardName: "SwitchViewController"), + OutlineItem(title: NSLocalizedString("TextFieldsTitle", comment: ""), imageName: nil, + storyboardName: "TextFieldViewController") + ]), + + OutlineItem(title: "Views", imageName: "rectangle.stack.person.crop", subitems: [ + OutlineItem(title: NSLocalizedString("ActivityIndicatorsTitle", comment: ""), imageName: nil, + storyboardName: "ActivityIndicatorViewController"), + OutlineItem(title: NSLocalizedString("AlertControllersTitle", comment: ""), imageName: nil, + storyboardName: "AlertControllerViewController"), + OutlineItem(title: NSLocalizedString("ImageViewTitle", comment: ""), imageName: nil, + storyboardName: "ImageViewController"), + OutlineItem(title: NSLocalizedString("ProgressViewsTitle", comment: ""), imageName: nil, + storyboardName: "ProgressViewController"), + OutlineItem(title: NSLocalizedString("StackViewsTitle", comment: ""), imageName: nil, + storyboardName: "StackViewController"), + + OutlineItem(title: NSLocalizedString("ToolbarsTitle", comment: ""), imageName: nil, subitems: [ + OutlineItem(title: NSLocalizedString("DefaultToolBarTitle", comment: ""), imageName: nil, + storyboardName: "DefaultToolbarViewController"), + OutlineItem(title: NSLocalizedString("TintedToolbarTitle", comment: ""), imageName: nil, + storyboardName: "TintedToolbarViewController"), + OutlineItem(title: NSLocalizedString("CustomToolbarBarTitle", comment: ""), imageName: nil, + storyboardName: "CustomToolbarViewController") + ]), + + OutlineItem(title: NSLocalizedString("WebViewTitle", comment: ""), imageName: nil, + storyboardName: "WebViewController") + ]), + + OutlineItem(title: "Pickers", imageName: "list.bullet", subitems: [ + OutlineItem(title: NSLocalizedString("DatePickerTitle", comment: ""), imageName: nil, + storyboardName: "DatePickerController"), + OutlineItem(title: NSLocalizedString("PickerViewTitle", comment: ""), imageName: nil, + storyboardName: "PickerViewController"), + OutlineItem(title: NSLocalizedString("ColorPickerTitle", comment: ""), imageName: nil, + storyboardName: "ColorPickerViewController"), + OutlineItem(title: NSLocalizedString("FontPickerTitle", comment: ""), imageName: nil, + storyboardName: "FontPickerViewController"), + OutlineItem(title: NSLocalizedString("ImagePickerTitle", comment: ""), imageName: nil, + storyboardName: "ImagePickerViewController") + ]) + ] + }() + +} + +// MARK: - UICollectionViewDiffableDataSource + +extension OutlineViewController { + + private func configureCollectionView() { + let collectionView = + UICollectionView(frame: view.bounds, collectionViewLayout: generateLayout()) + view.addSubview(collectionView) + collectionView.autoresizingMask = [.flexibleHeight, .flexibleWidth] + collectionView.backgroundColor = .systemBackground + self.outlineCollectionView = collectionView + collectionView.delegate = self + } + + private func configureDataSource() { + + let containerCellRegistration = UICollectionView.CellRegistration { (cell, indexPath, menuItem) in + + var contentConfiguration = cell.defaultContentConfiguration() + contentConfiguration.text = menuItem.title + + if menuItem.imageName != nil { + contentConfiguration.image = UIImage(systemName: menuItem.imageName!) + } + + contentConfiguration.textProperties.font = .preferredFont(forTextStyle: .headline) + cell.contentConfiguration = contentConfiguration + + let disclosureOptions = UICellAccessory.OutlineDisclosureOptions(style: .header) + cell.accessories = [.outlineDisclosure(options:disclosureOptions)] + + let background = UIBackgroundConfiguration.clear() + cell.backgroundConfiguration = background + } + + let cellRegistration = UICollectionView.CellRegistration { cell, indexPath, menuItem in + var content = UIListContentConfiguration.cell() + content.text = menuItem.title + cell.contentConfiguration = content + + let background = UIBackgroundConfiguration.clear() + cell.backgroundConfiguration = background + + cell.accessories = self.splitViewWantsToShowDetail() ? [] : [.disclosureIndicator()] + } + + dataSource = UICollectionViewDiffableDataSource(collectionView: outlineCollectionView) { + (collectionView: UICollectionView, indexPath: IndexPath, item: OutlineItem) -> UICollectionViewCell? in + // Return the cell. + if item.subitems.isEmpty { + return collectionView.dequeueConfiguredReusableCell(using: cellRegistration, for: indexPath, item: item) + } else { + return collectionView.dequeueConfiguredReusableCell(using: containerCellRegistration, for: indexPath, item: item) + } + } + + // Load our initial data. + let snapshot = initialSnapshot() + self.dataSource.apply(snapshot, to: .main, animatingDifferences: false) + } + + private func generateLayout() -> UICollectionViewLayout { + let listConfiguration = UICollectionLayoutListConfiguration(appearance: .sidebar) + let layout = UICollectionViewCompositionalLayout.list(using: listConfiguration) + return layout + } + + private func initialSnapshot() -> NSDiffableDataSourceSectionSnapshot { + var snapshot = NSDiffableDataSourceSectionSnapshot() + + func addItems(_ menuItems: [OutlineItem], to parent: OutlineItem?) { + snapshot.append(menuItems, to: parent) + for menuItem in menuItems where !menuItem.subitems.isEmpty { + addItems(menuItem.subitems, to: menuItem) + } + } + + addItems(menuItems, to: nil) + return snapshot + } + +} + +// MARK: - UICollectionViewDelegate + +extension OutlineViewController: UICollectionViewDelegate { + + private func splitViewWantsToShowDetail() -> Bool { + return splitViewController?.traitCollection.horizontalSizeClass == .regular + } + + private func pushOrPresentViewController(viewController: UIViewController) { + if splitViewWantsToShowDetail() { + let navVC = UINavigationController(rootViewController: viewController) + splitViewController?.showDetailViewController(navVC, sender: navVC) // Replace the detail view controller. + } else { + navigationController?.pushViewController(viewController, animated: true) // Just push instead of replace. + } + } + + private func pushOrPresentStoryboard(storyboardName: String) { + let exampleStoryboard = UIStoryboard(name: storyboardName, bundle: nil) + if let exampleViewController = exampleStoryboard.instantiateInitialViewController() { + pushOrPresentViewController(viewController: exampleViewController) + } + } + + func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { + guard let menuItem = self.dataSource.itemIdentifier(for: indexPath) else { return } + + collectionView.deselectItem(at: indexPath, animated: true) + + if let storyboardName = menuItem.storyboardName { + pushOrPresentStoryboard(storyboardName: storyboardName) + } + } + +} diff --git a/UIKitCatalog/PickerViewController.swift b/UIKitCatalog/PickerViewController.swift old mode 100644 new mode 100755 diff --git a/UIKitCatalog/ProgressViewController.swift b/UIKitCatalog/ProgressViewController.swift old mode 100644 new mode 100755 diff --git a/UIKitCatalog/SceneDelegate.swift b/UIKitCatalog/SceneDelegate.swift new file mode 100755 index 0000000..a7546d1 --- /dev/null +++ b/UIKitCatalog/SceneDelegate.swift @@ -0,0 +1,74 @@ +/* +See LICENSE folder for this sample’s licensing information. + +Abstract: +This class demonstrates how to use the scene delegate to configure a scene's interface. +*/ + +import UIKit + +class SceneDelegate: UIResponder, UIWindowSceneDelegate, UISplitViewControllerDelegate { + var window: UIWindow? + + /** Applications should configure their UIWindow, and attach the UIWindow to the provided UIWindowScene scene. + + Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + + If using a storyboard file (as specified by the Info.plist key, UISceneStoryboardFile, + the window property will automatically be configured and attached to the windowScene. + + Remember to retain the SceneDelegate 's UIWindow. + The recommended approach is for the SceneDelegate to retain the scene's window. + */ + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + if let splitViewController = window!.rootViewController as? UISplitViewController { + splitViewController.delegate = self + splitViewController.preferredDisplayMode = .oneBesideSecondary + } + } + + /** Called as the scene is being released by the system or on window close. + This occurs shortly after the scene enters the background, or when its session is discarded. + Release any resources associated with this scene that can be re-created the next time the scene connects. + The scene may re-connect later, as its session was not neccessarily discarded (see`application:didDiscardSceneSessions` instead). + */ + func sceneDidDisconnect(_ scene: UIScene) { + } + + /** Called as the scene transitions from the background to the foreground, + on window open or in iOS resume. + Use this method to undo the changes made on entering the background. + */ + func sceneWillEnterForeground(_ scene: UIScene) { + } + + /** Called as the scene transitions from the foreground to the background. + Use this method to save data, release shared resources, and store enough scene-specific state information + to restore the scene back to its current state. + */ + func sceneDidEnterBackground(_ scene: UIScene) { + } + + /** Called when the scene "will move" from an active state to an inactive state, + on window close or in iOS enter background. + This may occur due to temporary interruptions (ex. an incoming phone call). + */ + func sceneWillResignActive(_ scene: UIScene) { + } + + /** Called when the scene "has moved" from an inactive state to an active state. + Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. + Is called every time a scene becomes active, so setup your scene UI here. + */ + func sceneDidBecomeActive(_ scene: UIScene) { + } + + // MARK: - UISplitViewControllerDelegate + + func splitViewController(_ splitViewController: UISplitViewController, + collapseSecondary secondaryViewController: UIViewController, + onto primaryViewController: UIViewController) -> Bool { + // Return true to prevent UIKit from applying its default behavior. + return true + } +} diff --git a/UIKitCatalog/SearchBarsTableViewController.swift b/UIKitCatalog/SearchBarsTableViewController.swift deleted file mode 100644 index 87116c4..0000000 --- a/UIKitCatalog/SearchBarsTableViewController.swift +++ /dev/null @@ -1,30 +0,0 @@ -/* -See LICENSE folder for this sample’s licensing information. - -Abstract: -Table view controller for presenting various search bars. -*/ - -import UIKit - -class SearchBarsTableViewController: BaseTableViewController { - // MARK: - UITableViewDelegate - - override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { - var storyboardSceneID = String() - - switch indexPath.row { - case 0: - // Default - storyboardSceneID = "DefaultSearchBarViewController" - case 1: - // Custom - storyboardSceneID = "CustomSearchBarViewController" - default: break - } - - let exampleViewController = storyboard?.instantiateViewController(withIdentifier: storyboardSceneID) - pushOrPresentViewController(viewController: exampleViewController!, cellIndexPath: indexPath) - } -} - diff --git a/UIKitCatalog/SegmentedControlViewController.swift b/UIKitCatalog/SegmentedControlViewController.swift old mode 100644 new mode 100755 index 2cd2c24..25d99cb --- a/UIKitCatalog/SegmentedControlViewController.swift +++ b/UIKitCatalog/SegmentedControlViewController.swift @@ -14,7 +14,8 @@ class SegmentedControlViewController: UITableViewController { @IBOutlet weak var tintedSegmentedControl: UISegmentedControl! @IBOutlet weak var customSegmentsSegmentedControl: UISegmentedControl! @IBOutlet weak var customBackgroundSegmentedControl: UISegmentedControl! - + @IBOutlet weak var actionBasedSegmentedControl: UISegmentedControl! + // MARK: - View Life Cycle override func viewDidLoad() { @@ -24,6 +25,7 @@ class SegmentedControlViewController: UITableViewController { configureTintedSegmentedControl() configureCustomSegmentsSegmentedControl() configureCustomBackgroundSegmentedControl() + configureActionBasedSegmentedControl() } // MARK: - Configuration @@ -37,7 +39,7 @@ class SegmentedControlViewController: UITableViewController { func configureTintedSegmentedControl() { // Use a dynamic tinted color (separate one for Light Appearance and separate one for Dark Appearance). - tintedSegmentedControl.tintColor = UIColor(named: "tinted_segmented_control")! + tintedSegmentedControl.selectedSegmentTintColor = UIColor(named: "tinted_segmented_control")! tintedSegmentedControl.selectedSegmentIndex = 1 @@ -105,6 +107,25 @@ class SegmentedControlViewController: UITableViewController { for: .valueChanged) } + func configureActionBasedSegmentedControl() { + actionBasedSegmentedControl.selectedSegmentIndex = 0 + let firstAction = + UIAction(title: NSLocalizedString("CheckTitle", comment: "")) { action in + Swift.debugPrint("Segment Action '\(action.title)'") + } + actionBasedSegmentedControl.setAction(firstAction, forSegmentAt: 0) + let secondAction = + UIAction(title: NSLocalizedString("SearchTitle", comment: "")) { action in + Swift.debugPrint("Segment Action '\(action.title)'") + } + actionBasedSegmentedControl.setAction(secondAction, forSegmentAt: 1) + let thirdAction = + UIAction(title: NSLocalizedString("ToolsTitle", comment: "")) { action in + Swift.debugPrint("Segment Action '\(action.title)'") + } + actionBasedSegmentedControl.setAction(thirdAction, forSegmentAt: 2) + } + // MARK: - Actions @objc diff --git a/UIKitCatalog/SliderViewController.swift b/UIKitCatalog/SliderViewController.swift old mode 100644 new mode 100755 diff --git a/UIKitCatalog/StackViewController.swift b/UIKitCatalog/StackViewController.swift old mode 100644 new mode 100755 diff --git a/UIKitCatalog/StepperViewController.swift b/UIKitCatalog/StepperViewController.swift old mode 100644 new mode 100755 index a5bb755..09166dd --- a/UIKitCatalog/StepperViewController.swift +++ b/UIKitCatalog/StepperViewController.swift @@ -46,6 +46,8 @@ class StepperViewController: UITableViewController { func configureTintedStepper() { tintedStepper.tintColor = UIColor(named: "tinted_stepper_control")! + tintedStepper.setDecrementImage(tintedStepper.decrementImage(for: .normal), for: .normal) + tintedStepper.setIncrementImage(tintedStepper.incrementImage(for: .normal), for: .normal) tintedStepperLabel.text = "\(Int(tintedStepper.value))" tintedStepper.addTarget(self, action: #selector(StepperViewController.stepperValueDidChange(_:)), for: .valueChanged) diff --git a/UIKitCatalog/SwitchViewController.swift b/UIKitCatalog/SwitchViewController.swift old mode 100644 new mode 100755 diff --git a/UIKitCatalog/TextFieldViewController.swift b/UIKitCatalog/TextFieldViewController.swift old mode 100644 new mode 100755 diff --git a/UIKitCatalog/TextViewController.swift b/UIKitCatalog/TextViewController.swift old mode 100644 new mode 100755 diff --git a/UIKitCatalog/TintedToolbarViewController.swift b/UIKitCatalog/TintedToolbarViewController.swift old mode 100644 new mode 100755 diff --git a/UIKitCatalog/ToolbarsTableViewController.swift b/UIKitCatalog/ToolbarsTableViewController.swift deleted file mode 100644 index 5938e8d..0000000 --- a/UIKitCatalog/ToolbarsTableViewController.swift +++ /dev/null @@ -1,31 +0,0 @@ -/* -See LICENSE folder for this sample’s licensing information. - -Abstract: -Table view controller for presenting various `UIToolbars`. -*/ - -import UIKit - -class ToolbarsTableViewController: BaseTableViewController { - // MARK: - UITableViewDelegate - - override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { - var storyboardSceneID = String() - switch indexPath.row { - case 0: - // Default - storyboardSceneID = "DefaultToolbarViewController" - case 1: - // Tinted - storyboardSceneID = "TintedToolbarViewController" - case 2: - // Custom - storyboardSceneID = "CustomToolbarViewController" - default: break - } - - let exampleViewController = storyboard?.instantiateViewController(withIdentifier: storyboardSceneID) - pushOrPresentViewController(viewController: exampleViewController!, cellIndexPath: indexPath) - } -} diff --git a/UIKitCatalog/UIKitCatalog-Info.plist b/UIKitCatalog/UIKitCatalog-Info.plist old mode 100644 new mode 100755 index 0de421a..84a89ed --- a/UIKitCatalog/UIKitCatalog-Info.plist +++ b/UIKitCatalog/UIKitCatalog-Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 15 + $(MARKETING_VERSION) CFBundleSignature ???? CFBundleVersion @@ -43,7 +43,28 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight - NSPhotoLibraryAddUsageDescription - Allow UICatalog to save photos to the photo library. + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UILaunchStoryboardName + LaunchScreen + UISceneClassName + UIWindowScene + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + UISceneStoryboardFile + Main + + + + diff --git a/UIKitCatalog/UIKitCatalog.entitlements b/UIKitCatalog/UIKitCatalog.entitlements old mode 100644 new mode 100755 diff --git a/UIKitCatalog/UIViewController+SizeChange.swift b/UIKitCatalog/UIViewController+SizeChange.swift deleted file mode 100644 index 9febe10..0000000 --- a/UIKitCatalog/UIViewController+SizeChange.swift +++ /dev/null @@ -1,21 +0,0 @@ -/* -See LICENSE folder for this sample’s licensing information. - -Abstract: -Extension for any view controller that wants to pop itself from the nav stack, if transitioned - to compact mode on the iPhone. -*/ - -import UIKit - -extension UIViewController { - func popDueToSizeChange() { - /** This view controller was pushed in a table view while in the split view controller's - master table, upon rotation to expand, we want to pop this view controller (to avoid - master and detail being the same view controller). - */ - if navigationController != nil { - navigationController?.popViewController(animated: true) - } - } -} diff --git a/UIKitCatalog/WebViewController.swift b/UIKitCatalog/WebViewController.swift old mode 100644 new mode 100755