Skip to content

Commit bea8c67

Browse files
author
Jason Rodriguez
committed
Updates Package.swift to include latest changes, and cleans up some Objc code
1 parent 1b894f5 commit bea8c67

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
lines changed

LTHPasscodeViewController/LTHPasscodeViewController.m

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,14 @@
1414

1515
#define LTHFailedAttemptLabelHeight [_failedAttemptLabel.text sizeWithAttributes: @{NSFontAttributeName : _labelFont}].height
1616

17+
#ifndef LTHLocalizedString
18+
#define LTHLocalizedString(key) [[NSBundle bundleWithPath:[[NSBundle bundleForClass:[LTHPasscodeViewController class]] pathForResource:@"LTHPasscodeViewController" ofType:@"bundle"]] localizedStringForKey:(key) value:@"" table:_localizationTableName]
19+
#endif
20+
1721
#ifndef LTHPasscodeViewControllerStrings
18-
#define LTHPasscodeViewControllerStrings(key) \
19-
[[[NSBundle bundleWithPath:[[NSBundle bundleForClass:[LTHPasscodeViewController class]] pathForResource:@"LTHPasscodeViewController" ofType:@"bundle"]] localizedStringForKey:(key) value:@"" table:_localizationTableName] length] == 0 ? NSLocalizedString(key, bundle: .module, comment: "") : [[NSBundle bundleWithPath:[[NSBundle bundleForClass:[LTHPasscodeViewController class]] pathForResource:@"LTHPasscodeViewController" ofType:@"bundle"]] localizedStringForKey:(key) value:@"" table:_localizationTableName]
22+
#define LTHPasscodeViewControllerStrings(key) [LTHLocalizedString(key) length] == 0 \
23+
? NSLocalizedString(key, bundle: .module) \
24+
: LTHLocalizedString(key)
2025
#endif
2126

2227
// MARK: Please read

Package.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ let package = Package(
1818
name: "LTHPasscodeViewController",
1919
path: ".",
2020
exclude: ["Demo", "CHANGELOG.md", "LICENSE.txt", "README.md"],
21-
sources: ["LTHPasscodeViewController/LTHKeychainUtils.h", "LTHPasscodeViewController/LTHKeychainUtils.m", "LTHPasscodeViewController/LTHPasscodeViewController.h", "LTHPasscodeViewController/LTHPasscodeViewController.m"],
2221
resources: [.process("Localizations/LTHPasscodeViewController.bundle")],
2322
publicHeadersPath: "LTHPasscodeViewController"
2423
)

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,24 @@ Simple to use iOS 7 style Passcode - the one you get in Settings when changing y
33

44
# Installation
55

6-
### CocoaPods
7-
8-
[CocoaPods](https://cocoapods.org) is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate LTHPasscodeViewController into your Xcode project using CocoaPods, specify it in your `Podfile`:
9-
10-
```ruby
11-
pod 'LTHPasscodeViewController', '~> 4.0.1'
12-
```
13-
146
### Swift Package Manager
157

168
__NOTE__: _These instructions are intended for usage on Xcode 11 and higher. Xcode 11 is the first version of Xcode that integrates Swift Package manager and makes it way easier to use than it was at the command line. If you are using older versions of Xcode, we recommend using CocoaPods._
179

1810
1. Go to File > Swift Packages > Add Package Dependency...
19-
2. Paste the URL to the LTHPasscodeViewController repo on GitHub (https://github.com/rolandleth/LTHPasscodeViewController.git) into the search bar, then hit the Next button:
11+
2. Paste the URL to the `LTHPasscodeViewController` repo on GitHub (https://github.com/rolandleth/LTHPasscodeViewController.git) into the search bar, then hit the Next button:
2012
3. Select what version you want to use, then hit next (Xcode will automatically suggest the current version Up to Next Major).
2113
4. Select the `LTHPasscodeViewController` library and then hit finish.
2214
5. You're done!
2315

16+
### CocoaPods
17+
18+
[CocoaPods](https://cocoapods.org) is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate `LTHPasscodeViewController` into your Xcode project using CocoaPods, specify it in your `Podfile`:
19+
20+
```ruby
21+
pod 'LTHPasscodeViewController', '~> 4.0.1'
22+
```
23+
2424
### Manually
2525

2626
Simply clone the repo and drag the contents of `LTHPasscodeViewController` to your project.
@@ -69,7 +69,7 @@ if ([LTHPasscodeViewController doesPasscodeExist]) {
6969

7070
```objc
7171
/**
72-
@param viewController The view controller where the passcode view controller will be displayed.
72+
@param viewController The view controller where the passcode view controller will be displayed.
7373
@param asModal Set to YES to present as a modal, or to NO to push on the current nav stack.
7474
*/
7575
- (void)showForEnablingPasscodeInViewController:(UIViewController *)viewController asModal:(BOOL)isModal;

0 commit comments

Comments
 (0)