├── .gitignore
├── .travis.yml
├── CONTRIBUTING.md
├── Example
├── Podfile
├── Podfile.lock
├── Pods
│ ├── Local Podspecs
│ │ └── PowerUpSwift.podspec.json
│ ├── Manifest.lock
│ ├── Pods.xcodeproj
│ │ ├── project.pbxproj
│ │ └── project.xcworkspace
│ │ │ ├── contents.xcworkspacedata
│ │ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ └── Target Support Files
│ │ ├── Pods-PowerUpSwift_Example
│ │ ├── Info.plist
│ │ ├── Pods-PowerUpSwift_Example-Info.plist
│ │ ├── Pods-PowerUpSwift_Example-acknowledgements.markdown
│ │ ├── Pods-PowerUpSwift_Example-acknowledgements.plist
│ │ ├── Pods-PowerUpSwift_Example-dummy.m
│ │ ├── Pods-PowerUpSwift_Example-frameworks.sh
│ │ ├── Pods-PowerUpSwift_Example-resources.sh
│ │ ├── Pods-PowerUpSwift_Example-umbrella.h
│ │ ├── Pods-PowerUpSwift_Example.debug.xcconfig
│ │ ├── Pods-PowerUpSwift_Example.modulemap
│ │ └── Pods-PowerUpSwift_Example.release.xcconfig
│ │ ├── Pods-PowerUpSwift_Tests
│ │ ├── Info.plist
│ │ ├── Pods-PowerUpSwift_Tests-Info.plist
│ │ ├── Pods-PowerUpSwift_Tests-acknowledgements.markdown
│ │ ├── Pods-PowerUpSwift_Tests-acknowledgements.plist
│ │ ├── Pods-PowerUpSwift_Tests-dummy.m
│ │ ├── Pods-PowerUpSwift_Tests-frameworks.sh
│ │ ├── Pods-PowerUpSwift_Tests-resources.sh
│ │ ├── Pods-PowerUpSwift_Tests-umbrella.h
│ │ ├── Pods-PowerUpSwift_Tests.debug.xcconfig
│ │ ├── Pods-PowerUpSwift_Tests.modulemap
│ │ └── Pods-PowerUpSwift_Tests.release.xcconfig
│ │ └── PowerUpSwift
│ │ ├── Info.plist
│ │ ├── PowerUpSwift-Info.plist
│ │ ├── PowerUpSwift-dummy.m
│ │ ├── PowerUpSwift-prefix.pch
│ │ ├── PowerUpSwift-umbrella.h
│ │ ├── PowerUpSwift.debug.xcconfig
│ │ ├── PowerUpSwift.modulemap
│ │ ├── PowerUpSwift.release.xcconfig
│ │ └── PowerUpSwift.xcconfig
├── PowerUpSwift.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── PowerUpSwift-Example.xcscheme
├── PowerUpSwift.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ ├── IDEWorkspaceChecks.plist
│ │ └── WorkspaceSettings.xcsettings
├── PowerUpSwift
│ ├── AppDelegate.swift
│ ├── Base.lproj
│ │ ├── LaunchScreen.xib
│ │ └── Main.storyboard
│ ├── Images.xcassets
│ │ └── AppIcon.appiconset
│ │ │ └── Contents.json
│ ├── Info.plist
│ └── ViewController.swift
└── Tests
│ ├── BoolTests.swift
│ ├── Info.plist
│ └── StringTests.swift
├── LICENSE
├── MIGRATION.md
├── Package.swift
├── PowerUpSwift.podspec
├── PowerUpSwift
├── Assets
│ └── .gitkeep
└── Classes
│ ├── .gitkeep
│ ├── Classes
│ ├── PUBarItem.swift
│ ├── PUBaseTextField.swift
│ ├── PUButton.swift
│ ├── PUCollectionView.swift
│ ├── PUImageView.swift
│ ├── PULabel.swift
│ ├── PULoadingButton.swift
│ ├── PUNavigationItem.swift
│ ├── PUSegmentedControl.swift
│ ├── PUTableView.swift
│ ├── PUTextField.swift
│ ├── PUTextView.swift
│ ├── PUUnderlineTextField.swift
│ ├── PUView.swift
│ ├── PUVisualEffectView.swift
│ └── Protocols
│ │ ├── PUInspectable.swift
│ │ └── PULocalizable.swift
│ └── Extensions
│ ├── CoreLocation
│ └── CLPlacemark.swift
│ ├── Foundation
│ ├── Bundle.swift
│ ├── Data.swift
│ ├── Dictionary.swift
│ ├── Optional.swift
│ ├── String.swift
│ ├── URL.swift
│ ├── URLRequest.swift
│ └── URLResponse.swift
│ └── UIKit
│ ├── NSLayoutConstraint.swift
│ ├── UIButton.swift
│ ├── UICollectionViewCell.swift
│ ├── UIColor.swift
│ ├── UINavigationController.swift
│ ├── UIRefreshControl.swift
│ ├── UITableView.swift
│ ├── UITableViewCell.swift
│ ├── UITextView.swift
│ └── UIViewController.swift
├── README.md
├── Screenshots
├── Demo.gif
├── PowerUpSwift.afdesign
├── PowerUpSwift.png
├── code-screenshot-orange.png
└── code-screenshot-purple.png
└── _Pods.xcodeproj
/.gitignore:
--------------------------------------------------------------------------------
1 | # OS X
2 | .DS_Store
3 |
4 | # Xcode
5 | build/
6 | .build/
7 | docs/
8 | *.pbxuser
9 | !default.pbxuser
10 | *.mode1v3
11 | !default.mode1v3
12 | *.mode2v3
13 | !default.mode2v3
14 | *.perspectivev3
15 | !default.perspectivev3
16 | xcuserdata/
17 | *.xccheckout
18 | profile
19 | *.moved-aside
20 | DerivedData
21 | *.hmap
22 | *.ipa
23 |
24 | # Bundler
25 | .bundle
26 |
27 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
28 | # Carthage/Checkouts
29 |
30 | Carthage/Build
31 |
32 | # We recommend against adding the Pods directory to your .gitignore. However
33 | # you should judge for yourself, the pros and cons are mentioned at:
34 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
35 | #
36 | # Note: if you ignore the Pods directory, make sure to uncomment
37 | # `pod install` in .travis.yml
38 | #
39 | # Pods/
40 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | # references:
2 | # * https://www.objc.io/issues/6-build-tools/travis-ci/
3 | # * https://github.com/supermarin/xcpretty#usage
4 |
5 | osx_image: xcode7.3
6 | language: objective-c
7 | # cache: cocoapods
8 | # podfile: Example/Podfile
9 | # before_install:
10 | # - gem install cocoapods # Since Travis is not always on latest version
11 | # - pod install --project-directory=Example
12 | script:
13 | - set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/PowerUpSwift.xcworkspace -scheme PowerUpSwift-Example -sdk iphonesimulator9.3 ONLY_ACTIVE_ARCH=NO | xcpretty
14 | - pod lib lint
15 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to PowerUpSwift
2 |
3 | Thank you for considering contributing to this awesome library!
4 |
5 |
6 |
7 | ## You are very much welcome to implement
8 |
9 | * Unit Tests
10 |
11 | ## Coding conventions
12 | * It will be nice to integrate SwiftLint to have a consistent style across the codebase.
13 |
14 | ## Notes
15 | * Please do not make Pull Requests for the Example folder (at least for now).
16 |
17 |
18 |
19 | ## Start
20 | Fork, then clone the repo.
21 | ```bash
22 | git clone https://github.com//PowerUpSwift.git
23 | ```
24 |
25 | ## Commit
26 | Make sure your commit messages are in present tense and are using American English (ex. *organize*, not *organise*) just so we can follow a standard.
27 |
28 | This:
29 | ```bash
30 | git commit -m "Fix bugs and update colors"
31 | ```
32 | Not this:
33 | ```bash
34 | git commit -m "Fixed bugs and updated colours"
35 | ```
36 |
37 | ## Push to your Fork and make a pull request.
38 | Please direct it to the `pull-request` branch instead of the `master` branch.
39 |
--------------------------------------------------------------------------------
/Example/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment the next line to define a global platform for your project
2 | platform :ios, '12.0'
3 |
4 | use_frameworks!
5 |
6 | target 'PowerUpSwift_Example' do
7 | pod 'PowerUpSwift', :path => '../'
8 |
9 | target 'PowerUpSwift_Tests' do
10 | inherit! :search_paths
11 |
12 |
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/Example/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - PowerUpSwift (2.1.4)
3 |
4 | DEPENDENCIES:
5 | - PowerUpSwift (from `../`)
6 |
7 | EXTERNAL SOURCES:
8 | PowerUpSwift:
9 | :path: "../"
10 |
11 | SPEC CHECKSUMS:
12 | PowerUpSwift: 187905ed66f3519b4f7dc22d0ff4c66229b49eae
13 |
14 | PODFILE CHECKSUM: 022cf258936cae63ce5d9943f8a8fcf1309d2148
15 |
16 | COCOAPODS: 1.11.2
17 |
--------------------------------------------------------------------------------
/Example/Pods/Local Podspecs/PowerUpSwift.podspec.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "PowerUpSwift",
3 | "version": "2.1.4",
4 | "summary": "📦 A lightweight library of powerful extensions and classes to reduce the utility code in your project and make iOS development faster.",
5 | "description": "Apple doesn't provide some basic useful utilities to make our iOS Development lives a little easier. This might be for a [good] reason, such as keeping the platform lightweight. It sometimes requires extra time and effort to implement a simple basic feature that you can easily do in Android built-in, so you end up doing a couple more hacks. This library was created to save time, to be more productive, and to be DRY (Don't Repeat Yourself).",
6 | "homepage": "https://github.com/PowerUpX/PowerUpSwift",
7 | "license": {
8 | "type": "MIT",
9 | "file": "LICENSE"
10 | },
11 | "authors": {
12 | "Ceferino Jose II": "cefjoeii@gmail.com"
13 | },
14 | "source": {
15 | "git": "https://github.com/PowerUpX/PowerUpSwift.git",
16 | "tag": "2.1.4"
17 | },
18 | "social_media_url": "https://github.com/cefjoeii",
19 | "platforms": {
20 | "ios": "12.0"
21 | },
22 | "source_files": "PowerUpSwift/Classes/**/*",
23 | "swift_versions": "5.0",
24 | "frameworks": [
25 | "UIKit",
26 | "Foundation",
27 | "CoreLocation"
28 | ],
29 | "swift_version": "5.0"
30 | }
31 |
--------------------------------------------------------------------------------
/Example/Pods/Manifest.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - PowerUpSwift (2.1.4)
3 |
4 | DEPENDENCIES:
5 | - PowerUpSwift (from `../`)
6 |
7 | EXTERNAL SOURCES:
8 | PowerUpSwift:
9 | :path: "../"
10 |
11 | SPEC CHECKSUMS:
12 | PowerUpSwift: 187905ed66f3519b4f7dc22d0ff4c66229b49eae
13 |
14 | PODFILE CHECKSUM: 022cf258936cae63ce5d9943f8a8fcf1309d2148
15 |
16 | COCOAPODS: 1.11.2
17 |
--------------------------------------------------------------------------------
/Example/Pods/Pods.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Example/Pods/Pods.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-PowerUpSwift_Example/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-PowerUpSwift_Example/Pods-PowerUpSwift_Example-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-PowerUpSwift_Example/Pods-PowerUpSwift_Example-acknowledgements.markdown:
--------------------------------------------------------------------------------
1 | # Acknowledgements
2 | This application makes use of the following third party libraries:
3 |
4 | ## PowerUpSwift
5 |
6 | Copyright (c) 2019 Ceferino Jose II
7 |
8 | Permission is hereby granted, free of charge, to any person obtaining a copy
9 | of this software and associated documentation files (the "Software"), to deal
10 | in the Software without restriction, including without limitation the rights
11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 | copies of the Software, and to permit persons to whom the Software is
13 | furnished to do so, subject to the following conditions:
14 |
15 | The above copyright notice and this permission notice shall be included in
16 | all copies or substantial portions of the Software.
17 |
18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 | THE SOFTWARE.
25 |
26 | Generated by CocoaPods - https://cocoapods.org
27 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-PowerUpSwift_Example/Pods-PowerUpSwift_Example-acknowledgements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreferenceSpecifiers
6 |
7 |
8 | FooterText
9 | This application makes use of the following third party libraries:
10 | Title
11 | Acknowledgements
12 | Type
13 | PSGroupSpecifier
14 |
15 |
16 | FooterText
17 | Copyright (c) 2019 Ceferino Jose II <cefjoeii@gmail.com>
18 |
19 | Permission is hereby granted, free of charge, to any person obtaining a copy
20 | of this software and associated documentation files (the "Software"), to deal
21 | in the Software without restriction, including without limitation the rights
22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
23 | copies of the Software, and to permit persons to whom the Software is
24 | furnished to do so, subject to the following conditions:
25 |
26 | The above copyright notice and this permission notice shall be included in
27 | all copies or substantial portions of the Software.
28 |
29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
35 | THE SOFTWARE.
36 |
37 | License
38 | MIT
39 | Title
40 | PowerUpSwift
41 | Type
42 | PSGroupSpecifier
43 |
44 |
45 | FooterText
46 | Generated by CocoaPods - https://cocoapods.org
47 | Title
48 |
49 | Type
50 | PSGroupSpecifier
51 |
52 |
53 | StringsTable
54 | Acknowledgements
55 | Title
56 | Acknowledgements
57 |
58 |
59 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-PowerUpSwift_Example/Pods-PowerUpSwift_Example-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_PowerUpSwift_Example : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_PowerUpSwift_Example
5 | @end
6 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-PowerUpSwift_Example/Pods-PowerUpSwift_Example-frameworks.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 | set -u
4 | set -o pipefail
5 |
6 | function on_error {
7 | echo "$(realpath -mq "${0}"):$1: error: Unexpected failure"
8 | }
9 | trap 'on_error $LINENO' ERR
10 |
11 | if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then
12 | # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy
13 | # frameworks to, so exit 0 (signalling the script phase was successful).
14 | exit 0
15 | fi
16 |
17 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
18 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
19 |
20 | COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}"
21 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
22 | BCSYMBOLMAP_DIR="BCSymbolMaps"
23 |
24 |
25 | # This protects against multiple targets copying the same framework dependency at the same time. The solution
26 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
27 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
28 |
29 | # Copies and strips a vendored framework
30 | install_framework()
31 | {
32 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
33 | local source="${BUILT_PRODUCTS_DIR}/$1"
34 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
35 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
36 | elif [ -r "$1" ]; then
37 | local source="$1"
38 | fi
39 |
40 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
41 |
42 | if [ -L "${source}" ]; then
43 | echo "Symlinked..."
44 | source="$(readlink "${source}")"
45 | fi
46 |
47 | if [ -d "${source}/${BCSYMBOLMAP_DIR}" ]; then
48 | # Locate and install any .bcsymbolmaps if present, and remove them from the .framework before the framework is copied
49 | find "${source}/${BCSYMBOLMAP_DIR}" -name "*.bcsymbolmap"|while read f; do
50 | echo "Installing $f"
51 | install_bcsymbolmap "$f" "$destination"
52 | rm "$f"
53 | done
54 | rmdir "${source}/${BCSYMBOLMAP_DIR}"
55 | fi
56 |
57 | # Use filter instead of exclude so missing patterns don't throw errors.
58 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
59 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
60 |
61 | local basename
62 | basename="$(basename -s .framework "$1")"
63 | binary="${destination}/${basename}.framework/${basename}"
64 |
65 | if ! [ -r "$binary" ]; then
66 | binary="${destination}/${basename}"
67 | elif [ -L "${binary}" ]; then
68 | echo "Destination binary is symlinked..."
69 | dirname="$(dirname "${binary}")"
70 | binary="${dirname}/$(readlink "${binary}")"
71 | fi
72 |
73 | # Strip invalid architectures so "fat" simulator / device frameworks work on device
74 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
75 | strip_invalid_archs "$binary"
76 | fi
77 |
78 | # Resign the code if required by the build settings to avoid unstable apps
79 | code_sign_if_enabled "${destination}/$(basename "$1")"
80 |
81 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
82 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
83 | local swift_runtime_libs
84 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u)
85 | for lib in $swift_runtime_libs; do
86 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
87 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
88 | code_sign_if_enabled "${destination}/${lib}"
89 | done
90 | fi
91 | }
92 | # Copies and strips a vendored dSYM
93 | install_dsym() {
94 | local source="$1"
95 | warn_missing_arch=${2:-true}
96 | if [ -r "$source" ]; then
97 | # Copy the dSYM into the targets temp dir.
98 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\""
99 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}"
100 |
101 | local basename
102 | basename="$(basename -s .dSYM "$source")"
103 | binary_name="$(ls "$source/Contents/Resources/DWARF")"
104 | binary="${DERIVED_FILES_DIR}/${basename}.dSYM/Contents/Resources/DWARF/${binary_name}"
105 |
106 | # Strip invalid architectures from the dSYM.
107 | if [[ "$(file "$binary")" == *"Mach-O "*"dSYM companion"* ]]; then
108 | strip_invalid_archs "$binary" "$warn_missing_arch"
109 | fi
110 | if [[ $STRIP_BINARY_RETVAL == 0 ]]; then
111 | # Move the stripped file into its final destination.
112 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\""
113 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.dSYM" "${DWARF_DSYM_FOLDER_PATH}"
114 | else
115 | # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing.
116 | mkdir -p "${DWARF_DSYM_FOLDER_PATH}"
117 | touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.dSYM"
118 | fi
119 | fi
120 | }
121 |
122 | # Used as a return value for each invocation of `strip_invalid_archs` function.
123 | STRIP_BINARY_RETVAL=0
124 |
125 | # Strip invalid architectures
126 | strip_invalid_archs() {
127 | binary="$1"
128 | warn_missing_arch=${2:-true}
129 | # Get architectures for current target binary
130 | binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)"
131 | # Intersect them with the architectures we are building for
132 | intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)"
133 | # If there are no archs supported by this binary then warn the user
134 | if [[ -z "$intersected_archs" ]]; then
135 | if [[ "$warn_missing_arch" == "true" ]]; then
136 | echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)."
137 | fi
138 | STRIP_BINARY_RETVAL=1
139 | return
140 | fi
141 | stripped=""
142 | for arch in $binary_archs; do
143 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then
144 | # Strip non-valid architectures in-place
145 | lipo -remove "$arch" -output "$binary" "$binary"
146 | stripped="$stripped $arch"
147 | fi
148 | done
149 | if [[ "$stripped" ]]; then
150 | echo "Stripped $binary of architectures:$stripped"
151 | fi
152 | STRIP_BINARY_RETVAL=0
153 | }
154 |
155 | # Copies the bcsymbolmap files of a vendored framework
156 | install_bcsymbolmap() {
157 | local bcsymbolmap_path="$1"
158 | local destination="${BUILT_PRODUCTS_DIR}"
159 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}""
160 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}"
161 | }
162 |
163 | # Signs a framework with the provided identity
164 | code_sign_if_enabled() {
165 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
166 | # Use the current code_sign_identity
167 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
168 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'"
169 |
170 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
171 | code_sign_cmd="$code_sign_cmd &"
172 | fi
173 | echo "$code_sign_cmd"
174 | eval "$code_sign_cmd"
175 | fi
176 | }
177 |
178 | if [[ "$CONFIGURATION" == "Debug" ]]; then
179 | install_framework "${BUILT_PRODUCTS_DIR}/PowerUpSwift/PowerUpSwift.framework"
180 | fi
181 | if [[ "$CONFIGURATION" == "Release" ]]; then
182 | install_framework "${BUILT_PRODUCTS_DIR}/PowerUpSwift/PowerUpSwift.framework"
183 | fi
184 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
185 | wait
186 | fi
187 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-PowerUpSwift_Example/Pods-PowerUpSwift_Example-resources.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 | set -u
4 | set -o pipefail
5 |
6 | if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then
7 | # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy
8 | # resources to, so exit 0 (signalling the script phase was successful).
9 | exit 0
10 | fi
11 |
12 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
13 |
14 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
15 | > "$RESOURCES_TO_COPY"
16 |
17 | XCASSET_FILES=()
18 |
19 | # This protects against multiple targets copying the same framework dependency at the same time. The solution
20 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
21 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
22 |
23 | case "${TARGETED_DEVICE_FAMILY:-}" in
24 | 1,2)
25 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
26 | ;;
27 | 1)
28 | TARGET_DEVICE_ARGS="--target-device iphone"
29 | ;;
30 | 2)
31 | TARGET_DEVICE_ARGS="--target-device ipad"
32 | ;;
33 | 3)
34 | TARGET_DEVICE_ARGS="--target-device tv"
35 | ;;
36 | 4)
37 | TARGET_DEVICE_ARGS="--target-device watch"
38 | ;;
39 | *)
40 | TARGET_DEVICE_ARGS="--target-device mac"
41 | ;;
42 | esac
43 |
44 | install_resource()
45 | {
46 | if [[ "$1" = /* ]] ; then
47 | RESOURCE_PATH="$1"
48 | else
49 | RESOURCE_PATH="${PODS_ROOT}/$1"
50 | fi
51 | if [[ ! -e "$RESOURCE_PATH" ]] ; then
52 | cat << EOM
53 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script.
54 | EOM
55 | exit 1
56 | fi
57 | case $RESOURCE_PATH in
58 | *.storyboard)
59 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true
60 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
61 | ;;
62 | *.xib)
63 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true
64 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
65 | ;;
66 | *.framework)
67 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
68 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
69 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
70 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
71 | ;;
72 | *.xcdatamodel)
73 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true
74 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
75 | ;;
76 | *.xcdatamodeld)
77 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true
78 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
79 | ;;
80 | *.xcmappingmodel)
81 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true
82 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
83 | ;;
84 | *.xcassets)
85 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH"
86 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
87 | ;;
88 | *)
89 | echo "$RESOURCE_PATH" || true
90 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
91 | ;;
92 | esac
93 | }
94 |
95 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
96 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
97 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
98 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
99 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
100 | fi
101 | rm -f "$RESOURCES_TO_COPY"
102 |
103 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ]
104 | then
105 | # Find all other xcassets (this unfortunately includes those of path pods and other targets).
106 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
107 | while read line; do
108 | if [[ $line != "${PODS_ROOT}*" ]]; then
109 | XCASSET_FILES+=("$line")
110 | fi
111 | done <<<"$OTHER_XCASSETS"
112 |
113 | if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then
114 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
115 | else
116 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist"
117 | fi
118 | fi
119 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-PowerUpSwift_Example/Pods-PowerUpSwift_Example-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
14 | FOUNDATION_EXPORT double Pods_PowerUpSwift_ExampleVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char Pods_PowerUpSwift_ExampleVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-PowerUpSwift_Example/Pods-PowerUpSwift_Example.debug.xcconfig:
--------------------------------------------------------------------------------
1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
2 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/PowerUpSwift"
4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
5 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/PowerUpSwift/PowerUpSwift.framework/Headers"
6 | LD_RUNPATH_SEARCH_PATHS = $(inherited) /usr/lib/swift '@executable_path/Frameworks' '@loader_path/Frameworks'
7 | LIBRARY_SEARCH_PATHS = $(inherited) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift
8 | OTHER_LDFLAGS = $(inherited) -framework "CoreLocation" -framework "Foundation" -framework "PowerUpSwift" -framework "UIKit"
9 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
10 | PODS_BUILD_DIR = ${BUILD_DIR}
11 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
12 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
13 | PODS_ROOT = ${SRCROOT}/Pods
14 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
15 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
16 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-PowerUpSwift_Example/Pods-PowerUpSwift_Example.modulemap:
--------------------------------------------------------------------------------
1 | framework module Pods_PowerUpSwift_Example {
2 | umbrella header "Pods-PowerUpSwift_Example-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-PowerUpSwift_Example/Pods-PowerUpSwift_Example.release.xcconfig:
--------------------------------------------------------------------------------
1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
2 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/PowerUpSwift"
4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
5 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/PowerUpSwift/PowerUpSwift.framework/Headers"
6 | LD_RUNPATH_SEARCH_PATHS = $(inherited) /usr/lib/swift '@executable_path/Frameworks' '@loader_path/Frameworks'
7 | LIBRARY_SEARCH_PATHS = $(inherited) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift
8 | OTHER_LDFLAGS = $(inherited) -framework "CoreLocation" -framework "Foundation" -framework "PowerUpSwift" -framework "UIKit"
9 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
10 | PODS_BUILD_DIR = ${BUILD_DIR}
11 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
12 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
13 | PODS_ROOT = ${SRCROOT}/Pods
14 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
15 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
16 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-PowerUpSwift_Tests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-PowerUpSwift_Tests/Pods-PowerUpSwift_Tests-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-PowerUpSwift_Tests/Pods-PowerUpSwift_Tests-acknowledgements.markdown:
--------------------------------------------------------------------------------
1 | # Acknowledgements
2 | This application makes use of the following third party libraries:
3 | Generated by CocoaPods - https://cocoapods.org
4 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-PowerUpSwift_Tests/Pods-PowerUpSwift_Tests-acknowledgements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreferenceSpecifiers
6 |
7 |
8 | FooterText
9 | This application makes use of the following third party libraries:
10 | Title
11 | Acknowledgements
12 | Type
13 | PSGroupSpecifier
14 |
15 |
16 | FooterText
17 | Generated by CocoaPods - https://cocoapods.org
18 | Title
19 |
20 | Type
21 | PSGroupSpecifier
22 |
23 |
24 | StringsTable
25 | Acknowledgements
26 | Title
27 | Acknowledgements
28 |
29 |
30 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-PowerUpSwift_Tests/Pods-PowerUpSwift_Tests-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_PowerUpSwift_Tests : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_PowerUpSwift_Tests
5 | @end
6 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-PowerUpSwift_Tests/Pods-PowerUpSwift_Tests-frameworks.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 | set -u
4 | set -o pipefail
5 |
6 | if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then
7 | # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy
8 | # frameworks to, so exit 0 (signalling the script phase was successful).
9 | exit 0
10 | fi
11 |
12 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
13 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
14 |
15 | COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}"
16 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
17 |
18 | # Used as a return value for each invocation of `strip_invalid_archs` function.
19 | STRIP_BINARY_RETVAL=0
20 |
21 | # This protects against multiple targets copying the same framework dependency at the same time. The solution
22 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
23 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
24 |
25 | # Copies and strips a vendored framework
26 | install_framework()
27 | {
28 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
29 | local source="${BUILT_PRODUCTS_DIR}/$1"
30 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
31 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
32 | elif [ -r "$1" ]; then
33 | local source="$1"
34 | fi
35 |
36 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
37 |
38 | if [ -L "${source}" ]; then
39 | echo "Symlinked..."
40 | source="$(readlink "${source}")"
41 | fi
42 |
43 | # Use filter instead of exclude so missing patterns don't throw errors.
44 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
45 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
46 |
47 | local basename
48 | basename="$(basename -s .framework "$1")"
49 | binary="${destination}/${basename}.framework/${basename}"
50 | if ! [ -r "$binary" ]; then
51 | binary="${destination}/${basename}"
52 | fi
53 |
54 | # Strip invalid architectures so "fat" simulator / device frameworks work on device
55 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
56 | strip_invalid_archs "$binary"
57 | fi
58 |
59 | # Resign the code if required by the build settings to avoid unstable apps
60 | code_sign_if_enabled "${destination}/$(basename "$1")"
61 |
62 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
63 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
64 | local swift_runtime_libs
65 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
66 | for lib in $swift_runtime_libs; do
67 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
68 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
69 | code_sign_if_enabled "${destination}/${lib}"
70 | done
71 | fi
72 | }
73 |
74 | # Copies and strips a vendored dSYM
75 | install_dsym() {
76 | local source="$1"
77 | if [ -r "$source" ]; then
78 | # Copy the dSYM into a the targets temp dir.
79 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\""
80 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}"
81 |
82 | local basename
83 | basename="$(basename -s .framework.dSYM "$source")"
84 | binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}"
85 |
86 | # Strip invalid architectures so "fat" simulator / device frameworks work on device
87 | if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then
88 | strip_invalid_archs "$binary"
89 | fi
90 |
91 | if [[ $STRIP_BINARY_RETVAL == 1 ]]; then
92 | # Move the stripped file into its final destination.
93 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\""
94 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}"
95 | else
96 | # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing.
97 | touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM"
98 | fi
99 | fi
100 | }
101 |
102 | # Signs a framework with the provided identity
103 | code_sign_if_enabled() {
104 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
105 | # Use the current code_sign_identitiy
106 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
107 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'"
108 |
109 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
110 | code_sign_cmd="$code_sign_cmd &"
111 | fi
112 | echo "$code_sign_cmd"
113 | eval "$code_sign_cmd"
114 | fi
115 | }
116 |
117 | # Strip invalid architectures
118 | strip_invalid_archs() {
119 | binary="$1"
120 | # Get architectures for current target binary
121 | binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)"
122 | # Intersect them with the architectures we are building for
123 | intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)"
124 | # If there are no archs supported by this binary then warn the user
125 | if [[ -z "$intersected_archs" ]]; then
126 | echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)."
127 | STRIP_BINARY_RETVAL=0
128 | return
129 | fi
130 | stripped=""
131 | for arch in $binary_archs; do
132 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then
133 | # Strip non-valid architectures in-place
134 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1
135 | stripped="$stripped $arch"
136 | fi
137 | done
138 | if [[ "$stripped" ]]; then
139 | echo "Stripped $binary of architectures:$stripped"
140 | fi
141 | STRIP_BINARY_RETVAL=1
142 | }
143 |
144 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
145 | wait
146 | fi
147 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-PowerUpSwift_Tests/Pods-PowerUpSwift_Tests-resources.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 | set -u
4 | set -o pipefail
5 |
6 | if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then
7 | # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy
8 | # resources to, so exit 0 (signalling the script phase was successful).
9 | exit 0
10 | fi
11 |
12 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
13 |
14 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
15 | > "$RESOURCES_TO_COPY"
16 |
17 | XCASSET_FILES=()
18 |
19 | # This protects against multiple targets copying the same framework dependency at the same time. The solution
20 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
21 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
22 |
23 | case "${TARGETED_DEVICE_FAMILY:-}" in
24 | 1,2)
25 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
26 | ;;
27 | 1)
28 | TARGET_DEVICE_ARGS="--target-device iphone"
29 | ;;
30 | 2)
31 | TARGET_DEVICE_ARGS="--target-device ipad"
32 | ;;
33 | 3)
34 | TARGET_DEVICE_ARGS="--target-device tv"
35 | ;;
36 | 4)
37 | TARGET_DEVICE_ARGS="--target-device watch"
38 | ;;
39 | *)
40 | TARGET_DEVICE_ARGS="--target-device mac"
41 | ;;
42 | esac
43 |
44 | install_resource()
45 | {
46 | if [[ "$1" = /* ]] ; then
47 | RESOURCE_PATH="$1"
48 | else
49 | RESOURCE_PATH="${PODS_ROOT}/$1"
50 | fi
51 | if [[ ! -e "$RESOURCE_PATH" ]] ; then
52 | cat << EOM
53 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script.
54 | EOM
55 | exit 1
56 | fi
57 | case $RESOURCE_PATH in
58 | *.storyboard)
59 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true
60 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
61 | ;;
62 | *.xib)
63 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true
64 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
65 | ;;
66 | *.framework)
67 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
68 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
69 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
70 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
71 | ;;
72 | *.xcdatamodel)
73 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true
74 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
75 | ;;
76 | *.xcdatamodeld)
77 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true
78 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
79 | ;;
80 | *.xcmappingmodel)
81 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true
82 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
83 | ;;
84 | *.xcassets)
85 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH"
86 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
87 | ;;
88 | *)
89 | echo "$RESOURCE_PATH" || true
90 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
91 | ;;
92 | esac
93 | }
94 |
95 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
96 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
97 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
98 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
99 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
100 | fi
101 | rm -f "$RESOURCES_TO_COPY"
102 |
103 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ]
104 | then
105 | # Find all other xcassets (this unfortunately includes those of path pods and other targets).
106 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
107 | while read line; do
108 | if [[ $line != "${PODS_ROOT}*" ]]; then
109 | XCASSET_FILES+=("$line")
110 | fi
111 | done <<<"$OTHER_XCASSETS"
112 |
113 | if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then
114 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
115 | else
116 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist"
117 | fi
118 | fi
119 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-PowerUpSwift_Tests/Pods-PowerUpSwift_Tests-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
14 | FOUNDATION_EXPORT double Pods_PowerUpSwift_TestsVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char Pods_PowerUpSwift_TestsVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-PowerUpSwift_Tests/Pods-PowerUpSwift_Tests.debug.xcconfig:
--------------------------------------------------------------------------------
1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/PowerUpSwift"
3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/PowerUpSwift/PowerUpSwift.framework/Headers"
5 | OTHER_LDFLAGS = $(inherited) -framework "CoreLocation" -framework "Foundation" -framework "PowerUpSwift" -framework "UIKit"
6 | PODS_BUILD_DIR = ${BUILD_DIR}
7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
9 | PODS_ROOT = ${SRCROOT}/Pods
10 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
11 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
12 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-PowerUpSwift_Tests/Pods-PowerUpSwift_Tests.modulemap:
--------------------------------------------------------------------------------
1 | framework module Pods_PowerUpSwift_Tests {
2 | umbrella header "Pods-PowerUpSwift_Tests-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-PowerUpSwift_Tests/Pods-PowerUpSwift_Tests.release.xcconfig:
--------------------------------------------------------------------------------
1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/PowerUpSwift"
3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/PowerUpSwift/PowerUpSwift.framework/Headers"
5 | OTHER_LDFLAGS = $(inherited) -framework "CoreLocation" -framework "Foundation" -framework "PowerUpSwift" -framework "UIKit"
6 | PODS_BUILD_DIR = ${BUILD_DIR}
7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
9 | PODS_ROOT = ${SRCROOT}/Pods
10 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
11 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
12 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/PowerUpSwift/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 0.1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/PowerUpSwift/PowerUpSwift-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 2.1.4
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/PowerUpSwift/PowerUpSwift-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_PowerUpSwift : NSObject
3 | @end
4 | @implementation PodsDummy_PowerUpSwift
5 | @end
6 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/PowerUpSwift/PowerUpSwift-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/PowerUpSwift/PowerUpSwift-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
14 | FOUNDATION_EXPORT double PowerUpSwiftVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char PowerUpSwiftVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/PowerUpSwift/PowerUpSwift.debug.xcconfig:
--------------------------------------------------------------------------------
1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/PowerUpSwift
3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
4 | LIBRARY_SEARCH_PATHS = $(inherited) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift
5 | OTHER_LDFLAGS = $(inherited) -framework "CoreLocation" -framework "Foundation" -framework "UIKit"
6 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
7 | PODS_BUILD_DIR = ${BUILD_DIR}
8 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
9 | PODS_ROOT = ${SRCROOT}
10 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../..
11 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
12 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
13 | SKIP_INSTALL = YES
14 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
15 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/PowerUpSwift/PowerUpSwift.modulemap:
--------------------------------------------------------------------------------
1 | framework module PowerUpSwift {
2 | umbrella header "PowerUpSwift-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/PowerUpSwift/PowerUpSwift.release.xcconfig:
--------------------------------------------------------------------------------
1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/PowerUpSwift
3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
4 | LIBRARY_SEARCH_PATHS = $(inherited) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift
5 | OTHER_LDFLAGS = $(inherited) -framework "CoreLocation" -framework "Foundation" -framework "UIKit"
6 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
7 | PODS_BUILD_DIR = ${BUILD_DIR}
8 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
9 | PODS_ROOT = ${SRCROOT}
10 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../..
11 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
12 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
13 | SKIP_INSTALL = YES
14 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
15 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/PowerUpSwift/PowerUpSwift.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/PowerUpSwift
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | OTHER_LDFLAGS = $(inherited) -framework "Foundation" -framework "UIKit"
4 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
5 | PODS_BUILD_DIR = ${BUILD_DIR}
6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
7 | PODS_ROOT = ${SRCROOT}
8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../..
9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
10 | SKIP_INSTALL = YES
11 |
--------------------------------------------------------------------------------
/Example/PowerUpSwift.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 21BC8349C47DF952E98EC4C6 /* Pods_PowerUpSwift_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B69970876ADAAA54935B397B /* Pods_PowerUpSwift_Example.framework */; };
11 | 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD51AFB9204008FA782 /* AppDelegate.swift */; };
12 | 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD71AFB9204008FA782 /* ViewController.swift */; };
13 | 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607FACD91AFB9204008FA782 /* Main.storyboard */; };
14 | 607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDC1AFB9204008FA782 /* Images.xcassets */; };
15 | 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; };
16 | 6EDD476E216D87E4001A1A0A /* StringTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6EDD476D216D87E4001A1A0A /* StringTests.swift */; };
17 | 78119FF0D06E65B60C394EC6 /* Pods_PowerUpSwift_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 44A4533003462F3552AD54E8 /* Pods_PowerUpSwift_Tests.framework */; };
18 | B81FBAD8219736CD00ACECD3 /* BoolTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B81FBAD7219736CD00ACECD3 /* BoolTests.swift */; };
19 | /* End PBXBuildFile section */
20 |
21 | /* Begin PBXContainerItemProxy section */
22 | 607FACE61AFB9204008FA782 /* PBXContainerItemProxy */ = {
23 | isa = PBXContainerItemProxy;
24 | containerPortal = 607FACC81AFB9204008FA782 /* Project object */;
25 | proxyType = 1;
26 | remoteGlobalIDString = 607FACCF1AFB9204008FA782;
27 | remoteInfo = PowerUpSwift;
28 | };
29 | /* End PBXContainerItemProxy section */
30 |
31 | /* Begin PBXFileReference section */
32 | 2D3E294AF873A35662CD433A /* Pods-PowerUpSwift_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PowerUpSwift_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-PowerUpSwift_Tests/Pods-PowerUpSwift_Tests.release.xcconfig"; sourceTree = ""; };
33 | 323B02A13EAA7EAAF9757F6C /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; };
34 | 44A4533003462F3552AD54E8 /* Pods_PowerUpSwift_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_PowerUpSwift_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
35 | 607FACD01AFB9204008FA782 /* PowerUpSwift_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PowerUpSwift_Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
36 | 607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
37 | 607FACD51AFB9204008FA782 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
38 | 607FACD71AFB9204008FA782 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; };
39 | 607FACDA1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
40 | 607FACDC1AFB9204008FA782 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; };
41 | 607FACDF1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; };
42 | 607FACE51AFB9204008FA782 /* PowerUpSwift_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PowerUpSwift_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
43 | 607FACEA1AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
44 | 6EDD476D216D87E4001A1A0A /* StringTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringTests.swift; sourceTree = ""; };
45 | 78FBDB50BD06FB8DF10BA02C /* PowerUpSwift.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = PowerUpSwift.podspec; path = ../PowerUpSwift.podspec; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
46 | 8AF1D40FB5D61E9C6AB88C43 /* Pods-PowerUpSwift_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PowerUpSwift_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-PowerUpSwift_Tests/Pods-PowerUpSwift_Tests.debug.xcconfig"; sourceTree = ""; };
47 | B3E9206C5BFD448BCC765954 /* Pods-PowerUpSwift_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PowerUpSwift_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-PowerUpSwift_Example/Pods-PowerUpSwift_Example.release.xcconfig"; sourceTree = ""; };
48 | B69970876ADAAA54935B397B /* Pods_PowerUpSwift_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_PowerUpSwift_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
49 | B81FBAD7219736CD00ACECD3 /* BoolTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BoolTests.swift; sourceTree = ""; };
50 | E2047EBCA40ED83D0BF1FFFA /* Pods-PowerUpSwift_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PowerUpSwift_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-PowerUpSwift_Example/Pods-PowerUpSwift_Example.debug.xcconfig"; sourceTree = ""; };
51 | F621A387AC185E1BF0338DCF /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; };
52 | /* End PBXFileReference section */
53 |
54 | /* Begin PBXFrameworksBuildPhase section */
55 | 607FACCD1AFB9204008FA782 /* Frameworks */ = {
56 | isa = PBXFrameworksBuildPhase;
57 | buildActionMask = 2147483647;
58 | files = (
59 | 21BC8349C47DF952E98EC4C6 /* Pods_PowerUpSwift_Example.framework in Frameworks */,
60 | );
61 | runOnlyForDeploymentPostprocessing = 0;
62 | };
63 | 607FACE21AFB9204008FA782 /* Frameworks */ = {
64 | isa = PBXFrameworksBuildPhase;
65 | buildActionMask = 2147483647;
66 | files = (
67 | 78119FF0D06E65B60C394EC6 /* Pods_PowerUpSwift_Tests.framework in Frameworks */,
68 | );
69 | runOnlyForDeploymentPostprocessing = 0;
70 | };
71 | /* End PBXFrameworksBuildPhase section */
72 |
73 | /* Begin PBXGroup section */
74 | 0D63D200038105D45562EFF8 /* Pods */ = {
75 | isa = PBXGroup;
76 | children = (
77 | E2047EBCA40ED83D0BF1FFFA /* Pods-PowerUpSwift_Example.debug.xcconfig */,
78 | B3E9206C5BFD448BCC765954 /* Pods-PowerUpSwift_Example.release.xcconfig */,
79 | 8AF1D40FB5D61E9C6AB88C43 /* Pods-PowerUpSwift_Tests.debug.xcconfig */,
80 | 2D3E294AF873A35662CD433A /* Pods-PowerUpSwift_Tests.release.xcconfig */,
81 | );
82 | name = Pods;
83 | sourceTree = "";
84 | };
85 | 607FACC71AFB9204008FA782 = {
86 | isa = PBXGroup;
87 | children = (
88 | 607FACF51AFB993E008FA782 /* Podspec Metadata */,
89 | 607FACD21AFB9204008FA782 /* Example for PowerUpSwift */,
90 | 607FACE81AFB9204008FA782 /* Tests */,
91 | 607FACD11AFB9204008FA782 /* Products */,
92 | 0D63D200038105D45562EFF8 /* Pods */,
93 | 81243EB6E12F98A4F0D6F4F4 /* Frameworks */,
94 | );
95 | sourceTree = "";
96 | };
97 | 607FACD11AFB9204008FA782 /* Products */ = {
98 | isa = PBXGroup;
99 | children = (
100 | 607FACD01AFB9204008FA782 /* PowerUpSwift_Example.app */,
101 | 607FACE51AFB9204008FA782 /* PowerUpSwift_Tests.xctest */,
102 | );
103 | name = Products;
104 | sourceTree = "";
105 | };
106 | 607FACD21AFB9204008FA782 /* Example for PowerUpSwift */ = {
107 | isa = PBXGroup;
108 | children = (
109 | 607FACD51AFB9204008FA782 /* AppDelegate.swift */,
110 | 607FACD71AFB9204008FA782 /* ViewController.swift */,
111 | 607FACD91AFB9204008FA782 /* Main.storyboard */,
112 | 607FACDC1AFB9204008FA782 /* Images.xcassets */,
113 | 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */,
114 | 607FACD31AFB9204008FA782 /* Supporting Files */,
115 | );
116 | name = "Example for PowerUpSwift";
117 | path = PowerUpSwift;
118 | sourceTree = "";
119 | };
120 | 607FACD31AFB9204008FA782 /* Supporting Files */ = {
121 | isa = PBXGroup;
122 | children = (
123 | 607FACD41AFB9204008FA782 /* Info.plist */,
124 | );
125 | name = "Supporting Files";
126 | sourceTree = "";
127 | };
128 | 607FACE81AFB9204008FA782 /* Tests */ = {
129 | isa = PBXGroup;
130 | children = (
131 | B81FBAD7219736CD00ACECD3 /* BoolTests.swift */,
132 | 6EDD476D216D87E4001A1A0A /* StringTests.swift */,
133 | 607FACE91AFB9204008FA782 /* Supporting Files */,
134 | );
135 | path = Tests;
136 | sourceTree = "";
137 | };
138 | 607FACE91AFB9204008FA782 /* Supporting Files */ = {
139 | isa = PBXGroup;
140 | children = (
141 | 607FACEA1AFB9204008FA782 /* Info.plist */,
142 | );
143 | name = "Supporting Files";
144 | sourceTree = "";
145 | };
146 | 607FACF51AFB993E008FA782 /* Podspec Metadata */ = {
147 | isa = PBXGroup;
148 | children = (
149 | 78FBDB50BD06FB8DF10BA02C /* PowerUpSwift.podspec */,
150 | 323B02A13EAA7EAAF9757F6C /* README.md */,
151 | F621A387AC185E1BF0338DCF /* LICENSE */,
152 | );
153 | name = "Podspec Metadata";
154 | sourceTree = "";
155 | };
156 | 81243EB6E12F98A4F0D6F4F4 /* Frameworks */ = {
157 | isa = PBXGroup;
158 | children = (
159 | B69970876ADAAA54935B397B /* Pods_PowerUpSwift_Example.framework */,
160 | 44A4533003462F3552AD54E8 /* Pods_PowerUpSwift_Tests.framework */,
161 | );
162 | name = Frameworks;
163 | sourceTree = "";
164 | };
165 | /* End PBXGroup section */
166 |
167 | /* Begin PBXNativeTarget section */
168 | 607FACCF1AFB9204008FA782 /* PowerUpSwift_Example */ = {
169 | isa = PBXNativeTarget;
170 | buildConfigurationList = 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "PowerUpSwift_Example" */;
171 | buildPhases = (
172 | 46CEADCD01E085B20A007E99 /* [CP] Check Pods Manifest.lock */,
173 | 607FACCC1AFB9204008FA782 /* Sources */,
174 | 607FACCD1AFB9204008FA782 /* Frameworks */,
175 | 607FACCE1AFB9204008FA782 /* Resources */,
176 | 9CCBB11E898D3D27D502A22F /* [CP] Embed Pods Frameworks */,
177 | );
178 | buildRules = (
179 | );
180 | dependencies = (
181 | );
182 | name = PowerUpSwift_Example;
183 | productName = PowerUpSwift;
184 | productReference = 607FACD01AFB9204008FA782 /* PowerUpSwift_Example.app */;
185 | productType = "com.apple.product-type.application";
186 | };
187 | 607FACE41AFB9204008FA782 /* PowerUpSwift_Tests */ = {
188 | isa = PBXNativeTarget;
189 | buildConfigurationList = 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "PowerUpSwift_Tests" */;
190 | buildPhases = (
191 | 6BEF00E67792625B7587117F /* [CP] Check Pods Manifest.lock */,
192 | 607FACE11AFB9204008FA782 /* Sources */,
193 | 607FACE21AFB9204008FA782 /* Frameworks */,
194 | 607FACE31AFB9204008FA782 /* Resources */,
195 | );
196 | buildRules = (
197 | );
198 | dependencies = (
199 | 607FACE71AFB9204008FA782 /* PBXTargetDependency */,
200 | );
201 | name = PowerUpSwift_Tests;
202 | productName = Tests;
203 | productReference = 607FACE51AFB9204008FA782 /* PowerUpSwift_Tests.xctest */;
204 | productType = "com.apple.product-type.bundle.unit-test";
205 | };
206 | /* End PBXNativeTarget section */
207 |
208 | /* Begin PBXProject section */
209 | 607FACC81AFB9204008FA782 /* Project object */ = {
210 | isa = PBXProject;
211 | attributes = {
212 | LastSwiftUpdateCheck = 0830;
213 | LastUpgradeCheck = 1020;
214 | ORGANIZATIONNAME = "Ceferino Jose II";
215 | TargetAttributes = {
216 | 607FACCF1AFB9204008FA782 = {
217 | CreatedOnToolsVersion = 6.3.1;
218 | DevelopmentTeam = C6QFYYTZ55;
219 | LastSwiftMigration = 1020;
220 | };
221 | 607FACE41AFB9204008FA782 = {
222 | CreatedOnToolsVersion = 6.3.1;
223 | DevelopmentTeam = C6QFYYTZ55;
224 | LastSwiftMigration = 1020;
225 | TestTargetID = 607FACCF1AFB9204008FA782;
226 | };
227 | };
228 | };
229 | buildConfigurationList = 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "PowerUpSwift" */;
230 | compatibilityVersion = "Xcode 3.2";
231 | developmentRegion = en;
232 | hasScannedForEncodings = 0;
233 | knownRegions = (
234 | en,
235 | Base,
236 | );
237 | mainGroup = 607FACC71AFB9204008FA782;
238 | productRefGroup = 607FACD11AFB9204008FA782 /* Products */;
239 | projectDirPath = "";
240 | projectRoot = "";
241 | targets = (
242 | 607FACCF1AFB9204008FA782 /* PowerUpSwift_Example */,
243 | 607FACE41AFB9204008FA782 /* PowerUpSwift_Tests */,
244 | );
245 | };
246 | /* End PBXProject section */
247 |
248 | /* Begin PBXResourcesBuildPhase section */
249 | 607FACCE1AFB9204008FA782 /* Resources */ = {
250 | isa = PBXResourcesBuildPhase;
251 | buildActionMask = 2147483647;
252 | files = (
253 | 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */,
254 | 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */,
255 | 607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */,
256 | );
257 | runOnlyForDeploymentPostprocessing = 0;
258 | };
259 | 607FACE31AFB9204008FA782 /* Resources */ = {
260 | isa = PBXResourcesBuildPhase;
261 | buildActionMask = 2147483647;
262 | files = (
263 | );
264 | runOnlyForDeploymentPostprocessing = 0;
265 | };
266 | /* End PBXResourcesBuildPhase section */
267 |
268 | /* Begin PBXShellScriptBuildPhase section */
269 | 46CEADCD01E085B20A007E99 /* [CP] Check Pods Manifest.lock */ = {
270 | isa = PBXShellScriptBuildPhase;
271 | buildActionMask = 2147483647;
272 | files = (
273 | );
274 | inputPaths = (
275 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
276 | "${PODS_ROOT}/Manifest.lock",
277 | );
278 | name = "[CP] Check Pods Manifest.lock";
279 | outputPaths = (
280 | "$(DERIVED_FILE_DIR)/Pods-PowerUpSwift_Example-checkManifestLockResult.txt",
281 | );
282 | runOnlyForDeploymentPostprocessing = 0;
283 | shellPath = /bin/sh;
284 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
285 | showEnvVarsInLog = 0;
286 | };
287 | 6BEF00E67792625B7587117F /* [CP] Check Pods Manifest.lock */ = {
288 | isa = PBXShellScriptBuildPhase;
289 | buildActionMask = 2147483647;
290 | files = (
291 | );
292 | inputPaths = (
293 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
294 | "${PODS_ROOT}/Manifest.lock",
295 | );
296 | name = "[CP] Check Pods Manifest.lock";
297 | outputPaths = (
298 | "$(DERIVED_FILE_DIR)/Pods-PowerUpSwift_Tests-checkManifestLockResult.txt",
299 | );
300 | runOnlyForDeploymentPostprocessing = 0;
301 | shellPath = /bin/sh;
302 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
303 | showEnvVarsInLog = 0;
304 | };
305 | 9CCBB11E898D3D27D502A22F /* [CP] Embed Pods Frameworks */ = {
306 | isa = PBXShellScriptBuildPhase;
307 | buildActionMask = 2147483647;
308 | files = (
309 | );
310 | inputPaths = (
311 | "${PODS_ROOT}/Target Support Files/Pods-PowerUpSwift_Example/Pods-PowerUpSwift_Example-frameworks.sh",
312 | "${BUILT_PRODUCTS_DIR}/PowerUpSwift/PowerUpSwift.framework",
313 | );
314 | name = "[CP] Embed Pods Frameworks";
315 | outputPaths = (
316 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PowerUpSwift.framework",
317 | );
318 | runOnlyForDeploymentPostprocessing = 0;
319 | shellPath = /bin/sh;
320 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-PowerUpSwift_Example/Pods-PowerUpSwift_Example-frameworks.sh\"\n";
321 | showEnvVarsInLog = 0;
322 | };
323 | /* End PBXShellScriptBuildPhase section */
324 |
325 | /* Begin PBXSourcesBuildPhase section */
326 | 607FACCC1AFB9204008FA782 /* Sources */ = {
327 | isa = PBXSourcesBuildPhase;
328 | buildActionMask = 2147483647;
329 | files = (
330 | 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */,
331 | 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */,
332 | );
333 | runOnlyForDeploymentPostprocessing = 0;
334 | };
335 | 607FACE11AFB9204008FA782 /* Sources */ = {
336 | isa = PBXSourcesBuildPhase;
337 | buildActionMask = 2147483647;
338 | files = (
339 | 6EDD476E216D87E4001A1A0A /* StringTests.swift in Sources */,
340 | B81FBAD8219736CD00ACECD3 /* BoolTests.swift in Sources */,
341 | );
342 | runOnlyForDeploymentPostprocessing = 0;
343 | };
344 | /* End PBXSourcesBuildPhase section */
345 |
346 | /* Begin PBXTargetDependency section */
347 | 607FACE71AFB9204008FA782 /* PBXTargetDependency */ = {
348 | isa = PBXTargetDependency;
349 | target = 607FACCF1AFB9204008FA782 /* PowerUpSwift_Example */;
350 | targetProxy = 607FACE61AFB9204008FA782 /* PBXContainerItemProxy */;
351 | };
352 | /* End PBXTargetDependency section */
353 |
354 | /* Begin PBXVariantGroup section */
355 | 607FACD91AFB9204008FA782 /* Main.storyboard */ = {
356 | isa = PBXVariantGroup;
357 | children = (
358 | 607FACDA1AFB9204008FA782 /* Base */,
359 | );
360 | name = Main.storyboard;
361 | sourceTree = "";
362 | };
363 | 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */ = {
364 | isa = PBXVariantGroup;
365 | children = (
366 | 607FACDF1AFB9204008FA782 /* Base */,
367 | );
368 | name = LaunchScreen.xib;
369 | sourceTree = "";
370 | };
371 | /* End PBXVariantGroup section */
372 |
373 | /* Begin XCBuildConfiguration section */
374 | 607FACED1AFB9204008FA782 /* Debug */ = {
375 | isa = XCBuildConfiguration;
376 | buildSettings = {
377 | ALWAYS_SEARCH_USER_PATHS = NO;
378 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
379 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
380 | CLANG_CXX_LIBRARY = "libc++";
381 | CLANG_ENABLE_MODULES = YES;
382 | CLANG_ENABLE_OBJC_ARC = YES;
383 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
384 | CLANG_WARN_BOOL_CONVERSION = YES;
385 | CLANG_WARN_COMMA = YES;
386 | CLANG_WARN_CONSTANT_CONVERSION = YES;
387 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
388 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
389 | CLANG_WARN_EMPTY_BODY = YES;
390 | CLANG_WARN_ENUM_CONVERSION = YES;
391 | CLANG_WARN_INFINITE_RECURSION = YES;
392 | CLANG_WARN_INT_CONVERSION = YES;
393 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
394 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
395 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
396 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
397 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
398 | CLANG_WARN_STRICT_PROTOTYPES = YES;
399 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
400 | CLANG_WARN_UNREACHABLE_CODE = YES;
401 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
402 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
403 | COPY_PHASE_STRIP = NO;
404 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
405 | ENABLE_STRICT_OBJC_MSGSEND = YES;
406 | ENABLE_TESTABILITY = YES;
407 | GCC_C_LANGUAGE_STANDARD = gnu99;
408 | GCC_DYNAMIC_NO_PIC = NO;
409 | GCC_NO_COMMON_BLOCKS = YES;
410 | GCC_OPTIMIZATION_LEVEL = 0;
411 | GCC_PREPROCESSOR_DEFINITIONS = (
412 | "DEBUG=1",
413 | "$(inherited)",
414 | );
415 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
416 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
417 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
418 | GCC_WARN_UNDECLARED_SELECTOR = YES;
419 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
420 | GCC_WARN_UNUSED_FUNCTION = YES;
421 | GCC_WARN_UNUSED_VARIABLE = YES;
422 | IPHONEOS_DEPLOYMENT_TARGET = 12.0;
423 | MTL_ENABLE_DEBUG_INFO = YES;
424 | ONLY_ACTIVE_ARCH = YES;
425 | SDKROOT = iphoneos;
426 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
427 | SWIFT_VERSION = 5.0;
428 | };
429 | name = Debug;
430 | };
431 | 607FACEE1AFB9204008FA782 /* Release */ = {
432 | isa = XCBuildConfiguration;
433 | buildSettings = {
434 | ALWAYS_SEARCH_USER_PATHS = NO;
435 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
436 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
437 | CLANG_CXX_LIBRARY = "libc++";
438 | CLANG_ENABLE_MODULES = YES;
439 | CLANG_ENABLE_OBJC_ARC = YES;
440 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
441 | CLANG_WARN_BOOL_CONVERSION = YES;
442 | CLANG_WARN_COMMA = YES;
443 | CLANG_WARN_CONSTANT_CONVERSION = YES;
444 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
445 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
446 | CLANG_WARN_EMPTY_BODY = YES;
447 | CLANG_WARN_ENUM_CONVERSION = YES;
448 | CLANG_WARN_INFINITE_RECURSION = YES;
449 | CLANG_WARN_INT_CONVERSION = YES;
450 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
451 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
452 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
453 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
454 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
455 | CLANG_WARN_STRICT_PROTOTYPES = YES;
456 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
457 | CLANG_WARN_UNREACHABLE_CODE = YES;
458 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
459 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
460 | COPY_PHASE_STRIP = NO;
461 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
462 | ENABLE_NS_ASSERTIONS = NO;
463 | ENABLE_STRICT_OBJC_MSGSEND = YES;
464 | GCC_C_LANGUAGE_STANDARD = gnu99;
465 | GCC_NO_COMMON_BLOCKS = YES;
466 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
467 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
468 | GCC_WARN_UNDECLARED_SELECTOR = YES;
469 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
470 | GCC_WARN_UNUSED_FUNCTION = YES;
471 | GCC_WARN_UNUSED_VARIABLE = YES;
472 | IPHONEOS_DEPLOYMENT_TARGET = 12.0;
473 | MTL_ENABLE_DEBUG_INFO = NO;
474 | SDKROOT = iphoneos;
475 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
476 | SWIFT_VERSION = 5.0;
477 | VALIDATE_PRODUCT = YES;
478 | };
479 | name = Release;
480 | };
481 | 607FACF01AFB9204008FA782 /* Debug */ = {
482 | isa = XCBuildConfiguration;
483 | baseConfigurationReference = E2047EBCA40ED83D0BF1FFFA /* Pods-PowerUpSwift_Example.debug.xcconfig */;
484 | buildSettings = {
485 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
486 | DEVELOPMENT_TEAM = C6QFYYTZ55;
487 | INFOPLIST_FILE = PowerUpSwift/Info.plist;
488 | IPHONEOS_DEPLOYMENT_TARGET = 12.0;
489 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
490 | MODULE_NAME = ExampleApp;
491 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
492 | PRODUCT_NAME = "$(TARGET_NAME)";
493 | SWIFT_VERSION = 5.0;
494 | };
495 | name = Debug;
496 | };
497 | 607FACF11AFB9204008FA782 /* Release */ = {
498 | isa = XCBuildConfiguration;
499 | baseConfigurationReference = B3E9206C5BFD448BCC765954 /* Pods-PowerUpSwift_Example.release.xcconfig */;
500 | buildSettings = {
501 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
502 | DEVELOPMENT_TEAM = C6QFYYTZ55;
503 | INFOPLIST_FILE = PowerUpSwift/Info.plist;
504 | IPHONEOS_DEPLOYMENT_TARGET = 12.0;
505 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
506 | MODULE_NAME = ExampleApp;
507 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
508 | PRODUCT_NAME = "$(TARGET_NAME)";
509 | SWIFT_VERSION = 5.0;
510 | };
511 | name = Release;
512 | };
513 | 607FACF31AFB9204008FA782 /* Debug */ = {
514 | isa = XCBuildConfiguration;
515 | baseConfigurationReference = 8AF1D40FB5D61E9C6AB88C43 /* Pods-PowerUpSwift_Tests.debug.xcconfig */;
516 | buildSettings = {
517 | CLANG_ENABLE_MODULES = YES;
518 | DEVELOPMENT_TEAM = C6QFYYTZ55;
519 | FRAMEWORK_SEARCH_PATHS = (
520 | "$(SDKROOT)/Developer/Library/Frameworks",
521 | "$(inherited)",
522 | );
523 | GCC_PREPROCESSOR_DEFINITIONS = (
524 | "DEBUG=1",
525 | "$(inherited)",
526 | );
527 | INFOPLIST_FILE = Tests/Info.plist;
528 | IPHONEOS_DEPLOYMENT_TARGET = 12.0;
529 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
530 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
531 | PRODUCT_NAME = "$(TARGET_NAME)";
532 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
533 | SWIFT_VERSION = 5.0;
534 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PowerUpSwift_Example.app/PowerUpSwift_Example";
535 | };
536 | name = Debug;
537 | };
538 | 607FACF41AFB9204008FA782 /* Release */ = {
539 | isa = XCBuildConfiguration;
540 | baseConfigurationReference = 2D3E294AF873A35662CD433A /* Pods-PowerUpSwift_Tests.release.xcconfig */;
541 | buildSettings = {
542 | CLANG_ENABLE_MODULES = YES;
543 | DEVELOPMENT_TEAM = C6QFYYTZ55;
544 | FRAMEWORK_SEARCH_PATHS = (
545 | "$(SDKROOT)/Developer/Library/Frameworks",
546 | "$(inherited)",
547 | );
548 | INFOPLIST_FILE = Tests/Info.plist;
549 | IPHONEOS_DEPLOYMENT_TARGET = 12.0;
550 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
551 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
552 | PRODUCT_NAME = "$(TARGET_NAME)";
553 | SWIFT_VERSION = 5.0;
554 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PowerUpSwift_Example.app/PowerUpSwift_Example";
555 | };
556 | name = Release;
557 | };
558 | /* End XCBuildConfiguration section */
559 |
560 | /* Begin XCConfigurationList section */
561 | 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "PowerUpSwift" */ = {
562 | isa = XCConfigurationList;
563 | buildConfigurations = (
564 | 607FACED1AFB9204008FA782 /* Debug */,
565 | 607FACEE1AFB9204008FA782 /* Release */,
566 | );
567 | defaultConfigurationIsVisible = 0;
568 | defaultConfigurationName = Release;
569 | };
570 | 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "PowerUpSwift_Example" */ = {
571 | isa = XCConfigurationList;
572 | buildConfigurations = (
573 | 607FACF01AFB9204008FA782 /* Debug */,
574 | 607FACF11AFB9204008FA782 /* Release */,
575 | );
576 | defaultConfigurationIsVisible = 0;
577 | defaultConfigurationName = Release;
578 | };
579 | 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "PowerUpSwift_Tests" */ = {
580 | isa = XCConfigurationList;
581 | buildConfigurations = (
582 | 607FACF31AFB9204008FA782 /* Debug */,
583 | 607FACF41AFB9204008FA782 /* Release */,
584 | );
585 | defaultConfigurationIsVisible = 0;
586 | defaultConfigurationName = Release;
587 | };
588 | /* End XCConfigurationList section */
589 | };
590 | rootObject = 607FACC81AFB9204008FA782 /* Project object */;
591 | }
592 |
--------------------------------------------------------------------------------
/Example/PowerUpSwift.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Example/PowerUpSwift.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Example/PowerUpSwift.xcodeproj/xcshareddata/xcschemes/PowerUpSwift-Example.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
38 |
39 |
44 |
45 |
47 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
65 |
66 |
67 |
68 |
78 |
80 |
86 |
87 |
88 |
89 |
90 |
91 |
97 |
99 |
105 |
106 |
107 |
108 |
110 |
111 |
114 |
115 |
116 |
--------------------------------------------------------------------------------
/Example/PowerUpSwift.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Example/PowerUpSwift.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Example/PowerUpSwift.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Example/PowerUpSwift/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // PowerUpSwift
4 | //
5 | // Created by cefjoeii on 10/10/2018.
6 | // Copyright (c) 2018 cefjoeii. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | @UIApplicationMain
12 | class AppDelegate: UIResponder, UIApplicationDelegate {
13 |
14 | var window: UIWindow?
15 |
16 |
17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
18 | // Override point for customization after application launch.
19 | return true
20 | }
21 |
22 | func applicationWillResignActive(_ application: UIApplication) {
23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
24 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
25 | }
26 |
27 | func applicationDidEnterBackground(_ application: UIApplication) {
28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
30 | }
31 |
32 | func applicationWillEnterForeground(_ application: UIApplication) {
33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
34 | }
35 |
36 | func applicationDidBecomeActive(_ application: UIApplication) {
37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
38 | }
39 |
40 | func applicationWillTerminate(_ application: UIApplication) {
41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
42 | }
43 |
44 |
45 | }
46 |
47 |
--------------------------------------------------------------------------------
/Example/PowerUpSwift/Base.lproj/LaunchScreen.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/Example/PowerUpSwift/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
--------------------------------------------------------------------------------
/Example/PowerUpSwift/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "40x40",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "40x40",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "60x60",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "size" : "60x60",
41 | "scale" : "3x"
42 | },
43 | {
44 | "idiom" : "ios-marketing",
45 | "size" : "1024x1024",
46 | "scale" : "1x"
47 | }
48 | ],
49 | "info" : {
50 | "version" : 1,
51 | "author" : "xcode"
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/Example/PowerUpSwift/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UIRequiredDeviceCapabilities
30 |
31 | armv7
32 |
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/Example/PowerUpSwift/ViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.swift
3 | // PowerUpSwift
4 | //
5 | // Created by cefjoeii on 10/10/2018.
6 | // Copyright (c) 2018 cefjoeii. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import PowerUpSwift
11 |
12 | class ViewController: UIViewController {
13 | @IBOutlet weak var powerUpTextField: PUUnderlineTextField!
14 |
15 | override func viewDidLoad() {
16 | super.viewDidLoad()
17 |
18 | dismissKeyboardWhenTappedOutside()
19 |
20 | powerUpTextField.addTarget(self, action: #selector(textFieldDidChange(_:)), for: .editingChanged)
21 | }
22 |
23 | @objc func textFieldDidChange(_ textField: UITextField) {
24 | if textField == powerUpTextField {
25 | if let email = powerUpTextField.text, email.isNotValidEmail && email.isNotEmpty {
26 | powerUpTextField.showErrorColor()
27 | } else {
28 | powerUpTextField.hideErrorColor()
29 | }
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Example/Tests/BoolTests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // BoolTests.swift
3 | // PowerUpSwift_Tests
4 | //
5 | // Created by Ceferino Jose II on 11/10/18.
6 | // Copyright © 2018 Ceferino Jose II. All rights reserved.
7 | //
8 |
9 | import XCTest
10 | import PowerUpSwift
11 |
12 | class BoolTests: XCTestCase {
13 | func testBool() {
14 | XCTAssertFalse(Bool(0), "Bool(0) must be false.")
15 | XCTAssertTrue(Bool(1), "Bool(1) must be true.")
16 | XCTAssertTrue(Bool(2), "Bool(2) must be true.")
17 | XCTAssertTrue(Bool(-1), "Bool(-1) must be true.")
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Example/Tests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/Example/Tests/StringTests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // StringTests.swift
3 | // PowerUpSwift_Tests
4 | //
5 | // Created by Ceferino Jose II on 10/9/18.
6 | // Copyright © 2018 Ceferino Jose II. All rights reserved.
7 | //
8 |
9 | import XCTest
10 | import PowerUpSwift
11 |
12 | class StringTests: XCTestCase {
13 | func testIsEmailValid() {
14 | XCTAssert("cefjoeii@gmail.com".isValidEmail, "cefjoeii@gmail.com should be recognized as a VALID email.")
15 | XCTAssert("asdfghjkl".isValidEmail == false, "asdfghjkl should be recognized as an INVALID email.")
16 | }
17 |
18 | func testIsNotEmailValid() {
19 | XCTAssert("cefjoeii@gmail.com".isNotValidEmail == false, "cefjoeii@gmail.com should be recognized as a VALID email.")
20 | XCTAssert("asdfghjkl".isNotValidEmail, "asdfghjkl should be recognized as an INVALID email.")
21 | }
22 |
23 | func testIsValidIP() {
24 | XCTAssert("10.7.100.182".isValidIP, "10.7.100.182 should be recognized as a VALID IP address.")
25 | XCTAssert("asdfghjkl".isValidIP == false, "asdfghjkl should be recognized as an INVALID IP address.")
26 | }
27 |
28 | func testIsNotValidIP() {
29 | XCTAssert("10.7.100.182".isNotValidIP == false, "10.7.100.182 should be recognized as an INVALID IP address.")
30 | XCTAssert("asdfghjkl".isNotValidIP, "asdfghjkl should be recognized as a VALID IP address.")
31 | }
32 |
33 | func testIsValidMAC() {
34 | XCTAssert("00:01:12:44:55:22".isValidMAC, "00:01:12:44:55:22 should be recognized as a VALID MAC address.")
35 | XCTAssert("asdfghjkl".isValidMAC == false, "asdfghjkl should be recognized as an INVALID MAC address.")
36 | }
37 |
38 | func testIsNotValidMAC() {
39 | XCTAssert("00:01:12:44:55:22".isNotValidMAC == false, "00:01:12:44:55:22 should be recognized as an INVALID MAC address.")
40 | XCTAssert("asdfghjkl".isNotValidMAC, "asdfghjkl should be recognized as a VALID MAC address.")
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2019 Ceferino Jose II
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/MIGRATION.md:
--------------------------------------------------------------------------------
1 | # Migration
2 |
3 | ### Migrating from 1.x.x to 2.x.x
4 | * All `PowerUp-` prefixes of the classes have been changed to `PU-`. For example, use `PUView` instead of `PowerUpView`.
5 | * The `public init(_:)` function on the `Bool` extension has been removed since it's not useful.
6 | * The `asFullAddress` computed property on `CLPlacemark` extension has been renamed to `fullAddress`.
7 | * The `asJSON` computed property on `Data` extension has been renamed to `json`.
8 | * The `asJSON` computed property on `String` extension has been renamed to `json`.
9 | * The `extractedJWTPayload` computed property on `String` extension has been renamed to `jwtPayload`.
10 | * The `heightConstraint` and `widthConstraint` computed properties on `UIView` extensions have been removed.
11 | * The `hideKeyboardWhenTappedOutside()` function on `UIViewController` extension has been renamed to `dismissKeyboardWhenTappedOutside()`.
12 | * The `showInFullScreen(completion:)` function on `UIViewController` extension has been removed since it no longer works starting in iOS 13.
13 |
--------------------------------------------------------------------------------
/Package.swift:
--------------------------------------------------------------------------------
1 | // swift-tools-version:5.0
2 | // The swift-tools-version declares the minimum version of Swift required to build this package.
3 | import PackageDescription
4 |
5 | let package = Package(
6 | name: "PowerUpSwift",
7 | platforms: [.iOS(.v9)],
8 | products: [
9 | .library(name: "PowerUpSwift", targets: ["PowerUpSwift"])
10 | ],
11 | targets: [
12 | .target(
13 | name: "PowerUpSwift",
14 | path: "PowerUpSwift"
15 | )
16 | ]
17 | )
18 |
--------------------------------------------------------------------------------
/PowerUpSwift.podspec:
--------------------------------------------------------------------------------
1 | #
2 | # Be sure to run `pod lib lint PowerUpSwift.podspec' to ensure this is a
3 | # valid spec before submitting.
4 | #
5 | # Any lines starting with a # are optional, but their use is encouraged
6 | # To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
7 | #
8 |
9 | Pod::Spec.new do |s|
10 | s.name = 'PowerUpSwift'
11 | s.version = '2.1.4'
12 | s.summary = '📦 A lightweight library of powerful extensions and classes to reduce the utility code in your project and make iOS development faster.'
13 |
14 | # This description is used to generate tags and improve search results.
15 | # * Think: What does it do? Why did you write it? What is the focus?
16 | # * Try to keep it short, snappy and to the point.
17 | # * Write the description between the DESC delimiters below.
18 | # * Finally, don't worry about the indent, CocoaPods strips it!
19 |
20 | s.description = "Apple doesn't provide some basic useful utilities to make our iOS Development lives a little easier. This might be for a [good] reason, such as keeping the platform lightweight. It sometimes requires extra time and effort to implement a simple basic feature that you can easily do in Android built-in, so you end up doing a couple more hacks. This library was created to save time, to be more productive, and to be DRY (Don't Repeat Yourself)."
21 |
22 | s.homepage = 'https://github.com/PowerUpX/PowerUpSwift'
23 | # s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
24 | s.license = { :type => 'MIT', :file => 'LICENSE' }
25 | s.author = { 'Ceferino Jose II' => 'cefjoeii@gmail.com' }
26 | s.source = { :git => 'https://github.com/PowerUpX/PowerUpSwift.git', :tag => s.version.to_s }
27 | s.social_media_url = 'https://github.com/cefjoeii'
28 |
29 | s.ios.deployment_target = '12.0'
30 |
31 | s.source_files = 'PowerUpSwift/Classes/**/*'
32 | s.swift_version = '5.0'
33 |
34 | # s.resource_bundles = {
35 | # 'PowerUpSwift' => ['PowerUpSwift/Assets/*.png']
36 | # }
37 |
38 | # s.public_header_files = 'Pod/Classes/**/*.h'
39 | s.frameworks = 'UIKit', 'Foundation', 'CoreLocation'
40 | # s.dependency 'AFNetworking', '~> 2.3'
41 | end
42 |
--------------------------------------------------------------------------------
/PowerUpSwift/Assets/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PowerUpX/PowerUpSwift/8bc5201cf2183aaefc4e4870ff48fc113d4b2db2/PowerUpSwift/Assets/.gitkeep
--------------------------------------------------------------------------------
/PowerUpSwift/Classes/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PowerUpX/PowerUpSwift/8bc5201cf2183aaefc4e4870ff48fc113d4b2db2/PowerUpSwift/Classes/.gitkeep
--------------------------------------------------------------------------------
/PowerUpSwift/Classes/Classes/PUBarItem.swift:
--------------------------------------------------------------------------------
1 | //
2 | // PUBarItem.swift
3 | // PowerUpSwift
4 | //
5 | // Created by Ceferino Jose II on 8/6/20.
6 | // Copyright © 2020 PowerUpX. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | /// PowerUpSwift: The subclass of `UIBarItem` that allows the editing of additional UIKit properties via the Interface Builder.
12 | @IBDesignable open class PUBarItem: UIBarItem, PUXIBLocalizable {
13 | // MARK: - Inspectables
14 | @IBInspectable open var xibLocKey: String? {
15 | didSet { title = xibLocKey?.localized }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/PowerUpSwift/Classes/Classes/PUBaseTextField.swift:
--------------------------------------------------------------------------------
1 | //
2 | // PUBaseTextField.swift
3 | // PowerUpSwift
4 | //
5 | // Created by Ceferino Jose II on 11/11/18.
6 | // Copyright © 2020 PowerUpX. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | /// PowerUpSwift: The subclass of `UITextField` that allows the editing of additional UIKit properties via the Interface Builder.
12 | /// This is not usually used as a direct custom class of a control via the Inteface Builder.
13 | /// Use the classes `PUTextField` and `PUUnderlineTextField` instead.
14 | @IBDesignable open class PUBaseTextField: UITextField, PUXIBPlaceholderLocalizable {
15 | // MARK: - Inspectables
16 | @IBInspectable open var xibPlaceholderLocKey: String? {
17 | didSet { placeholder = xibPlaceholderLocKey?.localized }
18 | }
19 |
20 | /// PowerUpSwift: The left padding.
21 | @IBInspectable open var leftInset: CGFloat {
22 | get {
23 | return leftView!.frame.size.width
24 | }
25 | set {
26 | let paddingView = UIView(frame: CGRect(x: 0, y: 0, width: newValue, height: frame.size.height))
27 | leftView = paddingView
28 | leftViewMode = .always
29 | }
30 | }
31 |
32 | /// PowerUpSwift: The right padding.
33 | @IBInspectable open var rightInset: CGFloat {
34 | get {
35 | return rightView!.frame.size.width
36 | }
37 | set {
38 | let paddingView = UIView(frame: CGRect(x: 0, y: 0, width: newValue, height: frame.size.height))
39 | rightView = paddingView
40 | rightViewMode = .always
41 | }
42 | }
43 |
44 | /// PowerUpSwift: Allows the setting of the max length via the Interface Builder.
45 | /// This is handy since Swift does not provide a built-in max length property on text fields.
46 | @IBInspectable open var maxLength: Int {
47 | get {
48 | guard let l = __maxLengths[self] else {
49 | return Int.max // (150 for global default-limit or use Int.max)
50 | }
51 | return l
52 | }
53 | set {
54 | __maxLengths[self] = newValue
55 | addTarget(self, action: #selector(limit), for: .editingChanged)
56 | }
57 | }
58 |
59 | private var __maxLengths = [UITextField: Int]()
60 |
61 | @objc func limit(textField: UITextField) {
62 | textField.text = textField.text?.limitLength(maxLength)
63 | }
64 | }
65 |
66 | fileprivate extension String {
67 | func limitLength(_ n: Int) -> String {
68 | if count <= n { return self }
69 |
70 | return String(Array(self).prefix(upTo: n))
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/PowerUpSwift/Classes/Classes/PUButton.swift:
--------------------------------------------------------------------------------
1 | //
2 | // PUButton.swift
3 | // PowerUpSwift
4 | //
5 | // Created by Ceferino Jose II on 10/10/18.
6 | // Copyright © 2020 PowerUpX. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | /// PowerUpSwift: The subclass of `UIButton` that allows the editing of additional UIKit properties via the Interface Builder.
12 | @IBDesignable open class PUButton: UIButton, PUInspectable {
13 | // MARK: - Inspectables
14 | @IBInspectable open var xibLocKey: String? {
15 | didSet { setTitle(xibLocKey?.localized, for: .normal) }
16 | }
17 |
18 | @IBInspectable open var cornerRadius: CGFloat = 0 {
19 | didSet { layer.cornerRadius = cornerRadius }
20 | }
21 |
22 | @IBInspectable open var borderWidth: CGFloat = 0 {
23 | didSet { layer.borderWidth = borderWidth }
24 | }
25 |
26 | @IBInspectable open var borderColor: UIColor? {
27 | didSet { layer.borderColor = borderColor?.cgColor }
28 | }
29 |
30 | @IBInspectable open var shadowRadius: CGFloat = 0 {
31 | didSet { layer.shadowRadius = shadowRadius }
32 | }
33 |
34 | @IBInspectable open var shadowOpacity: Float = 0 {
35 | didSet { layer.shadowOpacity = shadowOpacity }
36 | }
37 |
38 | @IBInspectable open var shadowOffset: CGSize = .zero {
39 | didSet { layer.shadowOffset = shadowOffset }
40 | }
41 |
42 | @IBInspectable open var shadowColor: UIColor? {
43 | didSet { layer.shadowColor = shadowColor?.cgColor }
44 | }
45 | }
46 |
47 | extension PUButton {
48 | /// :nodoc:
49 | open override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
50 | super.traitCollectionDidChange(previousTraitCollection)
51 |
52 | // Handle the color update when switching to or from dark mode
53 | if #available(iOS 13.0, *) {
54 | if traitCollection.hasDifferentColorAppearance(comparedTo: previousTraitCollection) {
55 | layer.setNeedsDisplay()
56 | }
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/PowerUpSwift/Classes/Classes/PUCollectionView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // PUCollectionView.swift
3 | // PowerUpSwift
4 | //
5 | // Created by Ceferino Jose II on 4/14/20.
6 | // Copyright © 2020 PowerUpX. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | /// PowerUpSwift: The subclass of `UICollectionView` that allows the editing of additional UIKit properties via the Interface Builder.
12 | @IBDesignable open class PUCollectionView: UICollectionView, PUInspectable {
13 | // MARK: - Inspectables
14 | @IBInspectable open var cornerRadius: CGFloat = 0 {
15 | didSet { layer.cornerRadius = cornerRadius }
16 | }
17 |
18 | @IBInspectable open var borderWidth: CGFloat = 0 {
19 | didSet { layer.borderWidth = borderWidth }
20 | }
21 |
22 | @IBInspectable open var borderColor: UIColor? {
23 | didSet { layer.borderColor = borderColor?.cgColor }
24 | }
25 |
26 | @IBInspectable open var shadowRadius: CGFloat = 0 {
27 | didSet { layer.shadowRadius = shadowRadius }
28 | }
29 |
30 | @IBInspectable open var shadowOpacity: Float = 0 {
31 | didSet { layer.shadowOpacity = shadowOpacity }
32 | }
33 |
34 | @IBInspectable open var shadowOffset: CGSize = .zero {
35 | didSet { layer.shadowOffset = shadowOffset }
36 | }
37 |
38 | @IBInspectable open var shadowColor: UIColor? {
39 | didSet { layer.shadowColor = shadowColor?.cgColor }
40 | }
41 | }
42 |
43 | extension PUCollectionView {
44 | /// :nodoc:
45 | open override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
46 | super.traitCollectionDidChange(previousTraitCollection)
47 |
48 | // Handle the color update when switching to or from dark mode
49 | if #available(iOS 13.0, *) {
50 | if traitCollection.hasDifferentColorAppearance(comparedTo: previousTraitCollection) {
51 | layer.setNeedsDisplay()
52 | }
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/PowerUpSwift/Classes/Classes/PUImageView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // PUImageView.swift
3 | // PowerUpSwift
4 | //
5 | // Created by Ceferino Jose II on 29/07/2019.
6 | // Copyright © 2020 PowerUpX. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | /// PowerUpSwift: The subclass of `UIImageView` that allows the editing of additional UIKit properties via the Interface Builder.
12 | @IBDesignable open class PUImageView: UIImageView, PUInspectable {
13 | // MARK: - Inspectables
14 | @IBInspectable open var cornerRadius: CGFloat = 0 {
15 | didSet { layer.cornerRadius = cornerRadius }
16 | }
17 |
18 | @IBInspectable open var borderWidth: CGFloat = 0 {
19 | didSet { layer.borderWidth = borderWidth }
20 | }
21 |
22 | @IBInspectable open var borderColor: UIColor? {
23 | didSet { layer.borderColor = borderColor?.cgColor }
24 | }
25 |
26 | @IBInspectable open var shadowRadius: CGFloat = 0 {
27 | didSet { layer.shadowRadius = shadowRadius }
28 | }
29 |
30 | @IBInspectable open var shadowOpacity: Float = 0 {
31 | didSet { layer.shadowOpacity = shadowOpacity }
32 | }
33 |
34 | @IBInspectable open var shadowOffset: CGSize = .zero {
35 | didSet { layer.shadowOffset = shadowOffset }
36 | }
37 |
38 | @IBInspectable open var shadowColor: UIColor? {
39 | didSet { layer.shadowColor = shadowColor?.cgColor }
40 | }
41 | }
42 |
43 | extension PUImageView {
44 | /// :nodoc:
45 | open override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
46 | super.traitCollectionDidChange(previousTraitCollection)
47 |
48 | // Handle the color update when switching to or from dark mode
49 | if #available(iOS 13.0, *) {
50 | if traitCollection.hasDifferentColorAppearance(comparedTo: previousTraitCollection) {
51 | // This causes a blank image bug when switching to dark/light mode
52 | // layer.setNeedsDisplay()
53 |
54 | layer.borderColor = borderColor?.cgColor
55 | layer.shadowColor = borderColor?.cgColor
56 | }
57 | }
58 | }
59 | }
60 |
61 |
--------------------------------------------------------------------------------
/PowerUpSwift/Classes/Classes/PULabel.swift:
--------------------------------------------------------------------------------
1 | //
2 | // PULabel.swift
3 | // PowerUpSwift
4 | //
5 | // Created by Ceferino Jose II on 10/10/18.
6 | // Copyright © 2020 PowerUpX. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | /// PowerUpSwift: The subclass of `UILabel` that allows the editing of additional UIKit properties via the Interface Builder.
12 | @IBDesignable open class PULabel: UILabel, PUXIBLocalizable, PUInspectable {
13 | // MARK: - Inspectables
14 | @IBInspectable open var xibLocKey: String? {
15 | didSet { text = xibLocKey?.localized }
16 | }
17 |
18 | @IBInspectable open var cornerRadius: CGFloat = 0 {
19 | didSet { layer.cornerRadius = cornerRadius }
20 | }
21 |
22 | @IBInspectable open var borderWidth: CGFloat = 0 {
23 | didSet { layer.borderWidth = borderWidth }
24 | }
25 |
26 | @IBInspectable open var borderColor: UIColor? {
27 | didSet { layer.borderColor = borderColor?.cgColor }
28 | }
29 |
30 | @IBInspectable open var shadowRadius: CGFloat = 0 {
31 | didSet { layer.shadowRadius = shadowRadius }
32 | }
33 |
34 | @IBInspectable open var shadowOpacity: Float = 0 {
35 | didSet { layer.shadowOpacity = shadowOpacity }
36 | }
37 |
38 | /// PowerUpSwift: The top padding. Defaults to 0.
39 | @IBInspectable open var topInset: CGFloat = 0
40 |
41 | /// PowerUpSwift: The left padding. Defaults to 0.
42 | @IBInspectable open var leftInset: CGFloat = 0
43 |
44 | /// PowerUpSwift: The bottom padding. Defaults to 0.
45 | @IBInspectable open var bottomInset: CGFloat = 0
46 |
47 | /// PowerUpSwift: The right padding. Defaults to 0.
48 | @IBInspectable open var rightInset: CGFloat = 0
49 |
50 | // MARK: - Custom Properties
51 | /**
52 | PowerUpSwift: The padding on all sides that is set programmatically.
53 | ### Example
54 | ```
55 | powerUpLabel.insets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
56 | ```
57 | */
58 | open var insets: UIEdgeInsets {
59 | get {
60 | return UIEdgeInsets(top: topInset, left: leftInset, bottom: bottomInset, right: rightInset)
61 | }
62 | set {
63 | topInset = newValue.top
64 | leftInset = newValue.left
65 | bottomInset = newValue.bottom
66 | rightInset = newValue.right
67 | }
68 | }
69 |
70 | /// :nodoc:
71 | override open func drawText(in rect: CGRect) {
72 | super.drawText(in: rect.inset(by: insets))
73 | }
74 |
75 | /// :nodoc:
76 | override open var intrinsicContentSize: CGSize {
77 | let size = super.intrinsicContentSize
78 | return CGSize(
79 | width: size.width + leftInset + rightInset,
80 | height: size.height + topInset + bottomInset
81 | )
82 | }
83 | }
84 |
85 | extension PULabel {
86 | /// :nodoc:
87 | open override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
88 | super.traitCollectionDidChange(previousTraitCollection)
89 |
90 | // Handle the color update when switching to or from dark mode
91 | if #available(iOS 13.0, *) {
92 | if traitCollection.hasDifferentColorAppearance(comparedTo: previousTraitCollection) {
93 | layer.setNeedsDisplay()
94 | }
95 | }
96 | }
97 | }
98 |
--------------------------------------------------------------------------------
/PowerUpSwift/Classes/Classes/PULoadingButton.swift:
--------------------------------------------------------------------------------
1 | //
2 | // PULoadingButton.swift
3 | // PowerUpSwift
4 | //
5 | // Created by Ceferino Jose II on 4/21/20.
6 | // Copyright © 2020 PowerUpX. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | /// PowerUpSwift: The subclass of `PUButton` that allows the editing of additional UIKit properties via the Interface Builder.
12 | @IBDesignable open class PULoadingButton: PUButton, PUXIBLocalizable {
13 | // MARK: - Inspectables
14 | /// PowerUpSwift: The opacity when the loading indicator is currently shown. Defaults to 0.5.
15 | @IBInspectable open var disabledAlpha: CGFloat = 0.5
16 |
17 | /// PowerUpSwift: The holder for the `UIButton`'s title when temporarily disabled.
18 | private var originalTitle: String?
19 |
20 | private var activityIndicatorView: UIActivityIndicatorView!
21 | }
22 |
23 | // MARK: - Custom Functions
24 | extension PULoadingButton {
25 | /// PowerUpSwift: Displays the loading indicator to the center of the button and temporarily hides the button's title.
26 | open func showLoading() {
27 | // Clear out the title temporarily
28 | originalTitle = titleLabel?.text
29 | setTitle("", for: .normal)
30 |
31 | // Disable interactivity
32 | isEnabled = false
33 | alpha = disabledAlpha
34 |
35 | activityIndicatorView = UIActivityIndicatorView()
36 | activityIndicatorView.hidesWhenStopped = true
37 | activityIndicatorView.color = titleColor(for: .normal)
38 | activityIndicatorView.translatesAutoresizingMaskIntoConstraints = false
39 |
40 | addSubview(activityIndicatorView)
41 |
42 | let xCenterConstraint = NSLayoutConstraint(
43 | item: self,
44 | attribute: .centerX,
45 | relatedBy: .equal,
46 | toItem: activityIndicatorView,
47 | attribute: .centerX,
48 | multiplier: 1,
49 | constant: 0
50 | )
51 |
52 | addConstraint(xCenterConstraint)
53 |
54 | let yCenterConstraint = NSLayoutConstraint(
55 | item: self,
56 | attribute: .centerY,
57 | relatedBy: .equal,
58 | toItem: activityIndicatorView,
59 | attribute: .centerY,
60 | multiplier: 1,
61 | constant: 0
62 | )
63 |
64 | addConstraint(yCenterConstraint)
65 |
66 | activityIndicatorView.startAnimating()
67 | }
68 |
69 | /// PowerUpSwift: Hides the loading indicator from the center of the button and displays the button's title back.
70 | open func hideLoading() {
71 | // Bring the title back
72 | setTitle(originalTitle, for: .normal)
73 |
74 | // Enable interactivity
75 | isEnabled = true
76 | alpha = 1.0
77 |
78 | activityIndicatorView.stopAnimating()
79 | activityIndicatorView.removeFromSuperview()
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/PowerUpSwift/Classes/Classes/PUNavigationItem.swift:
--------------------------------------------------------------------------------
1 | //
2 | // PUNavigationItem.swift
3 | // PowerUpSwift
4 | //
5 | // Created by Ceferino Jose II on 8/6/20.
6 | // Copyright © 2020 PowerUpX. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | /// PowerUpSwift: The subclass of `UINavigationItem` that allows the editing of additional UIKit properties via the Interface Builder.
12 | @IBDesignable open class PUNavigationItem: UINavigationItem, PUXIBLocalizable {
13 | // MARK: - Inspectables
14 | @IBInspectable open var xibLocKey: String? {
15 | didSet { title = xibLocKey?.localized }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/PowerUpSwift/Classes/Classes/PUSegmentedControl.swift:
--------------------------------------------------------------------------------
1 | //
2 | // PUSegmentedControl.swift
3 | // PowerUpSwift
4 | //
5 | // Created by Ceferino Jose II on 8/6/20.
6 | // Copyright © 2020 PowerUpX. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | /// PowerUpSwift: The subclass of `UISegmentedControl` that allows the editing of additional UIKit properties via the Interface Builder.
12 | @IBDesignable open class PUSegmentedControl: UISegmentedControl, PUXIBMultiLocalizable, PUInspectable {
13 | // MARK: - Inspectables
14 | @IBInspectable open var xibLocKeys: String? {
15 | didSet {
16 | guard let keys = xibLocKeys?.components(separatedBy: ","), !keys.isEmpty else { return }
17 | for (index, title) in keys.enumerated() {
18 | setTitle(title.localized, forSegmentAt: index)
19 | }
20 | }
21 | }
22 |
23 | @IBInspectable open var cornerRadius: CGFloat = 0 {
24 | didSet { layer.cornerRadius = cornerRadius }
25 | }
26 |
27 | @IBInspectable open var borderWidth: CGFloat = 0 {
28 | didSet { layer.borderWidth = borderWidth }
29 | }
30 |
31 | @IBInspectable open var borderColor: UIColor? {
32 | didSet { layer.borderColor = borderColor?.cgColor }
33 | }
34 |
35 | @IBInspectable open var shadowRadius: CGFloat = 0 {
36 | didSet { layer.shadowRadius = shadowRadius }
37 | }
38 |
39 | @IBInspectable open var shadowOpacity: Float = 0 {
40 | didSet { layer.shadowOpacity = shadowOpacity }
41 | }
42 |
43 | @IBInspectable open var shadowOffset: CGSize = .zero {
44 | didSet { layer.shadowOffset = shadowOffset }
45 | }
46 |
47 | @IBInspectable open var shadowColor: UIColor? {
48 | didSet { layer.shadowColor = shadowColor?.cgColor }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/PowerUpSwift/Classes/Classes/PUTableView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // PUTableView.swift
3 | // PowerUpSwift
4 | //
5 | // Created by Ceferino Jose II on 8/25/20.
6 | // Copyright © 2020 PowerUpX. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | /// PowerUpSwift: The subclass of `UITableView` that allows the editing of additional UIKit properties via the Interface Builder.
12 | @IBDesignable open class PUTableView: UITableView, PUInspectable {
13 | // MARK: - Inspectables
14 | @IBInspectable open var cornerRadius: CGFloat = 0 {
15 | didSet { layer.cornerRadius = cornerRadius }
16 | }
17 |
18 | @IBInspectable open var borderWidth: CGFloat = 0 {
19 | didSet { layer.borderWidth = borderWidth }
20 | }
21 |
22 | @IBInspectable open var borderColor: UIColor? {
23 | didSet { layer.borderColor = borderColor?.cgColor }
24 | }
25 |
26 | @IBInspectable open var shadowRadius: CGFloat = 0 {
27 | didSet { layer.shadowRadius = shadowRadius }
28 | }
29 |
30 | @IBInspectable open var shadowOpacity: Float = 0 {
31 | didSet { layer.shadowOpacity = shadowOpacity }
32 | }
33 |
34 | @IBInspectable open var shadowOffset: CGSize = .zero {
35 | didSet { layer.shadowOffset = shadowOffset }
36 | }
37 |
38 | @IBInspectable open var shadowColor: UIColor? {
39 | didSet { layer.shadowColor = shadowColor?.cgColor }
40 | }
41 | }
42 |
43 | extension PUTableView {
44 | /// :nodoc:
45 | open override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
46 | super.traitCollectionDidChange(previousTraitCollection)
47 |
48 | // Handle the color update when switching to or from dark mode
49 | if #available(iOS 13.0, *) {
50 | if traitCollection.hasDifferentColorAppearance(comparedTo: previousTraitCollection) {
51 | layer.setNeedsDisplay()
52 | }
53 | }
54 | }
55 | }
56 |
57 |
--------------------------------------------------------------------------------
/PowerUpSwift/Classes/Classes/PUTextField.swift:
--------------------------------------------------------------------------------
1 | //
2 | // PUTextField.swift
3 | // PowerUpSwift
4 | //
5 | // Created by Ceferino Jose II on 10/10/18.
6 | // Copyright © 2020 PowerUpX. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | /// PowerUpSwift: The subclass of `PUBaseTextField` that allows the editing of additional UIKit properties via the Interface Builder.
12 | @IBDesignable open class PUTextField: PUBaseTextField, PUInspectable {
13 | // MARK: - Inspectables
14 | @IBInspectable open var cornerRadius: CGFloat = 0 {
15 | didSet { layer.cornerRadius = cornerRadius }
16 | }
17 |
18 | @IBInspectable open var borderWidth: CGFloat = 0 {
19 | didSet { layer.borderWidth = borderWidth }
20 | }
21 |
22 | @IBInspectable open var borderColor: UIColor? {
23 | didSet { layer.borderColor = borderColor?.cgColor }
24 | }
25 |
26 | @IBInspectable open var shadowRadius: CGFloat = 0 {
27 | didSet { layer.shadowRadius = shadowRadius }
28 | }
29 |
30 | @IBInspectable open var shadowOpacity: Float = 0 {
31 | didSet { layer.shadowOpacity = shadowOpacity }
32 | }
33 |
34 | @IBInspectable open var shadowOffset: CGSize = .zero {
35 | didSet { layer.shadowOffset = shadowOffset }
36 | }
37 |
38 | @IBInspectable open var shadowColor: UIColor? {
39 | didSet { layer.shadowColor = shadowColor?.cgColor }
40 | }
41 | }
42 |
43 | extension PUTextField {
44 | /// :nodoc:
45 | open override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
46 | super.traitCollectionDidChange(previousTraitCollection)
47 |
48 | // Handle the color update when switching to or from dark mode
49 | if #available(iOS 13.0, *) {
50 | if traitCollection.hasDifferentColorAppearance(comparedTo: previousTraitCollection) {
51 | layer.setNeedsDisplay()
52 | }
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/PowerUpSwift/Classes/Classes/PUTextView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // PUTextView.swift
3 | // PowerUpSwift
4 | //
5 | // Created by Ceferino Jose II on 10/11/18.
6 | // Copyright © 2020 PowerUpX. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | /// PowerUpSwift: The subclass of `UITextView` that allows the editing of additional UIKit properties via the Interface Builder.
12 | @IBDesignable open class PUTextView: UITextView, PUXIBPlaceholderLocalizable, PUInspectable {
13 | var placeholderLabel = PULabel()
14 |
15 | // MARK: - Inspectables
16 | @IBInspectable open var xibPlaceholderLocKey: String? {
17 | didSet { placeholder = xibPlaceholderLocKey?.localized }
18 | }
19 |
20 | @IBInspectable open var cornerRadius: CGFloat = 0 {
21 | didSet { layer.cornerRadius = cornerRadius }
22 | }
23 |
24 | @IBInspectable open var borderWidth: CGFloat = 0 {
25 | didSet { layer.borderWidth = borderWidth }
26 | }
27 |
28 | @IBInspectable open var borderColor: UIColor? {
29 | didSet { layer.borderColor = borderColor?.cgColor }
30 | }
31 |
32 | @IBInspectable open var shadowRadius: CGFloat = 0 {
33 | didSet { layer.shadowRadius = shadowRadius }
34 | }
35 |
36 | @IBInspectable open var shadowOpacity: Float = 0 {
37 | didSet { layer.shadowOpacity = shadowOpacity }
38 | }
39 |
40 | @IBInspectable open var shadowOffset: CGSize = .zero {
41 | didSet { layer.shadowOffset = shadowOffset }
42 | }
43 |
44 | @IBInspectable open var shadowColor: UIColor? {
45 | didSet { layer.shadowColor = shadowColor?.cgColor }
46 | }
47 |
48 | /// PowerUpSwift: The custom-built placeholder since Apple does not provide a `placeholder` for `UITextView`.
49 | @IBInspectable open var placeholder: String? = nil {
50 | didSet { placeholderLabel.text = placeholder }
51 | }
52 |
53 | /// PowerUpSwift: The text color of the custom-built placeholder.
54 | /// Defaults `UIColor(r: 255, g: 255, b: 255, a: 0.25)`.
55 | @IBInspectable open var placeholderColor: UIColor = UIColor(r: 255, g: 255, b: 255, a: 0.25) {
56 | didSet { placeholderLabel.textColor = placeholderColor }
57 | }
58 |
59 | /// PowerUpSwift: The user-defined minimum height. Defaults to 30.
60 | @IBInspectable open var minExpandableHeight: CGFloat = 30
61 |
62 | /// PowerUpSwift: The user-defined maximum height. Once reached, the text view becomes scrollable.
63 | /// Defaults to 30.
64 | @IBInspectable open var maxExpandableHeight: CGFloat = 30
65 |
66 | /// PowerUpSwift: The top padding. Defaults to 0.
67 | @IBInspectable open var topInset: CGFloat = 0 {
68 | didSet {
69 | textContainerInset = UIEdgeInsets(
70 | top: topInset,
71 | left: textContainerInset.left,
72 | bottom: textContainerInset.bottom,
73 | right: textContainerInset.right
74 | )
75 | placeholderLabel.topInset = topInset
76 | }
77 | }
78 |
79 | /// PowerUpSwift: The left padding. Defaults to 0.
80 | @IBInspectable open var leftInset: CGFloat = 0 {
81 | didSet {
82 | textContainerInset = UIEdgeInsets(
83 | top: textContainerInset.top,
84 | left: leftInset,
85 | bottom: textContainerInset.bottom,
86 | right: textContainerInset.right
87 | )
88 | placeholderLabel.leftInset = leftInset + 4
89 | }
90 | }
91 |
92 | /// PowerUpSwift: The bottom padding. Defaults to 0.
93 | @IBInspectable open var bottomInset: CGFloat = 0 {
94 | didSet {
95 | textContainerInset = UIEdgeInsets(
96 | top: textContainerInset.top,
97 | left: textContainerInset.left,
98 | bottom: bottomInset,
99 | right: textContainerInset.right
100 | )
101 | placeholderLabel.bottomInset = bottomInset
102 | }
103 | }
104 |
105 | /// PowerUpSwift: The right padding. Defaults to 0.
106 | @IBInspectable open var rightInset: CGFloat = 0 {
107 | didSet {
108 | textContainerInset = UIEdgeInsets(
109 | top: textContainerInset.top,
110 | left: textContainerInset.left,
111 | bottom: textContainerInset.bottom,
112 | right: rightInset
113 | )
114 | placeholderLabel.rightInset = rightInset + 4
115 | }
116 | }
117 |
118 | /// :nodoc:
119 | required public init?(coder aDecoder: NSCoder) {
120 | super.init(coder: aDecoder)
121 |
122 | commonInit()
123 | }
124 |
125 | /// :nodoc:
126 | override init(frame: CGRect, textContainer: NSTextContainer?) {
127 | super.init(frame: frame, textContainer: textContainer)
128 |
129 | commonInit()
130 | }
131 |
132 | private func commonInit() {
133 | // Add some custom dynamic padding
134 | textContainerInset = UIEdgeInsets(top: topInset, left: leftInset, bottom: bottomInset, right: rightInset)
135 | placeholderLabel.insets = textContainerInset
136 |
137 | // Set the properties of the placeholder label to make it look like the text view's text
138 | placeholderLabel.font = font
139 | placeholderLabel.textAlignment = textAlignment
140 | placeholderLabel.text = placeholder
141 | placeholderLabel.textColor = placeholderColor
142 | placeholderLabel.numberOfLines = 1
143 | placeholderLabel.translatesAutoresizingMaskIntoConstraints = false
144 |
145 | addSubview(placeholderLabel)
146 |
147 | if #available(iOS 9.0, *) {
148 | placeholderLabel.topAnchor.constraint(equalTo: textInputView.topAnchor, constant: topInset).isActive = true
149 | placeholderLabel.leadingAnchor.constraint(equalTo: textInputView.leadingAnchor, constant: leftInset).isActive = true
150 | placeholderLabel.bottomAnchor.constraint(equalTo: textInputView.bottomAnchor, constant: bottomInset).isActive = true
151 | placeholderLabel.trailingAnchor.constraint(equalTo: textInputView.trailingAnchor, constant: rightInset).isActive = true
152 | }
153 |
154 | placeholderLabel.sizeToFit()
155 | }
156 |
157 | // MARK: - Properties
158 | /**
159 | PowerUpSwift: Calculates the new height of the text view based on the size of the content and the user-defined `maxExpandableHeight`.
160 | You should reference an `@IBOutlet` to the height constraint.
161 | Make sure the `PUTextView`'s delegate is also set via the Interface Builder or via code.
162 | ### Example
163 | ```swift
164 | @IBOutlet powerUpTextView: PowerUpTextView!
165 | @IBOutlet powerUpTextViewHeightConstraint: NSLayoutConstraint!
166 |
167 | func textViewDidChange(_ textView: UITextView) {
168 | powerUpTextViewHeightConstraint.constant = powerUpTextView.newExpandableHeight
169 | }
170 | ```
171 | */
172 | open var newExpandableHeight: CGFloat {
173 | // Make the textview's height dynamic while typing (Hacky iOS sucks)
174 | let size = CGSize(width: frame.width, height: .infinity)
175 | let estimatedSize = sizeThatFits(size)
176 | var height: CGFloat {
177 | if estimatedSize.height > minExpandableHeight && estimatedSize.height <= maxExpandableHeight {
178 | isScrollEnabled = false
179 | return estimatedSize.height
180 | } else if estimatedSize.height > maxExpandableHeight {
181 | isScrollEnabled = true
182 | scrollToBottom()
183 | return maxExpandableHeight
184 | } else {
185 | isScrollEnabled = false
186 | return minExpandableHeight
187 | }
188 | }
189 | return height
190 | }
191 | }
192 |
193 | // MARK: - Custom Functions
194 | extension PUTextView {
195 | /**
196 | PowerUpSwift: Toggles the visibility of the text view's placeholder.
197 | ### Example
198 | ```swift
199 | func textViewDidChange(_ textView: UITextView) {
200 | powerUpTextView.refreshPlaceholder()
201 | }
202 | ```
203 | */
204 | open func refreshPlaceholder() { placeholderLabel.isHidden = !text!.isEmpty }
205 |
206 | /// PowerUpSwift: Clears the text view and sets the placeholder to visible.
207 | open func clear() {
208 | text = nil
209 | placeholderLabel.isHidden = false
210 | }
211 | }
212 |
213 | extension PUTextView {
214 | /// :nodoc:
215 | open override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
216 | super.traitCollectionDidChange(previousTraitCollection)
217 |
218 | // Handle the color update when switching to or from dark mode
219 | if #available(iOS 13.0, *) {
220 | if traitCollection.hasDifferentColorAppearance(comparedTo: previousTraitCollection) {
221 | layer.setNeedsDisplay()
222 | }
223 | }
224 | }
225 | }
226 |
227 |
--------------------------------------------------------------------------------
/PowerUpSwift/Classes/Classes/PUUnderlineTextField.swift:
--------------------------------------------------------------------------------
1 | //
2 | // PUUnderlineTextField.swift
3 | // PowerUpSwift
4 | //
5 | // Created by Ceferino Jose II on 11/6/18.
6 | // Copyright © 2020 PowerUpX. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | /// PowerUpSwift: The subclass of `PUBaseTextField` that allows the editing of additional UIKit properties via the Interface Builder.
12 | /// This text field displays a bottom bar that appears like an underline.
13 | /// 
14 | /// ## Attributes inspector
15 | /// 
16 | @IBDesignable open class PUUnderlineTextField: PUBaseTextField {
17 | private var underline = CALayer()
18 |
19 | // MARK: - Inspectables
20 | /// PowerUpSwift: The main color for the underline. Defaults to `.lightGray.`
21 | @IBInspectable open var underlineColor: UIColor = .lightGray
22 |
23 | /// PowerUpSwift: The height of the underline. Defaults to 1.
24 | @IBInspectable open var underlineHeight: CGFloat = 1
25 |
26 | /// PowerUpSwift: Enables or disables the highlight behavior when the text field is being focused on (first responder). Defaults to `false`.
27 | @IBInspectable open var isHighlightOn: Bool = false
28 |
29 | /// PowerUpSwift: The color of the underline when the text field is being focused on (first responder). Defaults to `UIView().tintColor`.
30 | @IBInspectable open var highlightColor: UIColor = UIView().tintColor
31 |
32 | /// PowerUpSwift: The color of the underline when `isShowingError` is `true`. Defaults to `.red`.
33 | @IBInspectable open var errorColor: UIColor = .red
34 |
35 | // MARK: Properties
36 | /// PowerUpSwift: Defaults to `false`.
37 | open var isShowingError = false
38 |
39 | // MARK: - Init
40 | /// :nodoc:
41 | required public init?(coder aDecoder: NSCoder) {
42 | super.init(coder: aDecoder)
43 |
44 | commonInit()
45 | }
46 |
47 | /// :nodoc:
48 | override public init(frame: CGRect) {
49 | super.init(frame: frame)
50 |
51 | commonInit()
52 | }
53 |
54 | /// :nodoc:
55 | override open func awakeFromNib() {
56 | super.awakeFromNib()
57 |
58 | commonInit()
59 | }
60 |
61 | private func commonInit() {
62 | borderStyle = .none
63 |
64 | underline.frame = CGRect(
65 | x: 0,
66 | y: frame.height - underlineHeight,
67 | width: frame.width,
68 | height: underlineHeight
69 | )
70 | underline.borderColor = underlineColor.cgColor
71 | underline.borderWidth = underlineHeight
72 |
73 | layer.masksToBounds = true
74 | layer.addSublayer(underline)
75 | }
76 |
77 | // MARK: - Responders
78 | /// :nodoc:
79 | override open func becomeFirstResponder() -> Bool {
80 | super.becomeFirstResponder()
81 |
82 | if isHighlightOn && !isShowingError {
83 | underline.borderColor = highlightColor.cgColor
84 | }
85 |
86 | return true
87 | }
88 |
89 | /// :nodoc:
90 | override open func resignFirstResponder() -> Bool {
91 | super.resignFirstResponder()
92 |
93 | underline.borderColor = (isShowingError) ? errorColor.cgColor : underlineColor.cgColor
94 |
95 | return true
96 | }
97 | }
98 |
99 | // MARK: - Custom Functions
100 | extension PUUnderlineTextField {
101 | /// PowerUpSwift: Sets the color of the underline to the specified error color and sets the property `isShowingError` to `true`.
102 | open func showErrorColor() {
103 | underline.borderColor = errorColor.cgColor
104 | isShowingError = true
105 | }
106 |
107 | /// PowerUpSwift: Removes the error color of the underline and sets the property `isShowingError` to `false`.
108 | /// - The underline color is set to the specified highlight color if it's the first responder and if `isHighlightOn` is enabled.
109 | /// - Otherwise, the underline gets set back to its original color.
110 | open func hideErrorColor() {
111 | if isFirstResponder && isHighlightOn {
112 | underline.borderColor = highlightColor.cgColor
113 | } else {
114 | underline.borderColor = underlineColor.cgColor
115 | }
116 |
117 | isShowingError = false
118 | }
119 | }
120 |
121 | extension PUUnderlineTextField {
122 | /// :nodoc:
123 | open override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
124 | super.traitCollectionDidChange(previousTraitCollection)
125 |
126 | // Handle the color update of the layers when switching to or from dark mode
127 | if #available(iOS 13.0, *) {
128 | if traitCollection.hasDifferentColorAppearance(comparedTo: previousTraitCollection) {
129 | layer.setNeedsDisplay()
130 | underline.setNeedsDisplay()
131 | }
132 | }
133 | }
134 | }
135 |
--------------------------------------------------------------------------------
/PowerUpSwift/Classes/Classes/PUView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // PUView.swift
3 | // PowerUpSwift
4 | //
5 | // Created by Ceferino Jose II on 10/10/18.
6 | // Copyright © 2020 PowerUpX. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | /// PowerUpSwift: The subclass of `UIView` that allows the editing of additional UIKit properties via the Interface Builder.
12 | @IBDesignable open class PUView: UIView {
13 | // MARK: - Inspectables
14 | @IBInspectable open var cornerRadius: CGFloat = 0 {
15 | didSet { layer.cornerRadius = cornerRadius }
16 | }
17 |
18 | @IBInspectable open var borderWidth: CGFloat = 0 {
19 | didSet { layer.borderWidth = borderWidth }
20 | }
21 |
22 | @IBInspectable open var borderColor: UIColor? {
23 | didSet { layer.borderColor = borderColor?.cgColor }
24 | }
25 |
26 | @IBInspectable open var shadowRadius: CGFloat = 0 {
27 | didSet { layer.shadowRadius = shadowRadius }
28 | }
29 |
30 | @IBInspectable open var shadowOpacity: Float = 0 {
31 | didSet { layer.shadowOpacity = shadowOpacity }
32 | }
33 |
34 | @IBInspectable open var shadowOffset: CGSize = .zero {
35 | didSet { layer.shadowOffset = shadowOffset }
36 | }
37 |
38 | @IBInspectable open var shadowColor: UIColor? {
39 | didSet { layer.shadowColor = shadowColor?.cgColor }
40 | }
41 | }
42 |
43 | extension PUView {
44 | /// :nodoc:
45 | open override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
46 | super.traitCollectionDidChange(previousTraitCollection)
47 |
48 | // Handle the color update of the layers when switching to or from dark mode
49 | if #available(iOS 13.0, *) {
50 | if traitCollection.hasDifferentColorAppearance(comparedTo: previousTraitCollection) {
51 | layer.setNeedsDisplay()
52 | }
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/PowerUpSwift/Classes/Classes/PUVisualEffectView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // PUVisualEffectView.swift
3 | // PowerUpSwift
4 | //
5 | // Created by Ceferino Jose II on 14/08/2019.
6 | // Copyright © 2020 PowerUpX. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | /// PowerUpSwift: The subclass of `UIVisualEffectView` that allows the editing of additional UIKit properties via the Interface Builder.
12 | @IBDesignable open class PUVisualEffectView: UIVisualEffectView, PUInspectable {
13 | // MARK: - Inspectables
14 | @IBInspectable open var cornerRadius: CGFloat = 0 {
15 | didSet { layer.cornerRadius = cornerRadius }
16 | }
17 |
18 | @IBInspectable open var borderWidth: CGFloat = 0 {
19 | didSet { layer.borderWidth = borderWidth }
20 | }
21 |
22 | @IBInspectable open var borderColor: UIColor? {
23 | didSet { layer.borderColor = borderColor?.cgColor }
24 | }
25 |
26 | @IBInspectable open var shadowRadius: CGFloat = 0 {
27 | didSet { layer.shadowRadius = shadowRadius }
28 | }
29 |
30 | @IBInspectable open var shadowOpacity: Float = 0 {
31 | didSet { layer.shadowOpacity = shadowOpacity }
32 | }
33 |
34 | @IBInspectable open var shadowOffset: CGSize = .zero {
35 | didSet { layer.shadowOffset = shadowOffset }
36 | }
37 |
38 | @IBInspectable open var shadowColor: UIColor? {
39 | didSet { layer.shadowColor = shadowColor?.cgColor }
40 | }
41 | }
42 |
43 | extension PUVisualEffectView {
44 | /// :nodoc:
45 | open override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
46 | super.traitCollectionDidChange(previousTraitCollection)
47 |
48 | /// Handle the color update of the layers when switching to or from dark mode
49 | if #available(iOS 13.0, *) {
50 | if traitCollection.hasDifferentColorAppearance(comparedTo: previousTraitCollection) {
51 | layer.setNeedsDisplay()
52 | }
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/PowerUpSwift/Classes/Classes/Protocols/PUInspectable.swift:
--------------------------------------------------------------------------------
1 | //
2 | // PUInspectable.swift
3 | // PowerUpSwift
4 | //
5 | // Created by Ceferino Jose II on 8/24/20.
6 | // Copyright © 2020 PowerUpX. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import UIKit
11 |
12 | /// PowerUpSwift: A protocol that the majority of the PowerUpSwift classes conform to such as `PUView`.
13 | /// All these classes allow the editing of additional UIKit properties via the Interface Builder.
14 | public protocol PUInspectable {
15 | // MARK: - Inspectables
16 | /// PowerUpSwift: Makes the corner radius editable via the Interface Builder.
17 | var cornerRadius: CGFloat { get set }
18 |
19 | /// PowerUpSwift: Makes the width of the border editable via the Interface Builder.
20 | var borderWidth: CGFloat { get set }
21 |
22 | /// PowerUpSwift: Makes the color of the border editable via the Interface Builder.
23 | var borderColor: UIColor? { get set }
24 |
25 | /// PowerUpSwift: Makes the raidus of the shadow editable via the Interface Builder.
26 | var shadowRadius: CGFloat { get set }
27 |
28 | /// PowerUpSwift: Makes the opacity of the shadow editable via the Interface Builder.
29 | var shadowOpacity: Float { get set }
30 |
31 | /// PowerUpSwift: Makes the offset of the shadow editable via the Interface Builder.
32 | var shadowOffset: CGSize { get set }
33 |
34 | /// PowerUpSwift: Makes the color of the shadow editable via the Interface Builder.
35 | var shadowColor: UIColor? { get set }
36 | }
37 |
--------------------------------------------------------------------------------
/PowerUpSwift/Classes/Classes/Protocols/PULocalizable.swift:
--------------------------------------------------------------------------------
1 | //
2 | // PULocalizable.swift
3 | // PowerUpSwift
4 | //
5 | // Created by Ceferino Jose II on 8/6/20.
6 | // Copyright © 2020 PowerUpX. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | /// PowerUpSwift: A protocol to localize basic controls in the Interface Builder.
12 | public protocol PUXIBLocalizable {
13 | /// PowerUpSwift: The key that is used in retrieving the localized value from a `.strings` file.
14 | var xibLocKey: String? { get set }
15 | }
16 |
17 | /// PowerUpSwift: A protocol to localize multiple texts in the same control such as the segmented control in the Interface Builder.
18 | public protocol PUXIBMultiLocalizable {
19 | /// PowerUpSwift: The keys that are used in retrieving the localized values from a `.strings` file.
20 | /// Each key must be separated by a comma.
21 | var xibLocKeys: String? { get set }
22 | }
23 |
24 | /// PowerUpSwift: A protocol to localize the placeholder in the text fields and text views in the Interface Builder.
25 | public protocol PUXIBPlaceholderLocalizable {
26 | /// PowerUpSwift: The key that is used in retrieving the localized value from a `.strings` file.
27 | var xibPlaceholderLocKey: String? { get set }
28 | }
29 |
--------------------------------------------------------------------------------
/PowerUpSwift/Classes/Extensions/CoreLocation/CLPlacemark.swift:
--------------------------------------------------------------------------------
1 | //
2 | // CLPlacemark.swift
3 | // PowerUpSwift
4 | //
5 | // Created by Ceferino Jose II on 14/08/2019.
6 | // Copyright © 2020 PowerUpX. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import CoreLocation
11 |
12 | extension CLPlacemark {
13 | /// PowerUpSwift: Returns a `String` that is composed of the concatenation of
14 | /// the properties of the CLPlacemark instance to form a full address format.
15 | public var fullAddress: String? {
16 | // See: https://stackoverflow.com/a/7768890
17 | var address = ""
18 |
19 | if let subThouroughfare = subThoroughfare { address += subThouroughfare + ", " }
20 | if let thoroughfare = thoroughfare { address += thoroughfare + ", " }
21 | if let subLocality = subLocality { address += subLocality + ", " }
22 | if let locality = locality { address += locality + ", " }
23 | if let subAdministrativeArea = subAdministrativeArea { address += subAdministrativeArea + ", " }
24 | if let administrativeArea = administrativeArea { address += administrativeArea + ", " }
25 | if let postalCode = postalCode { address += postalCode + ", " }
26 | if let country = country { address += country }
27 |
28 | guard address.isNotEmpty else { return nil }
29 |
30 | return address
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/PowerUpSwift/Classes/Extensions/Foundation/Bundle.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Bundle.swift
3 | // PowerUpSwift
4 | //
5 | // Created by Ceferino Jose II on 15/08/2019.
6 | // Copyright © 2020 PowerUpX. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | extension Bundle {
12 | /// PowerUpSwift: Returns the name of the app.
13 | public static var appName: String? {
14 | return main.infoDictionary?["CFBundleName"] as? String
15 | }
16 |
17 | /// PowerUpSwift: Returns the version number of the app.
18 | public static var versionNumber: String? {
19 | return main.infoDictionary?["CFBundleShortVersionString"] as? String
20 | }
21 |
22 | /// PowerUpSwift: Returns the build number of the app.
23 | public static var buildNumber: String? {
24 | return main.infoDictionary?["CFBundleVersion"] as? String
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/PowerUpSwift/Classes/Extensions/Foundation/Data.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Data.swift
3 | // PowerUpSwift
4 | //
5 | // Created by Ceferino Jose II on 4/21/20.
6 | // Copyright © 2020 PowerUpX. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | extension Data {
12 | /// PowerUpSwift: Returns the `Dictionary` form of the `Data` if the format is valid or `nil` if invalid.
13 | public var json: [String: Any]? {
14 | if let json = try? JSONSerialization.jsonObject(with: self, options: .allowFragments) as? [String: Any] {
15 | return json
16 | }
17 |
18 | return nil
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/PowerUpSwift/Classes/Extensions/Foundation/Dictionary.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Dictionary.swift
3 | // PowerUpSwift
4 | //
5 | // Created by Ceferino Jose II on 10/10/18.
6 | // Copyright © 2020 PowerUpX. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | extension Dictionary {
12 | /// PowerUpSwift: Returns a JSON `Data` converted from a `Dictionary`.
13 | public var data: Data? {
14 | return try? JSONSerialization.data(withJSONObject: self, options: .prettyPrinted)
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/PowerUpSwift/Classes/Extensions/Foundation/Optional.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Optional.swift
3 | // PowerUpSwift
4 | //
5 | // Created by Ceferino Jose II on 10/10/18.
6 | // Copyright © 2020 PowerUpX. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | extension Optional {
12 | /// :nodoc:
13 | public var stringValue : String? {
14 | if self == nil { return nil }
15 |
16 | if self is String || self is String? {
17 | return self as? String
18 | }
19 |
20 | return nil
21 | }
22 |
23 | /// :nodoc:
24 | public var boolValue: Bool {
25 | if self == nil { return false }
26 |
27 | if self is String || self is String? {
28 | return Bool(self as! String) ?? false
29 | }
30 |
31 | return false
32 | }
33 |
34 | /// :nodoc:
35 | public var dictionaryValue: [String: Any] {
36 | return self as? [String: Any] ?? [:]
37 | }
38 |
39 | /// :nodoc:
40 | public var dictionaryArrayValue: [[String: Any]] {
41 | return self as? [[String: Any]] ?? []
42 | }
43 |
44 | /// :nodoc:
45 | public var intValue: Int? {
46 | return self as? Int
47 | }
48 |
49 | /// :nodoc:
50 | public var doubleValue: Double? {
51 | return self as? Double
52 | }
53 |
54 | /// :nodoc:
55 | public var floatValue: Float? {
56 | return self as? Float
57 | }
58 |
59 | /// :nodoc:
60 | public var urlValue: URL? {
61 | if self == nil { return nil }
62 |
63 | if self is String || self is String? {
64 | return URL(string: (self as? String) ?? "")
65 | }
66 |
67 | if self is URL || self is URL? {
68 | return self as? URL
69 | }
70 |
71 | return nil
72 | }
73 | }
74 |
75 |
--------------------------------------------------------------------------------
/PowerUpSwift/Classes/Extensions/Foundation/String.swift:
--------------------------------------------------------------------------------
1 | //
2 | // String.swift
3 | // PowerUpSwift
4 | //
5 | // Created by Ceferino Jose II on 10/10/18.
6 | // Copyright © 2020 PowerUpX. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | extension String {
12 | /// PowerUpSwift: A `mutating` counterpart of `santized()`.
13 | public mutating func sanitize() {
14 | self = sanitized()
15 | }
16 |
17 | /// PowerUpSwift: Returns the trimmed valueof the String by:
18 | /// - removing all the white spaces and white new lines around
19 | /// - replacing two or more spaces inside with a single space
20 | /// - replacing three or more new lines inside with two new lines
21 | ///
22 | /// **It should just work! Trust PowerUpSwift. 😂😂😂**
23 | public func sanitized() -> String {
24 | return trimmingCharacters(in: .whitespacesAndNewlines)
25 | .replacingOccurrences(of: "\\ \\ +", with: " ", options: .regularExpression)
26 | .replacingOccurrences(of: "\n\n\n+", with: "\n\n", options: .regularExpression)
27 | }
28 |
29 | /// PowerUpSwift: Checks if the String is a valid email and returns a `Bool` value.
30 | public var isValidEmail: Bool {
31 | let regEx = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"
32 | let predicate = NSPredicate(format:"SELF MATCHES %@", regEx)
33 | return predicate.evaluate(with: self)
34 | }
35 |
36 | /// PowerUpSwift: Returns the reversed value of `isValidEmail`
37 | /// so it feels more natural to write than using an exclamation point.
38 | public var isNotValidEmail: Bool {
39 | return !isValidEmail
40 | }
41 |
42 | /// PowerUpSwift: Returns the reversed value of `isEmpty`
43 | /// so it feels more natural to write than using an exclamation point.
44 | public var isNotEmpty: Bool {
45 | return !isEmpty
46 | }
47 |
48 | /// PowerUpSwift: Uses the very `String` as the **key** in
49 | /// the main bundle's localizable resources and returns the **value**.
50 | public var localized: String {
51 | return NSLocalizedString(self, comment: "")
52 | }
53 |
54 | /// PowerUpSwift: Uses the very `String` as the **key** in the
55 | /// specified bundle's localizable resources and returns the **value**.
56 | public func localized(in bundle: Bundle?, comment: String = "") -> String {
57 | guard let bundle = bundle else {
58 | return NSLocalizedString(self, comment: comment)
59 | }
60 |
61 | return NSLocalizedString(self, bundle: bundle, comment: comment)
62 | }
63 |
64 | /// PowerUpSwift: Checks if the String is a valid IP address and returns a `Bool` value.
65 | public var isValidIP: Bool {
66 | let regEx = "^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}$"
67 | let predicate = NSPredicate(format:"SELF MATCHES %@", regEx)
68 | return predicate.evaluate(with: self)
69 | }
70 |
71 | /// PowerUpSwift: Returns the reversed value of `isValidIP`
72 | /// so it feels more natural to write than using an exclamation point.
73 | public var isNotValidIP: Bool {
74 | return !isValidIP
75 | }
76 |
77 | /// PowerUpSwift: Checks if the String is a valid mac address and returns a `Bool` value.
78 | public var isValidMAC: Bool {
79 | let regEx = "^([0-9A-Fa-f]{2}[:]){5}([0-9A-Fa-f]{2})$"
80 | let predicate = NSPredicate(format:"SELF MATCHES %@", regEx)
81 | return predicate.evaluate(with: self)
82 | }
83 |
84 | /// PowerUpSwift: Returns the reversed value of `isValidMAC`
85 | /// so it feels more natural to write than using an exclamation point.
86 | public var isNotValidMAC: Bool {
87 | return !isValidMAC
88 | }
89 |
90 | /// PowerUpSwift: Returns the `Dictionary` form of the `String`
91 | /// if the format is valid or `nil` if invalid.
92 | public var json: [String: Any]? {
93 | if let data = data(using: .utf8) {
94 | do {
95 | return try JSONSerialization.jsonObject(with: data, options: []) as? [String: Any]
96 | } catch {
97 | return nil
98 | }
99 | }
100 |
101 | return nil
102 | }
103 |
104 | /// PowerUpSwift: Parses the `String` and returns the payload `Dictionary` if it's a valid JWT.
105 | public var jwtPayload: [String: Any]? {
106 | // Seperate the strings by '.'
107 | let segments = components(separatedBy: ".")
108 |
109 | // Get the middle part of the jwt which is a base 64 version of the payload
110 | let base64Payload = segments[1]
111 |
112 | // I am not sure what's going on here but it works
113 | let padded = base64Payload.padding(
114 | toLength: ((base64Payload.count + 3) / 4) * 4,
115 | withPad: "=",
116 | startingAt: 0
117 | )
118 |
119 | // Decode the base 64 string to `Dictionary`
120 | if let decoded = Data(base64Encoded: padded),
121 | let json = try? JSONSerialization.jsonObject(with: decoded, options: []) as? [String: Any] {
122 | return json
123 | }
124 |
125 | return nil
126 | }
127 | }
128 |
129 | extension Optional where Wrapped == String {
130 | /// :nodoc:
131 | public var isNilOrEmpty: Bool {
132 | return (self ?? "").isEmpty
133 | }
134 | }
135 |
136 | // MARK: - Deprecated
137 | extension String {
138 | // This is how we are going to deprecate things.
139 | // @available(*, deprecated, renamed: "sanitize", message: "This is effective starting in version x.x.x.")
140 | // @available(*, unavailable, renamed: "sanitize", message: "This will no longer work starting in version x.x.x.")
141 | // public func oldFunction() {
142 | // newFunction()
143 | // }
144 | }
145 |
--------------------------------------------------------------------------------
/PowerUpSwift/Classes/Extensions/Foundation/URL.swift:
--------------------------------------------------------------------------------
1 | //
2 | // URL.swift
3 | // PowerUpSwift
4 | //
5 | // Created by Ceferino Jose II on 10/10/18.
6 | // Copyright © 2020 PowerUpX. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | extension URL {
12 | /// PowerUpSwift: Adds query parameters and set the value to itself. Thus, `mutating`.
13 | public mutating func addQueryParams(_ queryParams: [String: Any]) {
14 | self = addingQueryParams(queryParams)
15 | }
16 |
17 | /// PowerUpSwift: Returns the URL object with the appended query parameters.
18 | public func addingQueryParams(_ queryParams: [String: Any]) -> URL {
19 | var components = URLComponents(url: self, resolvingAgainstBaseURL: false)
20 | // Start putting together the paths:
21 | for param in queryParams {
22 | // If the query items is nil, we need to initialize so we can actually add the items.
23 | if components?.queryItems == nil {
24 | components?.queryItems = []
25 | }
26 | let queryItem = URLQueryItem(name: param.key, value: String(describing: param.value))
27 | components?.queryItems?.append(queryItem)
28 | }
29 |
30 | if let url = components?.url {
31 | return url
32 | }
33 |
34 | return self
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/PowerUpSwift/Classes/Extensions/Foundation/URLRequest.swift:
--------------------------------------------------------------------------------
1 | //
2 | // URLRequest.swift
3 | // PowerUpSwift
4 | //
5 | // Created by Ceferino Jose II on 10/10/18.
6 | // Copyright © 2020 PowerUpX. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | /// PowerUpSwift: An enum that mirrors the `String` values of the HTTP methods to prevent the risk of typographical errors.
12 | /// - Source: [https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods)
13 | public enum HTTPMethod: String {
14 | /// PowerUpSwift: Requests a representation of the specified resource.
15 | /// This should only retrieve data.
16 | case get = "GET"
17 |
18 | /// PowerUpSwift: Asks for a response identical to that of a GET request,
19 | /// but without the response body.
20 | case head = "HEAD"
21 |
22 | /// PowerUpSwift: Used to submit an entity to the specified resource,
23 | /// often causing a change in state or side effects on the server.
24 | case post = "POST"
25 |
26 | /// PowerUpSwift: Replaces all current representations of the target resource with the request payload.
27 | case put = "PUT"
28 |
29 | /// PowerUpSwift: Deletes the specified resource.
30 | case delete = "DELETE"
31 |
32 | /// PowerUpSwift: Establishes a tunnel to the server identified by the target resource.
33 | case connect = "CONNECT"
34 |
35 | /// PowerUpSwift: Used to describe the communication options for the target resource.
36 | case options = "OPTIONS"
37 |
38 | /// PowerUpSwift: Performs a message loop-back test along the path to the target resource.
39 | case trace = "TRACE"
40 |
41 | /// PowerUpSwift: Used to apply partial modifications to a resource.
42 | case patch = "PATCH"
43 | }
44 |
45 | extension URLRequest {
46 | /// PowerUpSwift: Sets the HTTP method using PowerUpSwift's `HTTPMethod` enum
47 | /// to help developer avoid mispelled Strings.
48 | public mutating func setMethod(_ method: HTTPMethod) {
49 | httpMethod = method.rawValue
50 | }
51 |
52 | /// PowerUpSwift: Sets the HTTP body by accepting a `Dictionary`.
53 | public mutating func setBody(_ json: [String: Any]) {
54 | httpBody = json.data
55 | setValue("application/json", forHTTPHeaderField: "Content-Type")
56 | }
57 |
58 | /// PowerUpSwift: Sets the HTTP body by accepting an object which has a `Type` that conforms to `Encodable`.
59 | public mutating func setBody(encodable: E) throws {
60 | httpBody = try JSONEncoder().encode(encodable)
61 | setValue("application/json", forHTTPHeaderField: "Content-Type")
62 | }
63 |
64 | /// PowerUpSwift: A wrapper to set all the HTTP Headers at once.
65 | public mutating func setHeaders(_ headers: [String: String]) {
66 | allHTTPHeaderFields = headers
67 | }
68 |
69 | /// PowerUpSwift: A wrapper to set the header fields intuitively.
70 | /// - Parameters:
71 | /// - key: String
72 | /// - value: String
73 | public mutating func addHeader(_ key: String, _ value: String) {
74 | addValue(value, forHTTPHeaderField: key)
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/PowerUpSwift/Classes/Extensions/Foundation/URLResponse.swift:
--------------------------------------------------------------------------------
1 | //
2 | // URLResponse.swift
3 | // PowerUpSwift
4 | //
5 | // Created by Ceferino Jose II on 10/10/18.
6 | // Copyright © 2020 PowerUpX. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | extension Optional where Wrapped == URLResponse {
12 | /// PowerUpSwift: Returns `true` if the HTTP Status Code is between the range of 200 to 299.
13 | public var isSuccess: Bool {
14 | if let response = self {
15 | switch response.code {
16 | case 200...299:
17 | return true
18 | default:
19 | return false
20 | }
21 | }
22 |
23 | return false
24 | }
25 |
26 | /// PowerUpSwift: Returns `true` if the HTTP Status Code is 401.
27 | public var isUnauthorized: Bool {
28 | if let response = self {
29 | return response.code == 401
30 | }
31 |
32 | return false
33 | }
34 |
35 | /// PowerUpSwift: Returns `true` if the HTTP Status Code is 403.
36 | public var isForbidden: Bool {
37 | if let response = self {
38 | return response.code == 403
39 | }
40 |
41 | return false
42 | }
43 | }
44 |
45 | extension URLResponse {
46 | /// PowerUpSwift: Returns the HTTP Status Code.
47 | public var code: Int {
48 | return (self as! HTTPURLResponse).statusCode
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/PowerUpSwift/Classes/Extensions/UIKit/NSLayoutConstraint.swift:
--------------------------------------------------------------------------------
1 | //
2 | // NSLayoutConstraint.swift
3 | // PowerUpSwift
4 | //
5 | // Created by Ceferino Jose II on 10/18/18.
6 | // Copyright © 2020 PowerUpX. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import UIKit
11 |
12 | extension NSLayoutConstraint {
13 | /**
14 | PowerUpSwift Returns a new constraint based on the passed in **multiplier**
15 | because the mutliplier property is read-only.
16 | ### Example
17 | ````
18 | myConstraint = myConstraint.withMultiplier(1.75)
19 | ````
20 | - Parameter multiplier: The new value of the multiplier.
21 | - Returns: The new constraint.
22 | */
23 | public func withMultiplier(_ multiplier: CGFloat) -> NSLayoutConstraint {
24 | NSLayoutConstraint.deactivate([self])
25 |
26 | let newConstraint = NSLayoutConstraint(
27 | item: firstItem as Any,
28 | attribute: firstAttribute,
29 | relatedBy: relation,
30 | toItem: secondItem,
31 | attribute: secondAttribute,
32 | multiplier: multiplier,
33 | constant: constant
34 | )
35 |
36 | newConstraint.priority = priority
37 | newConstraint.shouldBeArchived = shouldBeArchived
38 | newConstraint.identifier = identifier
39 |
40 | NSLayoutConstraint.activate([newConstraint])
41 | return newConstraint
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/PowerUpSwift/Classes/Extensions/UIKit/UIButton.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIButton.swift
3 | // PowerUpSwift
4 | //
5 | // Created by Ceferino Jose II on 10/10/18.
6 | // Copyright © 2020 PowerUpX. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | extension UIButton {
12 | /// PowerUpSwift: Sets the value of `isEnabled` and updates the `alpha` to 1 if enabled and 0.5 if not.
13 | public func setEnabled(_ enable: Bool) {
14 | isEnabled = enable
15 | alpha = enable ? 1 : 0.5
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/PowerUpSwift/Classes/Extensions/UIKit/UICollectionViewCell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UICollectionViewCell.swift
3 | // PowerUpSwift
4 | //
5 | // Created by Ceferino Jose II on 4/16/20.
6 | // Copyright © 2020 PowerUpX. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | extension UICollectionViewCell {
12 | /// PowerUpSwift: Returns the reversed value of `isSelected`
13 | /// so it feels more natural to write than using an exclamation point.
14 | public var isNotSelected: Bool {
15 | return !isSelected
16 | }
17 |
18 | /// PowerUpSwift: Returns the reversed value of `isHighlighted`
19 | /// so it feels more natural to write than using an exclamation point.
20 | public var isNotHighlighted: Bool {
21 | return !isHighlighted
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/PowerUpSwift/Classes/Extensions/UIKit/UIColor.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIColor.swift
3 | // PowerUpSwift
4 | //
5 | // Created by Ceferino Jose II on 10/10/18.
6 | // Copyright © 2020 PowerUpX. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | extension UIColor {
12 | /// PowerUpSwift: Initializes a `UIColor` based from the hex value.
13 | /// - Parameter hex: The hex string value similar to HTML.
14 | ///
15 | /// ### Example
16 | /// ```swift
17 | /// let color = UIColor(hex: "#FFFFFF")
18 | /// ```
19 | public convenience init(hex: String) {
20 | let hex = hex.trimmingCharacters(in: CharacterSet.alphanumerics.inverted)
21 | var int = UInt32()
22 | Scanner(string: hex).scanHexInt32(&int)
23 | let a, r, g, b: UInt32
24 |
25 | switch hex.count {
26 | case 3: // RGB (12-bit)
27 | (a, r, g, b) = (255, (int >> 8) * 17, (int >> 4 & 0xF) * 17, (int & 0xF) * 17)
28 | case 6: // RGB (24-bit)
29 | (a, r, g, b) = (255, int >> 16, int >> 8 & 0xFF, int & 0xFF)
30 | case 8: // ARGB (32-bit)
31 | (a, r, g, b) = (int >> 24, int >> 16 & 0xFF, int >> 8 & 0xFF, int & 0xFF)
32 | default:
33 | (a, r, g, b) = (255, 0, 0, 0)
34 | }
35 |
36 | self.init(red: CGFloat(r) / 255, green: CGFloat(g) / 255, blue: CGFloat(b) / 255, alpha: CGFloat(a) / 255)
37 | }
38 |
39 | /// PowerUpSwift: Initializes a `UIColor` based from the rgb/a value similar to HTML.
40 | /// - Parameters:
41 | /// - r: Red
42 | /// - g: Green
43 | /// - b: Blue
44 | /// - a: Alpha that defaults to `1.0` if not provided.
45 | /// ### Example
46 | /// ```swift
47 | /// let color = UIColor(r: 255, g: 255, b: 255)
48 | /// let anotherColor = UIColor(r: 0, g: 0, b: 0, a: 0.5)
49 | /// ```
50 | public convenience init(r: CGFloat, g: CGFloat, b: CGFloat, a: CGFloat? = 1.0) {
51 | self.init(red: r / 255, green: g / 255, blue: b / 255, alpha: a!)
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/PowerUpSwift/Classes/Extensions/UIKit/UINavigationController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UINavigationController.swift
3 | // PowerUpSwift
4 | //
5 | // Created by Ceferino Jose II on 8/6/20.
6 | // Copyright © 2020 PowerUpX. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | extension UINavigationController {
12 | /// PowerUpSwift: Adds a completion handler to `pushViewController(_, animated:)`.
13 | public func pushViewController(_ viewController: UIViewController, animated: Bool, completion: @escaping () -> Void) {
14 | pushViewController(viewController, animated: animated)
15 |
16 | guard animated, let coordinator = transitionCoordinator else {
17 | DispatchQueue.main.async { completion() }
18 | return
19 | }
20 |
21 | coordinator.animate(alongsideTransition: nil) { _ in completion() }
22 | }
23 |
24 | /// PowerUpSwift: Adds a completion handler to `popViewController(animated:)`.
25 | public func popViewController(animated: Bool, completion: @escaping () -> Void) {
26 | popViewController(animated: animated)
27 |
28 | guard animated, let coordinator = transitionCoordinator else {
29 | DispatchQueue.main.async { completion() }
30 | return
31 | }
32 |
33 | coordinator.animate(alongsideTransition: nil) { _ in completion() }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/PowerUpSwift/Classes/Extensions/UIKit/UIRefreshControl.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIRefreshControl.swift
3 | // PowerUpSwift
4 | //
5 | // Created by Ceferino Jose II on 8/6/20.
6 | // Copyright © 2020 PowerUpX. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | extension UIRefreshControl {
12 | /// PowerUpSwift: Returns the reversed value of `isRefreshing`
13 | /// so it feels more natural to write than using an exclamation point.
14 | public var isNotRefreshing: Bool {
15 | return !isRefreshing
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/PowerUpSwift/Classes/Extensions/UIKit/UITableView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UITableView.swift
3 | // Pods-PowerUpSwift_Example
4 | //
5 | // Created by Ceferino Jose II on 8/6/20.
6 | // Copyright © 2020 PowerUpX. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | extension UITableView {
12 | /// PowerUpSwift: Looks for the selected item in the table view and deselects it.
13 | public func deselectSelectedRow(animated: Bool) {
14 | if let indexPathForSelectedRow = indexPathForSelectedRow {
15 | deselectRow(at: indexPathForSelectedRow, animated: animated)
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/PowerUpSwift/Classes/Extensions/UIKit/UITableViewCell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UITableViewCell.swift
3 | // PowerUpSwift
4 | //
5 | // Created by Ceferino Jose II on 4/16/20.
6 | // Copyright © 2020 PowerUpX. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | extension UITableViewCell {
12 | /// PowerUpSwift: Returns the reversed value of `isSelected`
13 | /// so it feels more natural to write than using an exclamation point.
14 | public var isNotSelected: Bool {
15 | return !isSelected
16 | }
17 |
18 | /// PowerUpSwift: Returns the reversed value of `isHighlighted`
19 | /// so it feels more natural to write than using an exclamation point.
20 | public var isNotHighlighted: Bool {
21 | return !isHighlighted
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/PowerUpSwift/Classes/Extensions/UIKit/UITextView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UITextView.swift
3 | // PowerUpSwift
4 | //
5 | // Created by Ceferino Jose II on 10/15/18.
6 | // Copyright © 2020 PowerUpX. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | extension UITextView {
12 | /// PowerUpSwift: Makes the text views trailing content visible by scrolling to the bottom.
13 | public func scrollToBottom() {
14 | if text.count > 0 {
15 | let location = text.count - 1
16 | let bottom = NSMakeRange(location, 1)
17 | scrollRangeToVisible(bottom)
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/PowerUpSwift/Classes/Extensions/UIKit/UIViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIViewController.swift
3 | // PowerUpSwift
4 | //
5 | // Created by Ceferino Jose II on 10/10/18.
6 | // Copyright © 2020 PowerUpX. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | extension UIViewController {
12 | /// PowerUpSwift: Hides the keyboard when tapped outside the text field.
13 | public func dismissKeyboardWhenTappedOutside() {
14 | let tap: UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(UIViewController.dismissKeyboard))
15 | view.addGestureRecognizer(tap)
16 | }
17 |
18 | @objc func dismissKeyboard() {
19 | view.endEditing(true)
20 | }
21 |
22 | /// PowerUpSwift: A syntactic sugar to access UIViewController's `navigationController` property.
23 | /// - Some developers name their view controllers with something like `someVC` instead of `someViewController`.
24 | /// - This comes in handy since it will make the code more streamlined.
25 | public var navVC: UINavigationController? {
26 | return navigationController
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | ## Overview
14 | Apple doesn't provide some basic useful utilities to make our iOS Development lives a little easier. This might be for a reason, such as keeping the platform lightweight. It sometimes requires extra time and effort to implement a simple basic feature that you can easily do in Android built-in, so you end up doing a couple more hacks. This library was created to save time, to be more productive, and to be **DRY** (*Don't Repeat Yourself*).
15 |
16 | ## Usage
17 |
18 | The documentation reference can be found [here](http://powerupx.github.io/PowerUpSwiftDocs).
19 |
20 | ### Inteface Builder
21 |
22 | Just set `PUButton` as the custom class and see the magic! You'll be able to edit directly on the Interface Builder the corner radius, border width, border color, shadow radius, shadow opacity, shadow offset, shadow color, and etc. This applies to other views and controls such as `PUView`, `PUImageView` and many more.
23 |
24 |
25 |
26 |
27 |
28 | ### Code
29 |
30 | Import into the file as needed.
31 | ```swift
32 | import PowerUpSwift
33 | ```
34 |
35 |
36 |
37 |
38 |
39 | Now you can reduce the bulky *Utilities* folder that's filling up your source code.
40 |
41 | ## Installation
42 |
43 | PowerUpSwift is available through [CocoaPods](https://cocoapods.org/pods/PowerUpSwift). To install
44 | it, simply add the following line to your Podfile:
45 |
46 | ```ruby
47 | pod 'PowerUpSwift'
48 | ```
49 |
50 | ## Migration
51 |
52 | If you were using an old version of PowerUpSwift and want to bump to the latest one, make sure to check out [MIGRATION.md](https://github.com/PowerUpX/PowerUpSwift/blob/master/MIGRATION.md).
53 |
54 | ## Contribute
55 |
56 | You are encouraged to help out. See [CONTRIBUTING.md](https://github.com/PowerUpX/PowerUpSwift/blob/master/CONTRIBUTING.md).
57 |
58 | ## Support
59 | [](https://github.com/PowerUpX/PowerUpSwift)
60 | [](https://github.com/PowerUpX/PowerUpSwift/fork)
61 | [](https://github.com/PowerUpX/PowerUpSwift)
62 |
63 | ## Author
64 | [](https://github.com/cefjoeii)
65 | [](https://facebook.com/cefjoeii)
66 | [](https://instagram.com/cefjoeii)
67 | [](https://twitter.com/cefjoeii)
68 |
69 | ## License
70 |
71 | **PowerUpSwift** is available under the **MIT** license. See the [LICENSE](https://github.com/PowerUpX/PowerUpSwift/blob/master/LICENSE) file for more info.
72 |
--------------------------------------------------------------------------------
/Screenshots/Demo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PowerUpX/PowerUpSwift/8bc5201cf2183aaefc4e4870ff48fc113d4b2db2/Screenshots/Demo.gif
--------------------------------------------------------------------------------
/Screenshots/PowerUpSwift.afdesign:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PowerUpX/PowerUpSwift/8bc5201cf2183aaefc4e4870ff48fc113d4b2db2/Screenshots/PowerUpSwift.afdesign
--------------------------------------------------------------------------------
/Screenshots/PowerUpSwift.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PowerUpX/PowerUpSwift/8bc5201cf2183aaefc4e4870ff48fc113d4b2db2/Screenshots/PowerUpSwift.png
--------------------------------------------------------------------------------
/Screenshots/code-screenshot-orange.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PowerUpX/PowerUpSwift/8bc5201cf2183aaefc4e4870ff48fc113d4b2db2/Screenshots/code-screenshot-orange.png
--------------------------------------------------------------------------------
/Screenshots/code-screenshot-purple.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PowerUpX/PowerUpSwift/8bc5201cf2183aaefc4e4870ff48fc113d4b2db2/Screenshots/code-screenshot-purple.png
--------------------------------------------------------------------------------
/_Pods.xcodeproj:
--------------------------------------------------------------------------------
1 | Example/Pods/Pods.xcodeproj
--------------------------------------------------------------------------------