Skip to content

Commit 1aaeb13

Browse files
Merge pull request #2 from SomeRandomiOSDev/Modernize
Regenerated the project with the latest from ProjectTemplate
2 parents 7d0be6e + efbd722 commit 1aaeb13

21 files changed

+660
-259
lines changed

.github/workflows/cocoapods.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ jobs:
2020
2121
- name: Lint (Static Library)
2222
run: |
23-
pod lib lint --use-libraries --skip-tests
23+
pod lib lint --use-libraries

.github/workflows/swiftlint.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: SwiftLint
2+
on: [push, workflow_dispatch]
3+
4+
jobs:
5+
build:
6+
name: Run SwiftLint
7+
runs-on: macOS-latest
8+
9+
steps:
10+
- name: Checkout Code
11+
uses: actions/checkout@v2
12+
13+
- name: Run SwiftLint
14+
run: |
15+
swiftlint lint --reporter github-actions-logging

.swiftlint.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ opt_in_rules:
2929
- vertical_parameter_alignment_on_call
3030
- pattern_matching_keywords
3131
- fatal_error_message
32-
- implicit_return
3332
- implicitly_unwrapped_optional
3433
- joined_default_parameter
3534
- let_var_whitespace
@@ -59,6 +58,9 @@ opt_in_rules:
5958

6059
reporter: "xcode"
6160

61+
function_body_length:
62+
- 60 #warning
63+
6264
identifier_name:
6365
excluded:
6466
- i

MethodNotificationCenter.podspec

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
Pod::Spec.new do |s|
22

33
s.name = "MethodNotificationCenter"
4-
s.version = "0.1.1"
4+
s.version = "0.1.2"
55
s.summary = "Simple Objective-C Runtime Injection"
66
s.description = <<-DESC
77
A lightweight framework enabling easy snooping on Objective-C methods for iOS, macOS, and tvOS.
88
DESC
99

1010
s.homepage = "https://github.com/SomeRandomiOSDev/MethodNotificationCenter"
1111
s.license = "MIT"
12-
s.author = { "Joseph Newton" => "[email protected]" }
12+
s.author = { "Joe Newton" => "[email protected]" }
13+
s.source = { :git => "https://github.com/SomeRandomiOSDev/MethodNotificationCenter.git", :tag => s.version.to_s }
1314

1415
s.ios.deployment_target = '9.0'
1516
s.macos.deployment_target = '10.10'
1617
s.tvos.deployment_target = '9.0'
1718
s.watchos.deployment_target = '2.0'
1819

19-
s.source = { :git => "https://github.com/SomeRandomiOSDev/MethodNotificationCenter.git", :tag => s.version.to_s }
20-
s.source_files = 'Sources/**/*.{h,m,s}'
20+
s.source_files = 'Sources/MethodNotificationCenter/**/*.{h,m,s}'
21+
s.module_map = 'Sources/MethodNotificationCenter/module/module.modulemap'
2122
s.swift_versions = ['4.0', '4.2', '5.0']
2223
s.cocoapods_version = '>= 1.7.3'
2324

@@ -27,7 +28,9 @@ Pod::Spec.new do |s|
2728
ts.tvos.deployment_target = '9.0'
2829
ts.watchos.deployment_target = '2.0'
2930

30-
ts.source_files = 'Tests/**/*.{m,swift}'
31+
ts.pod_target_xcconfig = { 'SWIFT_INCLUDE_PATHS' => '$PODS_TARGET_SRCROOT/Sources/MethodNotificationCenter/include',
32+
'HEADER_SEARCH_PATHS' => '$PODS_TARGET_SRCROOT/Sources/MethodNotificationCenter/include' }
33+
ts.source_files = 'Tests/**/*.{m,swift}'
3134
end
3235

3336
end

MethodNotificationCenter.xcodeproj/project.pbxproj

Lines changed: 202 additions & 202 deletions
Large diffs are not rendered by default.

Package.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ let package = Package(
1717

1818
targets: [
1919
.target(name: "MethodNotificationCenter"),
20+
2021
.testTarget(name: "MethodNotificationCenterObjCTests", dependencies: ["MethodNotificationCenter"]),
2122
.testTarget(name: "MethodNotificationCenterSwiftTests", dependencies: ["MethodNotificationCenter"])
22-
]
23+
],
24+
25+
swiftLanguageVersions: [.version("5")]
2326
)

README.md

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
MethodNotificationCenter
2-
========
1+
# MethodNotificationCenter
32
Objective-C Runtime Injection
43

54
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/d30d31c29f17449481b97a04610ff5b9)](https://app.codacy.com/app/SomeRandomiOSDev/MethodNotificationCenter?utm_source=github.com&utm_medium=referral&utm_content=SomeRandomiOSDev/MethodNotificationCenter&utm_campaign=Badge_Grade_Dashboard)
@@ -25,8 +24,7 @@ This library allows one to be notified, in a fashion very similar to Foundation'
2524

2625
It should be noted that this library is for _educational purposes_ only. The way in which this library operates not only makes it volatile and unsuitable to production releases, but use of it would likely not pass Apple's App Store review (untested).
2726

28-
Installation
29-
--------
27+
## Installation
3028

3129
**MethodNotificationCenter** is available through [CocoaPods](https://cocoapods.org), [Carthage](https://github.com/Carthage/Carthage) and the [Swift Package Manager](https://swift.org/package-manager/).
3230

@@ -45,11 +43,10 @@ github "SomeRandomiOSDev/MethodNotificationCenter"
4543
To install via the Swift Package Manager add the following line to your `Package.swift` file's `dependencies`:
4644

4745
```swift
48-
.package(url: "https://github.com/SomeRandomiOSDev/MethodNotificationCenter.git", from: "0.1.1")
46+
.package(url: "https://github.com/SomeRandomiOSDev/MethodNotificationCenter.git", from: "0.1.0")
4947
```
5048

51-
Usage
52-
--------
49+
## Usage
5350

5451
First import **MethodNotificationCenter** at the top of your source file:
5552

@@ -109,17 +106,14 @@ There are some notable limitations to the capabilities of this library:
109106
* Method notifications aren't sent recursively. That is, you'll receive a notification for the "top-level" call of the given method, but if the method (or any of its internal method calls) calls the same method a notification will _not_ be sent for that.
110107
* Due to optimizations made by the Swift compiler, Swift calls to methods written in Swift (but annotated with the `@objc` attribute) are usually hard-coded by the compiler and don't use the Objective-C runtime, which prevent notifications from being sent. Classes written in Objective-C and called from Swift (or vice-versa) shouldn't have this issue. See `Tests/MethodNotificationCenterTests/MethodNotificationCenterSwiftTests/MethodNotificationCenterTests.swift` for examples.
111108

112-
Contributing
113-
--------
109+
## Contributing
114110

115111
If you have need for a specific feature or you encounter a bug, please open an issue. If you extend the functionality of **MethodNotificationCenter** yourself or you feel like fixing a bug yourself, please submit a pull request.
116112

117-
Author
118-
--------
113+
## Author
119114

120115
Joe Newton, [email protected]
121116

122-
License
123-
--------
117+
## License
124118

125119
**MethodNotificationCenter** is available under the MIT license. See the `LICENSE` file for more info.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
framework module MethodNotificationCenter {
2+
header "MethodNotification.h"
23
header "MethodNotificationCenter.h"
34
header "MethodNotificationObservable.h"
4-
header "MethodNotification.h"
55
}

0 commit comments

Comments
 (0)