Skip to content

Commit

Permalink
Require iOS 15
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed May 16, 2022
1 parent 9ce7cd6 commit 4eba1a2
Show file tree
Hide file tree
Showing 18 changed files with 1,605 additions and 605 deletions.
52 changes: 37 additions & 15 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
whitelist_rules:
only_rules:
- anyobject_protocol
- array_init
- attributes
- block_based_kvo
- class_delegate_protocol
- closing_brace
Expand All @@ -12,6 +11,7 @@ whitelist_rules:
- colon
- comma
- compiler_protocol_init
- computed_accessors_order
- conditional_returns_on_newline
- contains_over_filter_count
- contains_over_filter_is_empty
Expand All @@ -21,12 +21,15 @@ whitelist_rules:
- custom_rules
- deployment_target
- discarded_notification_center_observer
- discouraged_assert
- discouraged_direct_init
- discouraged_none_name
- discouraged_object_literal
- discouraged_optional_boolean
- discouraged_optional_collection
- duplicate_enum_cases
- duplicate_imports
- duplicated_key_in_dictionary_literal
- dynamic_inline
- empty_collection_literal
- empty_count
Expand All @@ -35,22 +38,20 @@ whitelist_rules:
- empty_parentheses_with_trailing_closure
- empty_string
- empty_xctest_method
- enum_case_associated_value_count
- enum_case_associated_values_count
- explicit_init
- fallthrough
- fatal_error_message
- first_where
- flatmap_over_map_reduce
- for_where
# Enable these once in a while
# - force_cast
# - force_try
# - force_unwrapping
- generic_type_name
- ibinspectable_in_extension
- identical_operands
- identifier_name
- implicit_getter
- implicit_return
- inclusive_language
- inert_defer
- is_disjoint
- joined_default_parameter
Expand Down Expand Up @@ -84,11 +85,13 @@ whitelist_rules:
- operator_whitespace
- orphaned_doc_comment
- overridden_super_call
- prefer_self_in_static_references
- prefer_self_type_over_type_of_self
- prefer_zero_over_explicit_init
- private_action
- private_outlet
- private_subject
- private_unit_test
- prohibited_nan_comparison
- prohibited_super_call
- protocol_property_accessors_order
- reduce_boolean
Expand All @@ -102,8 +105,9 @@ whitelist_rules:
- redundant_type_annotation
- redundant_void_return
- required_enum_case
- return_value_from_void_function
- return_arrow_whitespace
- return_value_from_void_function
- self_in_property_initialization
- shorthand_operator
- sorted_first_last
- statement_position
Expand All @@ -113,18 +117,20 @@ whitelist_rules:
- switch_case_alignment
- switch_case_on_newline
- syntactic_sugar
- test_case_accessibility
- toggle_bool
- trailing_closure
- trailing_comma
- trailing_newline
- trailing_semicolon
- trailing_whitespace
- tuple_pattern
- unavailable_condition
- unavailable_function
- unneeded_break_in_switch
- unneeded_parentheses_in_closure_argument
- unowned_variable_capture
- untyped_error_in_catch
- unused_capture_list
- unused_closure_parameter
- unused_control_flow_label
- unused_enumerated
Expand All @@ -136,16 +142,14 @@ whitelist_rules:
- vertical_whitespace_closing_braces
- vertical_whitespace_opening_braces
- void_return
- weak_delegate
- xct_specific_matcher
- xctfail_message
- yoda_condition
analyzer_rules:
- capture_variable
- unused_declaration
- unused_import
force_cast: warning
force_try: warning
force_unwrapping: warning
- typesafe_array_init
number_separator:
minimum_length: 5
identifier_name:
Expand All @@ -161,14 +165,16 @@ identifier_name:
excluded:
- 'x'
- 'y'
- 'z'
- 'a'
- 'b'
- 'x1'
- 'x2'
- 'y1'
- 'y2'
- 'z2'
deployment_target:
iOS_deployment_target: '14'
iOS_deployment_target: '15'
custom_rules:
no_nsrect:
regex: '\bNSRect\b'
Expand All @@ -182,3 +188,19 @@ custom_rules:
regex: '\bNSPoint\b'
match_kinds: typeidentifier
message: 'Use CGPoint instead of NSPoint'
no_cgfloat:
regex: '\bCGFloat\b'
match_kinds: typeidentifier
message: 'Use Double instead of CGFloat'
no_cgfloat2:
regex: '\bCGFloat\('
message: 'Use Double instead of CGFloat'
swiftui_state_private:
regex: '@(State|StateObject|ObservedObject|EnvironmentObject)\s+var'
message: 'SwiftUI @State/@StateObject/@ObservedObject/@EnvironmentObject properties should be private'
swiftui_environment_private:
regex: '@Environment\(\\\.\w+\)\s+var'
message: 'SwiftUI @Environment properties should be private'
final_class:
regex: '^class [a-zA-Z\d]+[^{]+\{'
message: 'Classes should be marked as final whenever possible. If you actually need it to be subclassable, just add `// swiftlint:disable:next final_class`.'
4 changes: 2 additions & 2 deletions Action Extension/ActionViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ final class ActionViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()

initAppCenter()
initSentry()

let contentView = ContentView()
let contentView = MainScreen()
.environment(\.extensionContext, extensionContext)

view = UIHostingView(rootView: contentView)
Expand Down
140 changes: 0 additions & 140 deletions Action Extension/ContentView.swift

This file was deleted.

2 changes: 2 additions & 0 deletions Action Extension/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,7 @@
<key>NSExtensionPrincipalClass</key>
<string>$(PRODUCT_MODULE_NAME).ActionViewController</string>
</dict>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
</dict>
</plist>
Loading

0 comments on commit 4eba1a2

Please sign in to comment.