├── .gitignore
├── .travis.yml
├── Example
├── Podfile
├── Podfile.lock
├── Pods
│ ├── Local Podspecs
│ │ └── SDTheme.podspec.json
│ ├── Manifest.lock
│ ├── Pods.xcodeproj
│ │ └── project.pbxproj
│ └── Target Support Files
│ │ ├── Pods-SDTheme_Example
│ │ ├── Info.plist
│ │ ├── Pods-SDTheme_Example-acknowledgements.markdown
│ │ ├── Pods-SDTheme_Example-acknowledgements.plist
│ │ ├── Pods-SDTheme_Example-dummy.m
│ │ ├── Pods-SDTheme_Example-frameworks.sh
│ │ ├── Pods-SDTheme_Example-resources.sh
│ │ ├── Pods-SDTheme_Example-umbrella.h
│ │ ├── Pods-SDTheme_Example.debug.xcconfig
│ │ ├── Pods-SDTheme_Example.modulemap
│ │ └── Pods-SDTheme_Example.release.xcconfig
│ │ ├── Pods-SDTheme_Tests
│ │ ├── Info.plist
│ │ ├── Pods-SDTheme_Tests-acknowledgements.markdown
│ │ ├── Pods-SDTheme_Tests-acknowledgements.plist
│ │ ├── Pods-SDTheme_Tests-dummy.m
│ │ ├── Pods-SDTheme_Tests-frameworks.sh
│ │ ├── Pods-SDTheme_Tests-resources.sh
│ │ ├── Pods-SDTheme_Tests-umbrella.h
│ │ ├── Pods-SDTheme_Tests.debug.xcconfig
│ │ ├── Pods-SDTheme_Tests.modulemap
│ │ └── Pods-SDTheme_Tests.release.xcconfig
│ │ └── SDTheme
│ │ ├── Info.plist
│ │ ├── SDTheme-dummy.m
│ │ ├── SDTheme-prefix.pch
│ │ ├── SDTheme-umbrella.h
│ │ ├── SDTheme.modulemap
│ │ └── SDTheme.xcconfig
├── SDTheme-Black
│ ├── ColorsMap.plist
│ ├── Images.xcassets
│ │ ├── Contents.json
│ │ └── icon_face.imageset
│ │ │ ├── Contents.json
│ │ │ └── hover.pdf
│ └── Info.plist
├── SDTheme-White
│ ├── ColorsMap.plist
│ ├── Images.xcassets
│ │ ├── Contents.json
│ │ └── icon_face.imageset
│ │ │ ├── Contents.json
│ │ │ └── HSHomePage_my2.pdf
│ └── Info.plist
├── SDTheme.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ └── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── SDTheme-Example.xcscheme
├── SDTheme.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
├── SDTheme
│ ├── Base.lproj
│ │ ├── LaunchScreen.storyboard
│ │ └── Main.storyboard
│ ├── Images.xcassets
│ │ └── AppIcon.appiconset
│ │ │ └── Contents.json
│ ├── SDAppDelegate.h
│ ├── SDAppDelegate.m
│ ├── SDTheme-Info.plist
│ ├── SDTheme-Prefix.pch
│ ├── SDViewController.h
│ ├── SDViewController.m
│ ├── en.lproj
│ │ └── InfoPlist.strings
│ └── main.m
└── Tests
│ ├── Tests-Info.plist
│ ├── Tests-Prefix.pch
│ ├── Tests.m
│ └── en.lproj
│ └── InfoPlist.strings
├── LICENSE
├── README.md
├── SDTheme.podspec
├── SDTheme
├── Assets
│ └── .gitkeep
└── Classes
│ ├── .gitkeep
│ ├── Core
│ ├── NSAttributedString+SDTheme.h
│ ├── NSAttributedString+SDTheme.m
│ ├── NSDictionary+SDTheme.h
│ ├── NSDictionary+SDTheme.m
│ ├── NSObject+SDDeallocBlock.h
│ ├── NSObject+SDDeallocBlock.m
│ ├── NSObject+SDTheme.h
│ ├── NSObject+SDTheme.m
│ ├── SDThemeManager.h
│ ├── SDThemeManager.m
│ ├── UIColor+SDExtension.h
│ └── UIColor+SDExtension.m
│ ├── SDTheme.h
│ └── UIKit
│ ├── CALayer+SDTheme.h
│ ├── CALayer+SDTheme.m
│ ├── CAShapeLayer+SDTheme.h
│ ├── CAShapeLayer+SDTheme.m
│ ├── UIActivityIndicatorView+SDTheme.h
│ ├── UIActivityIndicatorView+SDTheme.m
│ ├── UIApplication+SDTheme.h
│ ├── UIApplication+SDTheme.m
│ ├── UIBarItem+SDTheme.h
│ ├── UIBarItem+SDTheme.m
│ ├── UIButton+SDTheme.h
│ ├── UIButton+SDTheme.m
│ ├── UIImage+SDExtension.h
│ ├── UIImage+SDExtension.m
│ ├── UIImageView+SDTheme.h
│ ├── UIImageView+SDTheme.m
│ ├── UILabel+SDTheme.h
│ ├── UILabel+SDTheme.m
│ ├── UINavigationBar+SDTheme.h
│ ├── UINavigationBar+SDTheme.m
│ ├── UIPageControl+SDTheme.h
│ ├── UIPageControl+SDTheme.m
│ ├── UISegmentedControl+SDTheme.h
│ ├── UISegmentedControl+SDTheme.m
│ ├── UISwitch+SDTheme.h
│ ├── UISwitch+SDTheme.m
│ ├── UITabBar+SDTheme.h
│ ├── UITabBar+SDTheme.m
│ ├── UITabBarItem+SDTheme.h
│ ├── UITabBarItem+SDTheme.m
│ ├── UITableView+SDTheme.h
│ ├── UITableView+SDTheme.m
│ ├── UITextField+SDTheme.h
│ ├── UITextField+SDTheme.m
│ ├── UITextView+SDTheme.h
│ ├── UITextView+SDTheme.m
│ ├── UIView+SDTheme.h
│ └── UIView+SDTheme.m
└── _Pods.xcodeproj
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | # Created by https://www.gitignore.io/api/macos,objective-c
3 |
4 | ### macOS ###
5 | *.DS_Store
6 | .AppleDouble
7 | .LSOverride
8 |
9 | # Icon must end with two \r
10 | Icon
11 |
12 | # Thumbnails
13 | ._*
14 |
15 | # Files that might appear in the root of a volume
16 | .DocumentRevisions-V100
17 | .fseventsd
18 | .Spotlight-V100
19 | .TemporaryItems
20 | .Trashes
21 | .VolumeIcon.icns
22 | .com.apple.timemachine.donotpresent
23 |
24 | # Directories potentially created on remote AFP share
25 | .AppleDB
26 | .AppleDesktop
27 | Network Trash Folder
28 | Temporary Items
29 | .apdisk
30 |
31 | ### Objective-C ###
32 | # Xcode
33 | #
34 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
35 |
36 | ## Build generated
37 | build/
38 | DerivedData/
39 |
40 | ## Various settings
41 | *.pbxuser
42 | !default.pbxuser
43 | *.mode1v3
44 | !default.mode1v3
45 | *.mode2v3
46 | !default.mode2v3
47 | *.perspectivev3
48 | !default.perspectivev3
49 | xcuserdata/
50 |
51 | ## Other
52 | *.moved-aside
53 | *.xccheckout
54 | *.xcscmblueprint
55 |
56 | ## Obj-C/Swift specific
57 | *.hmap
58 | *.ipa
59 | *.dSYM.zip
60 | *.dSYM
61 |
62 | # CocoaPods - Refactored to standalone file
63 |
64 |
65 | # Carthage - Refactored to standalone file
66 |
67 | # fastlane
68 | #
69 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
70 | # screenshots whenever they are needed.
71 | # For more information about the recommended setup visit:
72 | # https://docs.fastlane.tools/best-practices/source-control/#source-control
73 |
74 | fastlane/report.xml
75 | fastlane/Preview.html
76 | fastlane/screenshots
77 | fastlane/test_output
78 |
79 | # Code Injection
80 | #
81 | # After new code Injection tools there's a generated folder /iOSInjectionProject
82 | # https://github.com/johnno1962/injectionforxcode
83 |
84 | iOSInjectionProject/
85 |
86 | ### Objective-C Patch ###
87 |
88 |
89 | # End of https://www.gitignore.io/api/macos,objective-c
90 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | osx_image: xcode9
2 | language: objective-c
3 |
4 | cache: cocoapods
5 | podfile: Example/Podfile
6 |
7 | env:
8 | global:
9 | - LANG=en_US.UTF-8
10 | - LC_ALL=en_US.UTF-8
11 | - XCODE_PROJECT=Example/SDTheme.xcworkspace
12 | matrix:
13 | - SCHEME="SDTheme-Example"
14 |
15 | before_install:
16 | - gem install xcpretty --no-rdoc --no-ri --no-document --quiet
17 | - gem install cocoapods --pre --no-rdoc --no-ri --no-document --quiet
18 | - pod install --project-directory=Example
19 |
20 | script:
21 | - set -o pipefail
22 | - xcodebuild -workspace "$XCODE_PROJECT" -scheme "$SCHEME" -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO
23 |
24 | after_success:
25 | - sleep 3
--------------------------------------------------------------------------------
/Example/Podfile:
--------------------------------------------------------------------------------
1 | use_frameworks!
2 |
3 | target 'SDTheme_Example' do
4 | pod 'SDTheme', :path => '../'
5 |
6 | target 'SDTheme_Tests' do
7 | inherit! :search_paths
8 |
9 |
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/Example/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - SDTheme (0.1.0):
3 | - SDTheme/Core (= 0.1.0)
4 | - SDTheme/UIKit (= 0.1.0)
5 | - SDTheme/Core (0.1.0)
6 | - SDTheme/UIKit (0.1.0):
7 | - SDTheme/Core
8 |
9 | DEPENDENCIES:
10 | - SDTheme (from `../`)
11 |
12 | EXTERNAL SOURCES:
13 | SDTheme:
14 | :path: "../"
15 |
16 | SPEC CHECKSUMS:
17 | SDTheme: 429d00ff0c1e27f04fbf1c9aa667abca77ecabdc
18 |
19 | PODFILE CHECKSUM: 6d1b5f0b19df0c4fc33e41bc57246ca2154886f6
20 |
21 | COCOAPODS: 1.5.0
22 |
--------------------------------------------------------------------------------
/Example/Pods/Local Podspecs/SDTheme.podspec.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "SDTheme",
3 | "version": "0.1.0",
4 | "summary": "A lightweight skin switching solution.",
5 | "description": "TODO: Add long description of the pod here.",
6 | "homepage": "https://github.com/SlashDevelopers/SDTheme",
7 | "license": {
8 | "type": "MIT",
9 | "file": "LICENSE"
10 | },
11 | "authors": {
12 | "maligh": "455080311@qq.com",
13 | "culeo": "1823280359@qq.com"
14 | },
15 | "source": {
16 | "git": "https://github.com/SlashDevelopers/SDTheme.git",
17 | "tag": "0.1.0"
18 | },
19 | "platforms": {
20 | "ios": "8.0"
21 | },
22 | "source_files": "SDTheme/Classes/**/*.{m,h}",
23 | "public_header_files": "SDTheme/Classes/**/*.h",
24 | "subspecs": [
25 | {
26 | "name": "Core",
27 | "source_files": "SDTheme/Classes/Core/*.{m,h}",
28 | "public_header_files": "SDTheme/Classes/Core/*.h"
29 | },
30 | {
31 | "name": "UIKit",
32 | "source_files": "SDTheme/Classes/UIKit/*.{m,h}",
33 | "public_header_files": "SDTheme/Classes/UIKit/*.h",
34 | "dependencies": {
35 | "SDTheme/Core": [
36 |
37 | ]
38 | }
39 | }
40 | ]
41 | }
42 |
--------------------------------------------------------------------------------
/Example/Pods/Manifest.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - SDTheme (0.1.0):
3 | - SDTheme/Core (= 0.1.0)
4 | - SDTheme/UIKit (= 0.1.0)
5 | - SDTheme/Core (0.1.0)
6 | - SDTheme/UIKit (0.1.0):
7 | - SDTheme/Core
8 |
9 | DEPENDENCIES:
10 | - SDTheme (from `../`)
11 |
12 | EXTERNAL SOURCES:
13 | SDTheme:
14 | :path: "../"
15 |
16 | SPEC CHECKSUMS:
17 | SDTheme: 429d00ff0c1e27f04fbf1c9aa667abca77ecabdc
18 |
19 | PODFILE CHECKSUM: 6d1b5f0b19df0c4fc33e41bc57246ca2154886f6
20 |
21 | COCOAPODS: 1.5.0
22 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-SDTheme_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-SDTheme_Example/Pods-SDTheme_Example-acknowledgements.markdown:
--------------------------------------------------------------------------------
1 | # Acknowledgements
2 | This application makes use of the following third party libraries:
3 |
4 | ## SDTheme
5 |
6 | MIT License
7 |
8 | Copyright (c) 2018
9 |
10 | Permission is hereby granted, free of charge, to any person obtaining a copy
11 | of this software and associated documentation files (the "Software"), to deal
12 | in the Software without restriction, including without limitation the rights
13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14 | copies of the Software, and to permit persons to whom the Software is
15 | furnished to do so, subject to the following conditions:
16 |
17 | The above copyright notice and this permission notice shall be included in all
18 | copies or substantial portions of the Software.
19 |
20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26 | SOFTWARE.
27 |
28 | Generated by CocoaPods - https://cocoapods.org
29 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-SDTheme_Example/Pods-SDTheme_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 | MIT License
18 |
19 | Copyright (c) 2018
20 |
21 | Permission is hereby granted, free of charge, to any person obtaining a copy
22 | of this software and associated documentation files (the "Software"), to deal
23 | in the Software without restriction, including without limitation the rights
24 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
25 | copies of the Software, and to permit persons to whom the Software is
26 | furnished to do so, subject to the following conditions:
27 |
28 | The above copyright notice and this permission notice shall be included in all
29 | copies or substantial portions of the Software.
30 |
31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
32 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
33 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
34 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
35 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
36 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
37 | SOFTWARE.
38 |
39 | License
40 | MIT
41 | Title
42 | SDTheme
43 | Type
44 | PSGroupSpecifier
45 |
46 |
47 | FooterText
48 | Generated by CocoaPods - https://cocoapods.org
49 | Title
50 |
51 | Type
52 | PSGroupSpecifier
53 |
54 |
55 | StringsTable
56 | Acknowledgements
57 | Title
58 | Acknowledgements
59 |
60 |
61 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-SDTheme_Example/Pods-SDTheme_Example-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_SDTheme_Example : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_SDTheme_Example
5 | @end
6 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-SDTheme_Example/Pods-SDTheme_Example-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 |
145 | if [[ "$CONFIGURATION" == "Debug" ]]; then
146 | install_framework "${BUILT_PRODUCTS_DIR}/SDTheme/SDTheme.framework"
147 | fi
148 | if [[ "$CONFIGURATION" == "Release" ]]; then
149 | install_framework "${BUILT_PRODUCTS_DIR}/SDTheme/SDTheme.framework"
150 | fi
151 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
152 | wait
153 | fi
154 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-SDTheme_Example/Pods-SDTheme_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_BUILD_DIR}/assetcatalog_generated_info.plist"
117 | fi
118 | fi
119 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-SDTheme_Example/Pods-SDTheme_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_SDTheme_ExampleVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char Pods_SDTheme_ExampleVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-SDTheme_Example/Pods-SDTheme_Example.debug.xcconfig:
--------------------------------------------------------------------------------
1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SDTheme"
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
4 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/SDTheme/SDTheme.framework/Headers"
5 | OTHER_LDFLAGS = $(inherited) -framework "SDTheme"
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 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-SDTheme_Example/Pods-SDTheme_Example.modulemap:
--------------------------------------------------------------------------------
1 | framework module Pods_SDTheme_Example {
2 | umbrella header "Pods-SDTheme_Example-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-SDTheme_Example/Pods-SDTheme_Example.release.xcconfig:
--------------------------------------------------------------------------------
1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SDTheme"
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
4 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/SDTheme/SDTheme.framework/Headers"
5 | OTHER_LDFLAGS = $(inherited) -framework "SDTheme"
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 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-SDTheme_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-SDTheme_Tests/Pods-SDTheme_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-SDTheme_Tests/Pods-SDTheme_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-SDTheme_Tests/Pods-SDTheme_Tests-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_SDTheme_Tests : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_SDTheme_Tests
5 | @end
6 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-SDTheme_Tests/Pods-SDTheme_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-SDTheme_Tests/Pods-SDTheme_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_BUILD_DIR}/assetcatalog_generated_info.plist"
117 | fi
118 | fi
119 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-SDTheme_Tests/Pods-SDTheme_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_SDTheme_TestsVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char Pods_SDTheme_TestsVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-SDTheme_Tests/Pods-SDTheme_Tests.debug.xcconfig:
--------------------------------------------------------------------------------
1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SDTheme"
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
4 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/SDTheme/SDTheme.framework/Headers"
5 | PODS_BUILD_DIR = ${BUILD_DIR}
6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
8 | PODS_ROOT = ${SRCROOT}/Pods
9 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-SDTheme_Tests/Pods-SDTheme_Tests.modulemap:
--------------------------------------------------------------------------------
1 | framework module Pods_SDTheme_Tests {
2 | umbrella header "Pods-SDTheme_Tests-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-SDTheme_Tests/Pods-SDTheme_Tests.release.xcconfig:
--------------------------------------------------------------------------------
1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SDTheme"
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
4 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/SDTheme/SDTheme.framework/Headers"
5 | PODS_BUILD_DIR = ${BUILD_DIR}
6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
8 | PODS_ROOT = ${SRCROOT}/Pods
9 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/SDTheme/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/SDTheme/SDTheme-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_SDTheme : NSObject
3 | @end
4 | @implementation PodsDummy_SDTheme
5 | @end
6 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/SDTheme/SDTheme-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/SDTheme/SDTheme-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 | #import "NSAttributedString+SDTheme.h"
14 | #import "NSDictionary+SDTheme.h"
15 | #import "NSObject+SDDeallocBlock.h"
16 | #import "NSObject+SDTheme.h"
17 | #import "SDThemeManager.h"
18 | #import "UIColor+SDExtension.h"
19 | #import "SDTheme.h"
20 | #import "CALayer+SDTheme.h"
21 | #import "CAShapeLayer+SDTheme.h"
22 | #import "UIActivityIndicatorView+SDTheme.h"
23 | #import "UIApplication+SDTheme.h"
24 | #import "UIBarItem+SDTheme.h"
25 | #import "UIButton+SDTheme.h"
26 | #import "UIImage+SDExtension.h"
27 | #import "UIImageView+SDTheme.h"
28 | #import "UILabel+SDTheme.h"
29 | #import "UINavigationBar+SDTheme.h"
30 | #import "UIPageControl+SDTheme.h"
31 | #import "UISegmentedControl+SDTheme.h"
32 | #import "UISwitch+SDTheme.h"
33 | #import "UITabBar+SDTheme.h"
34 | #import "UITabBarItem+SDTheme.h"
35 | #import "UITableView+SDTheme.h"
36 | #import "UITextField+SDTheme.h"
37 | #import "UITextView+SDTheme.h"
38 | #import "UIView+SDTheme.h"
39 | #import "NSAttributedString+SDTheme.h"
40 | #import "NSDictionary+SDTheme.h"
41 | #import "NSObject+SDDeallocBlock.h"
42 | #import "NSObject+SDTheme.h"
43 | #import "SDThemeManager.h"
44 | #import "UIColor+SDExtension.h"
45 | #import "CALayer+SDTheme.h"
46 | #import "CAShapeLayer+SDTheme.h"
47 | #import "UIActivityIndicatorView+SDTheme.h"
48 | #import "UIApplication+SDTheme.h"
49 | #import "UIBarItem+SDTheme.h"
50 | #import "UIButton+SDTheme.h"
51 | #import "UIImage+SDExtension.h"
52 | #import "UIImageView+SDTheme.h"
53 | #import "UILabel+SDTheme.h"
54 | #import "UINavigationBar+SDTheme.h"
55 | #import "UIPageControl+SDTheme.h"
56 | #import "UISegmentedControl+SDTheme.h"
57 | #import "UISwitch+SDTheme.h"
58 | #import "UITabBar+SDTheme.h"
59 | #import "UITabBarItem+SDTheme.h"
60 | #import "UITableView+SDTheme.h"
61 | #import "UITextField+SDTheme.h"
62 | #import "UITextView+SDTheme.h"
63 | #import "UIView+SDTheme.h"
64 |
65 | FOUNDATION_EXPORT double SDThemeVersionNumber;
66 | FOUNDATION_EXPORT const unsigned char SDThemeVersionString[];
67 |
68 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/SDTheme/SDTheme.modulemap:
--------------------------------------------------------------------------------
1 | framework module SDTheme {
2 | umbrella header "SDTheme-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/SDTheme/SDTheme.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/SDTheme
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | PODS_BUILD_DIR = ${BUILD_DIR}
4 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
5 | PODS_ROOT = ${SRCROOT}
6 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../..
7 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
8 | SKIP_INSTALL = YES
9 |
--------------------------------------------------------------------------------
/Example/SDTheme-Black/ColorsMap.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Remark
6 | 黑色皮肤
7 | status
8 |
9 | Remark
10 | 状态栏颜色
11 | status_bar_default
12 |
13 | Remark
14 | Status-正常颜色
15 | Color
16 | #FFFFFF
17 |
18 |
19 | block
20 |
21 | block_tab_bg
22 |
23 | Remark
24 | 块-tab-背景色
25 | Color
26 | #242B36
27 |
28 | block_bg
29 |
30 | Remark
31 | 块-背景
32 | Color
33 | #141922
34 |
35 | block_activity_indicator
36 |
37 | Remark
38 | ActivityIndicator-颜色
39 | Color
40 | #999DAE
41 |
42 | block_orange
43 |
44 | Remark
45 | 块-橙色
46 | Color
47 | #F5A623
48 |
49 | block_pageControl_current
50 |
51 | Remark
52 | UIPageControl选中背景色
53 | Color
54 | #E5E5E5
55 |
56 | block_pageControl_normal
57 |
58 | Remark
59 | UIPageControl未选中背景色
60 | Color
61 | #999DAE
62 |
63 |
64 | text
65 |
66 | text_h1
67 |
68 | Remark
69 | 文字-主/标题
70 | Color
71 | #E5E5E5
72 |
73 | text_placeholder
74 |
75 | Remark
76 | 文字-输入框预设
77 | Color
78 | #6B6D76
79 |
80 | text_orange
81 |
82 | Remark
83 | 文字-橙色
84 | Color
85 | #F5A623
86 |
87 |
88 | line
89 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/Example/SDTheme-Black/Images.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/Example/SDTheme-Black/Images.xcassets/icon_face.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "hover.pdf"
6 | }
7 | ],
8 | "info" : {
9 | "version" : 1,
10 | "author" : "xcode"
11 | }
12 | }
--------------------------------------------------------------------------------
/Example/SDTheme-Black/Images.xcassets/icon_face.imageset/hover.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlashDevelopers/SDTheme/7e43d5ed0a165a19831908509f25d9bf7afbbd45/Example/SDTheme-Black/Images.xcassets/icon_face.imageset/hover.pdf
--------------------------------------------------------------------------------
/Example/SDTheme-Black/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
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 | CFBundleVersion
20 | 1
21 | NSHumanReadableCopyright
22 | Copyright © 2018年 maligh. All rights reserved.
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Example/SDTheme-White/ColorsMap.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Remark
6 | 白色皮肤
7 | status
8 |
9 | Remark
10 | 状态栏颜色
11 | status_bar_default
12 |
13 | Remark
14 | Status-正常颜色
15 | Color
16 | #000000
17 |
18 |
19 | block
20 |
21 | block_tab_bg
22 |
23 | Remark
24 | 块-tab-背景色
25 | Color
26 | #242B36
27 |
28 | block_bg
29 |
30 | Remark
31 | 块-背景
32 | Color
33 | #F2F2F2
34 |
35 | block_activity_indicator
36 |
37 | Remark
38 | ActivityIndicator-颜色
39 | Color
40 | #666666
41 |
42 | block_orange
43 |
44 | Remark
45 | 块-橙色
46 | Color
47 | #FF8200
48 |
49 | block_pageControl_current
50 |
51 | Remark
52 | UIPageControl选中背景色
53 | Color
54 | #FF8200
55 |
56 | block_pageControl_normal
57 |
58 | Remark
59 | UIPageControl未选中背景色
60 | Color
61 | #E5E5E5
62 |
63 |
64 | text
65 |
66 | text_h1
67 |
68 | Remark
69 | 文字-主/标题
70 | Color
71 | #333333
72 |
73 | text_placeholder
74 |
75 | Remark
76 | 文字-输入框预设
77 | Color
78 | #C9C9CA
79 |
80 | text_orange
81 |
82 | Remark
83 | 文字-橙色
84 | Color
85 | #FF8200
86 |
87 |
88 | line
89 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/Example/SDTheme-White/Images.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/Example/SDTheme-White/Images.xcassets/icon_face.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "HSHomePage_my2.pdf"
6 | }
7 | ],
8 | "info" : {
9 | "version" : 1,
10 | "author" : "xcode"
11 | }
12 | }
--------------------------------------------------------------------------------
/Example/SDTheme-White/Images.xcassets/icon_face.imageset/HSHomePage_my2.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlashDevelopers/SDTheme/7e43d5ed0a165a19831908509f25d9bf7afbbd45/Example/SDTheme-White/Images.xcassets/icon_face.imageset/HSHomePage_my2.pdf
--------------------------------------------------------------------------------
/Example/SDTheme-White/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
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 | CFBundleVersion
20 | 1
21 | NSHumanReadableCopyright
22 | Copyright © 2018年 maligh. All rights reserved.
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Example/SDTheme.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 1A82EC7B7AD9ABDB02E8DC2A /* Pods_SDTheme_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 23A0A1C99B7D9CFEA979B066 /* Pods_SDTheme_Example.framework */; };
11 | 246402B020CFD36F00F80B7F /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2464025020CFBDC300F80B7F /* Images.xcassets */; };
12 | 246402B120CFD36F00F80B7F /* ColorsMap.plist in Resources */ = {isa = PBXBuildFile; fileRef = 2464025120CFBDC300F80B7F /* ColorsMap.plist */; };
13 | 246402B220CFD37800F80B7F /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2464024D20CFBDC300F80B7F /* Images.xcassets */; };
14 | 246402B320CFD37800F80B7F /* ColorsMap.plist in Resources */ = {isa = PBXBuildFile; fileRef = 2464024E20CFBDC300F80B7F /* ColorsMap.plist */; };
15 | 246402B420CFDEC800F80B7F /* SDTheme-White.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 246402A020CFD2D600F80B7F /* SDTheme-White.bundle */; };
16 | 246402B520CFDEC800F80B7F /* SDTheme-Black.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 246402AA20CFD2E900F80B7F /* SDTheme-Black.bundle */; };
17 | 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; };
18 | 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; };
19 | 6003F592195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; };
20 | 6003F598195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F596195388D20070C39A /* InfoPlist.strings */; };
21 | 6003F59A195388D20070C39A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F599195388D20070C39A /* main.m */; };
22 | 6003F59E195388D20070C39A /* SDAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F59D195388D20070C39A /* SDAppDelegate.m */; };
23 | 6003F5A7195388D20070C39A /* SDViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5A6195388D20070C39A /* SDViewController.m */; };
24 | 6003F5A9195388D20070C39A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5A8195388D20070C39A /* Images.xcassets */; };
25 | 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F5AF195388D20070C39A /* XCTest.framework */; };
26 | 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; };
27 | 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; };
28 | 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5B8195388D20070C39A /* InfoPlist.strings */; };
29 | 6003F5BC195388D20070C39A /* Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5BB195388D20070C39A /* Tests.m */; };
30 | 71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */; };
31 | 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */; };
32 | D157013C9C015A0D6C21DE0F /* Pods_SDTheme_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1F1C3A274919733D80DA4778 /* Pods_SDTheme_Tests.framework */; };
33 | /* End PBXBuildFile section */
34 |
35 | /* Begin PBXContainerItemProxy section */
36 | 245E044020D0FB610082DD3B /* PBXContainerItemProxy */ = {
37 | isa = PBXContainerItemProxy;
38 | containerPortal = 6003F582195388D10070C39A /* Project object */;
39 | proxyType = 1;
40 | remoteGlobalIDString = 2464029F20CFD2D600F80B7F;
41 | remoteInfo = "SDTheme-White";
42 | };
43 | 245E044220D0FB610082DD3B /* PBXContainerItemProxy */ = {
44 | isa = PBXContainerItemProxy;
45 | containerPortal = 6003F582195388D10070C39A /* Project object */;
46 | proxyType = 1;
47 | remoteGlobalIDString = 246402A920CFD2E900F80B7F;
48 | remoteInfo = "SDTheme-Black";
49 | };
50 | 6003F5B3195388D20070C39A /* PBXContainerItemProxy */ = {
51 | isa = PBXContainerItemProxy;
52 | containerPortal = 6003F582195388D10070C39A /* Project object */;
53 | proxyType = 1;
54 | remoteGlobalIDString = 6003F589195388D20070C39A;
55 | remoteInfo = SDTheme;
56 | };
57 | /* End PBXContainerItemProxy section */
58 |
59 | /* Begin PBXFileReference section */
60 | 0F531DA3ABDFC32CDA66AB4D /* Pods-SDTheme_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SDTheme_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SDTheme_Example/Pods-SDTheme_Example.debug.xcconfig"; sourceTree = ""; };
61 | 1CE8294D9EE634FBBE164A52 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; };
62 | 1F1C3A274919733D80DA4778 /* Pods_SDTheme_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SDTheme_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
63 | 22C36D762D00E95828F77A6B /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; };
64 | 23A0A1C99B7D9CFEA979B066 /* Pods_SDTheme_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SDTheme_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
65 | 2464024D20CFBDC300F80B7F /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = "SDTheme-White/Images.xcassets"; sourceTree = SOURCE_ROOT; };
66 | 2464024E20CFBDC300F80B7F /* ColorsMap.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = ColorsMap.plist; sourceTree = ""; };
67 | 2464025020CFBDC300F80B7F /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = "SDTheme-Black/Images.xcassets"; sourceTree = SOURCE_ROOT; };
68 | 2464025120CFBDC300F80B7F /* ColorsMap.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = ColorsMap.plist; sourceTree = ""; };
69 | 246402A020CFD2D600F80B7F /* SDTheme-White.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "SDTheme-White.bundle"; sourceTree = BUILT_PRODUCTS_DIR; };
70 | 246402A220CFD2D600F80B7F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
71 | 246402AA20CFD2E900F80B7F /* SDTheme-Black.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "SDTheme-Black.bundle"; sourceTree = BUILT_PRODUCTS_DIR; };
72 | 246402AC20CFD2E900F80B7F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
73 | 2754F4E9BEF03BAC578A38E4 /* Pods-SDTheme_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SDTheme_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-SDTheme_Example/Pods-SDTheme_Example.release.xcconfig"; sourceTree = ""; };
74 | 6003F58A195388D20070C39A /* SDTheme_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SDTheme_Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
75 | 6003F58D195388D20070C39A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
76 | 6003F58F195388D20070C39A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
77 | 6003F591195388D20070C39A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
78 | 6003F595195388D20070C39A /* SDTheme-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SDTheme-Info.plist"; sourceTree = ""; };
79 | 6003F597195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; };
80 | 6003F599195388D20070C39A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
81 | 6003F59B195388D20070C39A /* SDTheme-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SDTheme-Prefix.pch"; sourceTree = ""; };
82 | 6003F59C195388D20070C39A /* SDAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDAppDelegate.h; sourceTree = ""; };
83 | 6003F59D195388D20070C39A /* SDAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDAppDelegate.m; sourceTree = ""; };
84 | 6003F5A5195388D20070C39A /* SDViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDViewController.h; sourceTree = ""; };
85 | 6003F5A6195388D20070C39A /* SDViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDViewController.m; sourceTree = ""; };
86 | 6003F5A8195388D20070C39A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; };
87 | 6003F5AE195388D20070C39A /* SDTheme_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SDTheme_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
88 | 6003F5AF195388D20070C39A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
89 | 6003F5B7195388D20070C39A /* Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Tests-Info.plist"; sourceTree = ""; };
90 | 6003F5B9195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; };
91 | 6003F5BB195388D20070C39A /* Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Tests.m; sourceTree = ""; };
92 | 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = ""; };
93 | 65167C842B6AF02BA0E41A28 /* SDTheme.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = SDTheme.podspec; path = ../SDTheme.podspec; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
94 | 71719F9E1E33DC2100824A3D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
95 | 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Main.storyboard; path = Base.lproj/Main.storyboard; sourceTree = ""; };
96 | D0C9DA14FA9EFA3479B4EE17 /* Pods-SDTheme_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SDTheme_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-SDTheme_Tests/Pods-SDTheme_Tests.release.xcconfig"; sourceTree = ""; };
97 | E09FA306F04D787EAA55EB78 /* Pods-SDTheme_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SDTheme_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SDTheme_Tests/Pods-SDTheme_Tests.debug.xcconfig"; sourceTree = ""; };
98 | /* End PBXFileReference section */
99 |
100 | /* Begin PBXFrameworksBuildPhase section */
101 | 2464029D20CFD2D600F80B7F /* Frameworks */ = {
102 | isa = PBXFrameworksBuildPhase;
103 | buildActionMask = 2147483647;
104 | files = (
105 | );
106 | runOnlyForDeploymentPostprocessing = 0;
107 | };
108 | 246402A720CFD2E900F80B7F /* Frameworks */ = {
109 | isa = PBXFrameworksBuildPhase;
110 | buildActionMask = 2147483647;
111 | files = (
112 | );
113 | runOnlyForDeploymentPostprocessing = 0;
114 | };
115 | 6003F587195388D20070C39A /* Frameworks */ = {
116 | isa = PBXFrameworksBuildPhase;
117 | buildActionMask = 2147483647;
118 | files = (
119 | 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */,
120 | 6003F592195388D20070C39A /* UIKit.framework in Frameworks */,
121 | 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */,
122 | 1A82EC7B7AD9ABDB02E8DC2A /* Pods_SDTheme_Example.framework in Frameworks */,
123 | );
124 | runOnlyForDeploymentPostprocessing = 0;
125 | };
126 | 6003F5AB195388D20070C39A /* Frameworks */ = {
127 | isa = PBXFrameworksBuildPhase;
128 | buildActionMask = 2147483647;
129 | files = (
130 | 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */,
131 | 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */,
132 | 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */,
133 | D157013C9C015A0D6C21DE0F /* Pods_SDTheme_Tests.framework in Frameworks */,
134 | );
135 | runOnlyForDeploymentPostprocessing = 0;
136 | };
137 | /* End PBXFrameworksBuildPhase section */
138 |
139 | /* Begin PBXGroup section */
140 | 246402A120CFD2D600F80B7F /* SDTheme-White */ = {
141 | isa = PBXGroup;
142 | children = (
143 | 2464024E20CFBDC300F80B7F /* ColorsMap.plist */,
144 | 2464024D20CFBDC300F80B7F /* Images.xcassets */,
145 | 246402A220CFD2D600F80B7F /* Info.plist */,
146 | );
147 | path = "SDTheme-White";
148 | sourceTree = "";
149 | };
150 | 246402AB20CFD2E900F80B7F /* SDTheme-Black */ = {
151 | isa = PBXGroup;
152 | children = (
153 | 2464025120CFBDC300F80B7F /* ColorsMap.plist */,
154 | 2464025020CFBDC300F80B7F /* Images.xcassets */,
155 | 246402AC20CFD2E900F80B7F /* Info.plist */,
156 | );
157 | path = "SDTheme-Black";
158 | sourceTree = "";
159 | };
160 | 30092B862A5916B637AABB24 /* Pods */ = {
161 | isa = PBXGroup;
162 | children = (
163 | 0F531DA3ABDFC32CDA66AB4D /* Pods-SDTheme_Example.debug.xcconfig */,
164 | 2754F4E9BEF03BAC578A38E4 /* Pods-SDTheme_Example.release.xcconfig */,
165 | E09FA306F04D787EAA55EB78 /* Pods-SDTheme_Tests.debug.xcconfig */,
166 | D0C9DA14FA9EFA3479B4EE17 /* Pods-SDTheme_Tests.release.xcconfig */,
167 | );
168 | name = Pods;
169 | sourceTree = "";
170 | };
171 | 6003F581195388D10070C39A = {
172 | isa = PBXGroup;
173 | children = (
174 | 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */,
175 | 6003F593195388D20070C39A /* Example for SDTheme */,
176 | 6003F5B5195388D20070C39A /* Tests */,
177 | 246402A120CFD2D600F80B7F /* SDTheme-White */,
178 | 246402AB20CFD2E900F80B7F /* SDTheme-Black */,
179 | 6003F58C195388D20070C39A /* Frameworks */,
180 | 6003F58B195388D20070C39A /* Products */,
181 | 30092B862A5916B637AABB24 /* Pods */,
182 | );
183 | sourceTree = "";
184 | };
185 | 6003F58B195388D20070C39A /* Products */ = {
186 | isa = PBXGroup;
187 | children = (
188 | 6003F58A195388D20070C39A /* SDTheme_Example.app */,
189 | 6003F5AE195388D20070C39A /* SDTheme_Tests.xctest */,
190 | 246402A020CFD2D600F80B7F /* SDTheme-White.bundle */,
191 | 246402AA20CFD2E900F80B7F /* SDTheme-Black.bundle */,
192 | );
193 | name = Products;
194 | sourceTree = "";
195 | };
196 | 6003F58C195388D20070C39A /* Frameworks */ = {
197 | isa = PBXGroup;
198 | children = (
199 | 6003F58D195388D20070C39A /* Foundation.framework */,
200 | 6003F58F195388D20070C39A /* CoreGraphics.framework */,
201 | 6003F591195388D20070C39A /* UIKit.framework */,
202 | 6003F5AF195388D20070C39A /* XCTest.framework */,
203 | 23A0A1C99B7D9CFEA979B066 /* Pods_SDTheme_Example.framework */,
204 | 1F1C3A274919733D80DA4778 /* Pods_SDTheme_Tests.framework */,
205 | );
206 | name = Frameworks;
207 | sourceTree = "";
208 | };
209 | 6003F593195388D20070C39A /* Example for SDTheme */ = {
210 | isa = PBXGroup;
211 | children = (
212 | 6003F59C195388D20070C39A /* SDAppDelegate.h */,
213 | 6003F59D195388D20070C39A /* SDAppDelegate.m */,
214 | 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */,
215 | 6003F5A5195388D20070C39A /* SDViewController.h */,
216 | 6003F5A6195388D20070C39A /* SDViewController.m */,
217 | 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */,
218 | 6003F5A8195388D20070C39A /* Images.xcassets */,
219 | 6003F594195388D20070C39A /* Supporting Files */,
220 | );
221 | name = "Example for SDTheme";
222 | path = SDTheme;
223 | sourceTree = "";
224 | };
225 | 6003F594195388D20070C39A /* Supporting Files */ = {
226 | isa = PBXGroup;
227 | children = (
228 | 6003F595195388D20070C39A /* SDTheme-Info.plist */,
229 | 6003F596195388D20070C39A /* InfoPlist.strings */,
230 | 6003F599195388D20070C39A /* main.m */,
231 | 6003F59B195388D20070C39A /* SDTheme-Prefix.pch */,
232 | );
233 | name = "Supporting Files";
234 | sourceTree = "";
235 | };
236 | 6003F5B5195388D20070C39A /* Tests */ = {
237 | isa = PBXGroup;
238 | children = (
239 | 6003F5BB195388D20070C39A /* Tests.m */,
240 | 6003F5B6195388D20070C39A /* Supporting Files */,
241 | );
242 | path = Tests;
243 | sourceTree = "";
244 | };
245 | 6003F5B6195388D20070C39A /* Supporting Files */ = {
246 | isa = PBXGroup;
247 | children = (
248 | 6003F5B7195388D20070C39A /* Tests-Info.plist */,
249 | 6003F5B8195388D20070C39A /* InfoPlist.strings */,
250 | 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */,
251 | );
252 | name = "Supporting Files";
253 | sourceTree = "";
254 | };
255 | 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */ = {
256 | isa = PBXGroup;
257 | children = (
258 | 65167C842B6AF02BA0E41A28 /* SDTheme.podspec */,
259 | 22C36D762D00E95828F77A6B /* README.md */,
260 | 1CE8294D9EE634FBBE164A52 /* LICENSE */,
261 | );
262 | name = "Podspec Metadata";
263 | sourceTree = "";
264 | };
265 | /* End PBXGroup section */
266 |
267 | /* Begin PBXNativeTarget section */
268 | 2464029F20CFD2D600F80B7F /* SDTheme-White */ = {
269 | isa = PBXNativeTarget;
270 | buildConfigurationList = 246402A320CFD2D600F80B7F /* Build configuration list for PBXNativeTarget "SDTheme-White" */;
271 | buildPhases = (
272 | 2464029C20CFD2D600F80B7F /* Sources */,
273 | 2464029D20CFD2D600F80B7F /* Frameworks */,
274 | 2464029E20CFD2D600F80B7F /* Resources */,
275 | );
276 | buildRules = (
277 | );
278 | dependencies = (
279 | );
280 | name = "SDTheme-White";
281 | productName = "SDTheme-White";
282 | productReference = 246402A020CFD2D600F80B7F /* SDTheme-White.bundle */;
283 | productType = "com.apple.product-type.bundle";
284 | };
285 | 246402A920CFD2E900F80B7F /* SDTheme-Black */ = {
286 | isa = PBXNativeTarget;
287 | buildConfigurationList = 246402AD20CFD2E900F80B7F /* Build configuration list for PBXNativeTarget "SDTheme-Black" */;
288 | buildPhases = (
289 | 246402A620CFD2E900F80B7F /* Sources */,
290 | 246402A720CFD2E900F80B7F /* Frameworks */,
291 | 246402A820CFD2E900F80B7F /* Resources */,
292 | );
293 | buildRules = (
294 | );
295 | dependencies = (
296 | );
297 | name = "SDTheme-Black";
298 | productName = "SDTheme-Black";
299 | productReference = 246402AA20CFD2E900F80B7F /* SDTheme-Black.bundle */;
300 | productType = "com.apple.product-type.bundle";
301 | };
302 | 6003F589195388D20070C39A /* SDTheme_Example */ = {
303 | isa = PBXNativeTarget;
304 | buildConfigurationList = 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "SDTheme_Example" */;
305 | buildPhases = (
306 | 25A23CB96627F08633B3D414 /* [CP] Check Pods Manifest.lock */,
307 | 6003F586195388D20070C39A /* Sources */,
308 | 6003F587195388D20070C39A /* Frameworks */,
309 | 6003F588195388D20070C39A /* Resources */,
310 | D2366CC42BD18A475480A2A8 /* [CP] Embed Pods Frameworks */,
311 | );
312 | buildRules = (
313 | );
314 | dependencies = (
315 | 245E044120D0FB610082DD3B /* PBXTargetDependency */,
316 | 245E044320D0FB610082DD3B /* PBXTargetDependency */,
317 | );
318 | name = SDTheme_Example;
319 | productName = SDTheme;
320 | productReference = 6003F58A195388D20070C39A /* SDTheme_Example.app */;
321 | productType = "com.apple.product-type.application";
322 | };
323 | 6003F5AD195388D20070C39A /* SDTheme_Tests */ = {
324 | isa = PBXNativeTarget;
325 | buildConfigurationList = 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "SDTheme_Tests" */;
326 | buildPhases = (
327 | 30BB47669C1EEF8135F78D52 /* [CP] Check Pods Manifest.lock */,
328 | 6003F5AA195388D20070C39A /* Sources */,
329 | 6003F5AB195388D20070C39A /* Frameworks */,
330 | 6003F5AC195388D20070C39A /* Resources */,
331 | );
332 | buildRules = (
333 | );
334 | dependencies = (
335 | 6003F5B4195388D20070C39A /* PBXTargetDependency */,
336 | );
337 | name = SDTheme_Tests;
338 | productName = SDThemeTests;
339 | productReference = 6003F5AE195388D20070C39A /* SDTheme_Tests.xctest */;
340 | productType = "com.apple.product-type.bundle.unit-test";
341 | };
342 | /* End PBXNativeTarget section */
343 |
344 | /* Begin PBXProject section */
345 | 6003F582195388D10070C39A /* Project object */ = {
346 | isa = PBXProject;
347 | attributes = {
348 | CLASSPREFIX = SD;
349 | LastUpgradeCheck = 0720;
350 | ORGANIZATIONNAME = maligh;
351 | TargetAttributes = {
352 | 2464029F20CFD2D600F80B7F = {
353 | CreatedOnToolsVersion = 9.3;
354 | ProvisioningStyle = Automatic;
355 | };
356 | 246402A920CFD2E900F80B7F = {
357 | CreatedOnToolsVersion = 9.3;
358 | ProvisioningStyle = Automatic;
359 | };
360 | 6003F5AD195388D20070C39A = {
361 | TestTargetID = 6003F589195388D20070C39A;
362 | };
363 | };
364 | };
365 | buildConfigurationList = 6003F585195388D10070C39A /* Build configuration list for PBXProject "SDTheme" */;
366 | compatibilityVersion = "Xcode 3.2";
367 | developmentRegion = English;
368 | hasScannedForEncodings = 0;
369 | knownRegions = (
370 | en,
371 | Base,
372 | );
373 | mainGroup = 6003F581195388D10070C39A;
374 | productRefGroup = 6003F58B195388D20070C39A /* Products */;
375 | projectDirPath = "";
376 | projectRoot = "";
377 | targets = (
378 | 6003F589195388D20070C39A /* SDTheme_Example */,
379 | 6003F5AD195388D20070C39A /* SDTheme_Tests */,
380 | 2464029F20CFD2D600F80B7F /* SDTheme-White */,
381 | 246402A920CFD2E900F80B7F /* SDTheme-Black */,
382 | );
383 | };
384 | /* End PBXProject section */
385 |
386 | /* Begin PBXResourcesBuildPhase section */
387 | 2464029E20CFD2D600F80B7F /* Resources */ = {
388 | isa = PBXResourcesBuildPhase;
389 | buildActionMask = 2147483647;
390 | files = (
391 | 246402B220CFD37800F80B7F /* Images.xcassets in Resources */,
392 | 246402B320CFD37800F80B7F /* ColorsMap.plist in Resources */,
393 | );
394 | runOnlyForDeploymentPostprocessing = 0;
395 | };
396 | 246402A820CFD2E900F80B7F /* Resources */ = {
397 | isa = PBXResourcesBuildPhase;
398 | buildActionMask = 2147483647;
399 | files = (
400 | 246402B020CFD36F00F80B7F /* Images.xcassets in Resources */,
401 | 246402B120CFD36F00F80B7F /* ColorsMap.plist in Resources */,
402 | );
403 | runOnlyForDeploymentPostprocessing = 0;
404 | };
405 | 6003F588195388D20070C39A /* Resources */ = {
406 | isa = PBXResourcesBuildPhase;
407 | buildActionMask = 2147483647;
408 | files = (
409 | 246402B420CFDEC800F80B7F /* SDTheme-White.bundle in Resources */,
410 | 246402B520CFDEC800F80B7F /* SDTheme-Black.bundle in Resources */,
411 | 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */,
412 | 71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */,
413 | 6003F5A9195388D20070C39A /* Images.xcassets in Resources */,
414 | 6003F598195388D20070C39A /* InfoPlist.strings in Resources */,
415 | );
416 | runOnlyForDeploymentPostprocessing = 0;
417 | };
418 | 6003F5AC195388D20070C39A /* Resources */ = {
419 | isa = PBXResourcesBuildPhase;
420 | buildActionMask = 2147483647;
421 | files = (
422 | 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */,
423 | );
424 | runOnlyForDeploymentPostprocessing = 0;
425 | };
426 | /* End PBXResourcesBuildPhase section */
427 |
428 | /* Begin PBXShellScriptBuildPhase section */
429 | 25A23CB96627F08633B3D414 /* [CP] Check Pods Manifest.lock */ = {
430 | isa = PBXShellScriptBuildPhase;
431 | buildActionMask = 2147483647;
432 | files = (
433 | );
434 | inputPaths = (
435 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
436 | "${PODS_ROOT}/Manifest.lock",
437 | );
438 | name = "[CP] Check Pods Manifest.lock";
439 | outputPaths = (
440 | "$(DERIVED_FILE_DIR)/Pods-SDTheme_Example-checkManifestLockResult.txt",
441 | );
442 | runOnlyForDeploymentPostprocessing = 0;
443 | shellPath = /bin/sh;
444 | 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";
445 | showEnvVarsInLog = 0;
446 | };
447 | 30BB47669C1EEF8135F78D52 /* [CP] Check Pods Manifest.lock */ = {
448 | isa = PBXShellScriptBuildPhase;
449 | buildActionMask = 2147483647;
450 | files = (
451 | );
452 | inputPaths = (
453 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
454 | "${PODS_ROOT}/Manifest.lock",
455 | );
456 | name = "[CP] Check Pods Manifest.lock";
457 | outputPaths = (
458 | "$(DERIVED_FILE_DIR)/Pods-SDTheme_Tests-checkManifestLockResult.txt",
459 | );
460 | runOnlyForDeploymentPostprocessing = 0;
461 | shellPath = /bin/sh;
462 | 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";
463 | showEnvVarsInLog = 0;
464 | };
465 | D2366CC42BD18A475480A2A8 /* [CP] Embed Pods Frameworks */ = {
466 | isa = PBXShellScriptBuildPhase;
467 | buildActionMask = 2147483647;
468 | files = (
469 | );
470 | inputPaths = (
471 | "${SRCROOT}/Pods/Target Support Files/Pods-SDTheme_Example/Pods-SDTheme_Example-frameworks.sh",
472 | "${BUILT_PRODUCTS_DIR}/SDTheme/SDTheme.framework",
473 | );
474 | name = "[CP] Embed Pods Frameworks";
475 | outputPaths = (
476 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDTheme.framework",
477 | );
478 | runOnlyForDeploymentPostprocessing = 0;
479 | shellPath = /bin/sh;
480 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SDTheme_Example/Pods-SDTheme_Example-frameworks.sh\"\n";
481 | showEnvVarsInLog = 0;
482 | };
483 | /* End PBXShellScriptBuildPhase section */
484 |
485 | /* Begin PBXSourcesBuildPhase section */
486 | 2464029C20CFD2D600F80B7F /* Sources */ = {
487 | isa = PBXSourcesBuildPhase;
488 | buildActionMask = 2147483647;
489 | files = (
490 | );
491 | runOnlyForDeploymentPostprocessing = 0;
492 | };
493 | 246402A620CFD2E900F80B7F /* Sources */ = {
494 | isa = PBXSourcesBuildPhase;
495 | buildActionMask = 2147483647;
496 | files = (
497 | );
498 | runOnlyForDeploymentPostprocessing = 0;
499 | };
500 | 6003F586195388D20070C39A /* Sources */ = {
501 | isa = PBXSourcesBuildPhase;
502 | buildActionMask = 2147483647;
503 | files = (
504 | 6003F59E195388D20070C39A /* SDAppDelegate.m in Sources */,
505 | 6003F5A7195388D20070C39A /* SDViewController.m in Sources */,
506 | 6003F59A195388D20070C39A /* main.m in Sources */,
507 | );
508 | runOnlyForDeploymentPostprocessing = 0;
509 | };
510 | 6003F5AA195388D20070C39A /* Sources */ = {
511 | isa = PBXSourcesBuildPhase;
512 | buildActionMask = 2147483647;
513 | files = (
514 | 6003F5BC195388D20070C39A /* Tests.m in Sources */,
515 | );
516 | runOnlyForDeploymentPostprocessing = 0;
517 | };
518 | /* End PBXSourcesBuildPhase section */
519 |
520 | /* Begin PBXTargetDependency section */
521 | 245E044120D0FB610082DD3B /* PBXTargetDependency */ = {
522 | isa = PBXTargetDependency;
523 | target = 2464029F20CFD2D600F80B7F /* SDTheme-White */;
524 | targetProxy = 245E044020D0FB610082DD3B /* PBXContainerItemProxy */;
525 | };
526 | 245E044320D0FB610082DD3B /* PBXTargetDependency */ = {
527 | isa = PBXTargetDependency;
528 | target = 246402A920CFD2E900F80B7F /* SDTheme-Black */;
529 | targetProxy = 245E044220D0FB610082DD3B /* PBXContainerItemProxy */;
530 | };
531 | 6003F5B4195388D20070C39A /* PBXTargetDependency */ = {
532 | isa = PBXTargetDependency;
533 | target = 6003F589195388D20070C39A /* SDTheme_Example */;
534 | targetProxy = 6003F5B3195388D20070C39A /* PBXContainerItemProxy */;
535 | };
536 | /* End PBXTargetDependency section */
537 |
538 | /* Begin PBXVariantGroup section */
539 | 6003F596195388D20070C39A /* InfoPlist.strings */ = {
540 | isa = PBXVariantGroup;
541 | children = (
542 | 6003F597195388D20070C39A /* en */,
543 | );
544 | name = InfoPlist.strings;
545 | sourceTree = "";
546 | };
547 | 6003F5B8195388D20070C39A /* InfoPlist.strings */ = {
548 | isa = PBXVariantGroup;
549 | children = (
550 | 6003F5B9195388D20070C39A /* en */,
551 | );
552 | name = InfoPlist.strings;
553 | sourceTree = "";
554 | };
555 | 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */ = {
556 | isa = PBXVariantGroup;
557 | children = (
558 | 71719F9E1E33DC2100824A3D /* Base */,
559 | );
560 | name = LaunchScreen.storyboard;
561 | sourceTree = "";
562 | };
563 | /* End PBXVariantGroup section */
564 |
565 | /* Begin XCBuildConfiguration section */
566 | 246402A420CFD2D600F80B7F /* Debug */ = {
567 | isa = XCBuildConfiguration;
568 | buildSettings = {
569 | CLANG_ANALYZER_NONNULL = YES;
570 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
571 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
572 | CLANG_ENABLE_OBJC_WEAK = YES;
573 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
574 | CLANG_WARN_COMMA = YES;
575 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
576 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
577 | CLANG_WARN_INFINITE_RECURSION = YES;
578 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
579 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
580 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
581 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
582 | CLANG_WARN_STRICT_PROTOTYPES = YES;
583 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
584 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
585 | CLANG_WARN_UNREACHABLE_CODE = YES;
586 | CODE_SIGN_IDENTITY = "";
587 | CODE_SIGN_STYLE = Automatic;
588 | COMBINE_HIDPI_IMAGES = NO;
589 | COPY_PHASE_STRIP = YES;
590 | DEBUG_INFORMATION_FORMAT = dwarf;
591 | ENABLE_STRICT_OBJC_MSGSEND = YES;
592 | GCC_C_LANGUAGE_STANDARD = gnu11;
593 | GCC_NO_COMMON_BLOCKS = YES;
594 | INFOPLIST_FILE = "SDTheme-White/Info.plist";
595 | INSTALL_PATH = "";
596 | MACOSX_DEPLOYMENT_TARGET = 10.13;
597 | MTL_ENABLE_DEBUG_INFO = YES;
598 | PRODUCT_BUNDLE_IDENTIFIER = "com.SlashDevelopers.SDTheme-White";
599 | PRODUCT_NAME = "$(TARGET_NAME)";
600 | SDKROOT = iphoneos11.3;
601 | SKIP_INSTALL = NO;
602 | WRAPPER_EXTENSION = bundle;
603 | };
604 | name = Debug;
605 | };
606 | 246402A520CFD2D600F80B7F /* Release */ = {
607 | isa = XCBuildConfiguration;
608 | buildSettings = {
609 | CLANG_ANALYZER_NONNULL = YES;
610 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
611 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
612 | CLANG_ENABLE_OBJC_WEAK = YES;
613 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
614 | CLANG_WARN_COMMA = YES;
615 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
616 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
617 | CLANG_WARN_INFINITE_RECURSION = YES;
618 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
619 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
620 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
621 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
622 | CLANG_WARN_STRICT_PROTOTYPES = YES;
623 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
624 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
625 | CLANG_WARN_UNREACHABLE_CODE = YES;
626 | CODE_SIGN_IDENTITY = "";
627 | CODE_SIGN_STYLE = Automatic;
628 | COMBINE_HIDPI_IMAGES = NO;
629 | COPY_PHASE_STRIP = YES;
630 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
631 | ENABLE_STRICT_OBJC_MSGSEND = YES;
632 | GCC_C_LANGUAGE_STANDARD = gnu11;
633 | GCC_NO_COMMON_BLOCKS = YES;
634 | INFOPLIST_FILE = "SDTheme-White/Info.plist";
635 | INSTALL_PATH = "";
636 | MACOSX_DEPLOYMENT_TARGET = 10.13;
637 | MTL_ENABLE_DEBUG_INFO = NO;
638 | PRODUCT_BUNDLE_IDENTIFIER = "com.SlashDevelopers.SDTheme-White";
639 | PRODUCT_NAME = "$(TARGET_NAME)";
640 | SDKROOT = iphoneos11.3;
641 | SKIP_INSTALL = NO;
642 | WRAPPER_EXTENSION = bundle;
643 | };
644 | name = Release;
645 | };
646 | 246402AE20CFD2E900F80B7F /* Debug */ = {
647 | isa = XCBuildConfiguration;
648 | buildSettings = {
649 | CLANG_ANALYZER_NONNULL = YES;
650 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
651 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
652 | CLANG_ENABLE_OBJC_WEAK = YES;
653 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
654 | CLANG_WARN_COMMA = YES;
655 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
656 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
657 | CLANG_WARN_INFINITE_RECURSION = YES;
658 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
659 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
660 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
661 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
662 | CLANG_WARN_STRICT_PROTOTYPES = YES;
663 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
664 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
665 | CLANG_WARN_UNREACHABLE_CODE = YES;
666 | CODE_SIGN_IDENTITY = "";
667 | CODE_SIGN_STYLE = Automatic;
668 | COMBINE_HIDPI_IMAGES = NO;
669 | COPY_PHASE_STRIP = YES;
670 | DEBUG_INFORMATION_FORMAT = dwarf;
671 | ENABLE_STRICT_OBJC_MSGSEND = YES;
672 | GCC_C_LANGUAGE_STANDARD = gnu11;
673 | GCC_NO_COMMON_BLOCKS = YES;
674 | INFOPLIST_FILE = "SDTheme-Black/Info.plist";
675 | INSTALL_PATH = "";
676 | MACOSX_DEPLOYMENT_TARGET = 10.13;
677 | MTL_ENABLE_DEBUG_INFO = YES;
678 | PRODUCT_BUNDLE_IDENTIFIER = "com.SlashDevelopers.SDTheme-Black";
679 | PRODUCT_NAME = "$(TARGET_NAME)";
680 | SDKROOT = iphoneos11.3;
681 | SKIP_INSTALL = NO;
682 | WRAPPER_EXTENSION = bundle;
683 | };
684 | name = Debug;
685 | };
686 | 246402AF20CFD2E900F80B7F /* Release */ = {
687 | isa = XCBuildConfiguration;
688 | buildSettings = {
689 | CLANG_ANALYZER_NONNULL = YES;
690 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
691 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
692 | CLANG_ENABLE_OBJC_WEAK = YES;
693 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
694 | CLANG_WARN_COMMA = YES;
695 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
696 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
697 | CLANG_WARN_INFINITE_RECURSION = YES;
698 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
699 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
700 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
701 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
702 | CLANG_WARN_STRICT_PROTOTYPES = YES;
703 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
704 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
705 | CLANG_WARN_UNREACHABLE_CODE = YES;
706 | CODE_SIGN_IDENTITY = "";
707 | CODE_SIGN_STYLE = Automatic;
708 | COMBINE_HIDPI_IMAGES = NO;
709 | COPY_PHASE_STRIP = YES;
710 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
711 | ENABLE_STRICT_OBJC_MSGSEND = YES;
712 | GCC_C_LANGUAGE_STANDARD = gnu11;
713 | GCC_NO_COMMON_BLOCKS = YES;
714 | INFOPLIST_FILE = "SDTheme-Black/Info.plist";
715 | INSTALL_PATH = "";
716 | MACOSX_DEPLOYMENT_TARGET = 10.13;
717 | MTL_ENABLE_DEBUG_INFO = NO;
718 | PRODUCT_BUNDLE_IDENTIFIER = "com.SlashDevelopers.SDTheme-Black";
719 | PRODUCT_NAME = "$(TARGET_NAME)";
720 | SDKROOT = iphoneos11.3;
721 | SKIP_INSTALL = NO;
722 | WRAPPER_EXTENSION = bundle;
723 | };
724 | name = Release;
725 | };
726 | 6003F5BD195388D20070C39A /* Debug */ = {
727 | isa = XCBuildConfiguration;
728 | buildSettings = {
729 | ALWAYS_SEARCH_USER_PATHS = NO;
730 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
731 | CLANG_CXX_LIBRARY = "libc++";
732 | CLANG_ENABLE_MODULES = YES;
733 | CLANG_ENABLE_OBJC_ARC = YES;
734 | CLANG_WARN_BOOL_CONVERSION = YES;
735 | CLANG_WARN_CONSTANT_CONVERSION = YES;
736 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
737 | CLANG_WARN_EMPTY_BODY = YES;
738 | CLANG_WARN_ENUM_CONVERSION = YES;
739 | CLANG_WARN_INT_CONVERSION = YES;
740 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
741 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
742 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
743 | COPY_PHASE_STRIP = NO;
744 | ENABLE_TESTABILITY = YES;
745 | GCC_C_LANGUAGE_STANDARD = gnu99;
746 | GCC_DYNAMIC_NO_PIC = NO;
747 | GCC_OPTIMIZATION_LEVEL = 0;
748 | GCC_PREPROCESSOR_DEFINITIONS = (
749 | "DEBUG=1",
750 | "$(inherited)",
751 | );
752 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
753 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
754 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
755 | GCC_WARN_UNDECLARED_SELECTOR = YES;
756 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
757 | GCC_WARN_UNUSED_FUNCTION = YES;
758 | GCC_WARN_UNUSED_VARIABLE = YES;
759 | IPHONEOS_DEPLOYMENT_TARGET = 9.3;
760 | ONLY_ACTIVE_ARCH = YES;
761 | SDKROOT = iphoneos;
762 | TARGETED_DEVICE_FAMILY = "1,2";
763 | };
764 | name = Debug;
765 | };
766 | 6003F5BE195388D20070C39A /* Release */ = {
767 | isa = XCBuildConfiguration;
768 | buildSettings = {
769 | ALWAYS_SEARCH_USER_PATHS = NO;
770 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
771 | CLANG_CXX_LIBRARY = "libc++";
772 | CLANG_ENABLE_MODULES = YES;
773 | CLANG_ENABLE_OBJC_ARC = YES;
774 | CLANG_WARN_BOOL_CONVERSION = YES;
775 | CLANG_WARN_CONSTANT_CONVERSION = YES;
776 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
777 | CLANG_WARN_EMPTY_BODY = YES;
778 | CLANG_WARN_ENUM_CONVERSION = YES;
779 | CLANG_WARN_INT_CONVERSION = YES;
780 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
781 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
782 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
783 | COPY_PHASE_STRIP = YES;
784 | ENABLE_NS_ASSERTIONS = NO;
785 | GCC_C_LANGUAGE_STANDARD = gnu99;
786 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
787 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
788 | GCC_WARN_UNDECLARED_SELECTOR = YES;
789 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
790 | GCC_WARN_UNUSED_FUNCTION = YES;
791 | GCC_WARN_UNUSED_VARIABLE = YES;
792 | IPHONEOS_DEPLOYMENT_TARGET = 9.3;
793 | SDKROOT = iphoneos;
794 | TARGETED_DEVICE_FAMILY = "1,2";
795 | VALIDATE_PRODUCT = YES;
796 | };
797 | name = Release;
798 | };
799 | 6003F5C0195388D20070C39A /* Debug */ = {
800 | isa = XCBuildConfiguration;
801 | baseConfigurationReference = 0F531DA3ABDFC32CDA66AB4D /* Pods-SDTheme_Example.debug.xcconfig */;
802 | buildSettings = {
803 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
804 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
805 | GCC_PREFIX_HEADER = "SDTheme/SDTheme-Prefix.pch";
806 | INFOPLIST_FILE = "SDTheme/SDTheme-Info.plist";
807 | MODULE_NAME = ExampleApp;
808 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}";
809 | PRODUCT_NAME = "$(TARGET_NAME)";
810 | WRAPPER_EXTENSION = app;
811 | };
812 | name = Debug;
813 | };
814 | 6003F5C1195388D20070C39A /* Release */ = {
815 | isa = XCBuildConfiguration;
816 | baseConfigurationReference = 2754F4E9BEF03BAC578A38E4 /* Pods-SDTheme_Example.release.xcconfig */;
817 | buildSettings = {
818 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
819 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
820 | GCC_PREFIX_HEADER = "SDTheme/SDTheme-Prefix.pch";
821 | INFOPLIST_FILE = "SDTheme/SDTheme-Info.plist";
822 | MODULE_NAME = ExampleApp;
823 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}";
824 | PRODUCT_NAME = "$(TARGET_NAME)";
825 | WRAPPER_EXTENSION = app;
826 | };
827 | name = Release;
828 | };
829 | 6003F5C3195388D20070C39A /* Debug */ = {
830 | isa = XCBuildConfiguration;
831 | baseConfigurationReference = E09FA306F04D787EAA55EB78 /* Pods-SDTheme_Tests.debug.xcconfig */;
832 | buildSettings = {
833 | BUNDLE_LOADER = "$(TEST_HOST)";
834 | FRAMEWORK_SEARCH_PATHS = (
835 | "$(SDKROOT)/Developer/Library/Frameworks",
836 | "$(inherited)",
837 | "$(DEVELOPER_FRAMEWORKS_DIR)",
838 | );
839 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
840 | GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch";
841 | GCC_PREPROCESSOR_DEFINITIONS = (
842 | "DEBUG=1",
843 | "$(inherited)",
844 | );
845 | INFOPLIST_FILE = "Tests/Tests-Info.plist";
846 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}";
847 | PRODUCT_NAME = "$(TARGET_NAME)";
848 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SDTheme_Example.app/SDTheme_Example";
849 | WRAPPER_EXTENSION = xctest;
850 | };
851 | name = Debug;
852 | };
853 | 6003F5C4195388D20070C39A /* Release */ = {
854 | isa = XCBuildConfiguration;
855 | baseConfigurationReference = D0C9DA14FA9EFA3479B4EE17 /* Pods-SDTheme_Tests.release.xcconfig */;
856 | buildSettings = {
857 | BUNDLE_LOADER = "$(TEST_HOST)";
858 | FRAMEWORK_SEARCH_PATHS = (
859 | "$(SDKROOT)/Developer/Library/Frameworks",
860 | "$(inherited)",
861 | "$(DEVELOPER_FRAMEWORKS_DIR)",
862 | );
863 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
864 | GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch";
865 | INFOPLIST_FILE = "Tests/Tests-Info.plist";
866 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}";
867 | PRODUCT_NAME = "$(TARGET_NAME)";
868 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SDTheme_Example.app/SDTheme_Example";
869 | WRAPPER_EXTENSION = xctest;
870 | };
871 | name = Release;
872 | };
873 | /* End XCBuildConfiguration section */
874 |
875 | /* Begin XCConfigurationList section */
876 | 246402A320CFD2D600F80B7F /* Build configuration list for PBXNativeTarget "SDTheme-White" */ = {
877 | isa = XCConfigurationList;
878 | buildConfigurations = (
879 | 246402A420CFD2D600F80B7F /* Debug */,
880 | 246402A520CFD2D600F80B7F /* Release */,
881 | );
882 | defaultConfigurationIsVisible = 0;
883 | defaultConfigurationName = Release;
884 | };
885 | 246402AD20CFD2E900F80B7F /* Build configuration list for PBXNativeTarget "SDTheme-Black" */ = {
886 | isa = XCConfigurationList;
887 | buildConfigurations = (
888 | 246402AE20CFD2E900F80B7F /* Debug */,
889 | 246402AF20CFD2E900F80B7F /* Release */,
890 | );
891 | defaultConfigurationIsVisible = 0;
892 | defaultConfigurationName = Release;
893 | };
894 | 6003F585195388D10070C39A /* Build configuration list for PBXProject "SDTheme" */ = {
895 | isa = XCConfigurationList;
896 | buildConfigurations = (
897 | 6003F5BD195388D20070C39A /* Debug */,
898 | 6003F5BE195388D20070C39A /* Release */,
899 | );
900 | defaultConfigurationIsVisible = 0;
901 | defaultConfigurationName = Release;
902 | };
903 | 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "SDTheme_Example" */ = {
904 | isa = XCConfigurationList;
905 | buildConfigurations = (
906 | 6003F5C0195388D20070C39A /* Debug */,
907 | 6003F5C1195388D20070C39A /* Release */,
908 | );
909 | defaultConfigurationIsVisible = 0;
910 | defaultConfigurationName = Release;
911 | };
912 | 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "SDTheme_Tests" */ = {
913 | isa = XCConfigurationList;
914 | buildConfigurations = (
915 | 6003F5C3195388D20070C39A /* Debug */,
916 | 6003F5C4195388D20070C39A /* Release */,
917 | );
918 | defaultConfigurationIsVisible = 0;
919 | defaultConfigurationName = Release;
920 | };
921 | /* End XCConfigurationList section */
922 | };
923 | rootObject = 6003F582195388D10070C39A /* Project object */;
924 | }
925 |
--------------------------------------------------------------------------------
/Example/SDTheme.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Example/SDTheme.xcodeproj/xcshareddata/xcschemes/SDTheme-Example.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
42 |
43 |
49 |
50 |
51 |
52 |
53 |
54 |
64 |
66 |
72 |
73 |
74 |
75 |
76 |
77 |
83 |
85 |
91 |
92 |
93 |
94 |
96 |
97 |
100 |
101 |
102 |
--------------------------------------------------------------------------------
/Example/SDTheme.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Example/SDTheme.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Example/SDTheme/Base.lproj/LaunchScreen.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 |
--------------------------------------------------------------------------------
/Example/SDTheme/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 |
37 |
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 |
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 |
--------------------------------------------------------------------------------
/Example/SDTheme/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" : "ipad",
45 | "size" : "20x20",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "20x20",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "29x29",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "29x29",
61 | "scale" : "2x"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "size" : "40x40",
66 | "scale" : "1x"
67 | },
68 | {
69 | "idiom" : "ipad",
70 | "size" : "40x40",
71 | "scale" : "2x"
72 | },
73 | {
74 | "idiom" : "ipad",
75 | "size" : "76x76",
76 | "scale" : "1x"
77 | },
78 | {
79 | "idiom" : "ipad",
80 | "size" : "76x76",
81 | "scale" : "2x"
82 | },
83 | {
84 | "idiom" : "ipad",
85 | "size" : "83.5x83.5",
86 | "scale" : "2x"
87 | },
88 | {
89 | "idiom" : "ios-marketing",
90 | "size" : "1024x1024",
91 | "scale" : "1x"
92 | }
93 | ],
94 | "info" : {
95 | "version" : 1,
96 | "author" : "xcode"
97 | }
98 | }
99 |
--------------------------------------------------------------------------------
/Example/SDTheme/SDAppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // SDAppDelegate.h
3 | // SDTheme
4 | //
5 | // Created by SlashDevelopers on 2018/06/07.
6 | // Copyright (c) 2018 SlashDevelopers. All rights reserved.
7 | //
8 |
9 | @import UIKit;
10 |
11 | @interface SDAppDelegate : UIResponder
12 |
13 | @property (strong, nonatomic) UIWindow *window;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/Example/SDTheme/SDAppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // SDAppDelegate.m
3 | // SDTheme
4 | //
5 | // Created by SlashDevelopers on 2018/06/07.
6 | // Copyright (c) 2018 SlashDevelopers. All rights reserved.
7 | //
8 |
9 | #import "SDAppDelegate.h"
10 | #import
11 |
12 | @implementation SDAppDelegate
13 |
14 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
15 | // Override point for customization after application launch.
16 | [[SDThemeManager sharedInstance] setupThemeNameArray:@[@"SDTheme-White", @"SDTheme-Black"]];
17 | [[SDThemeManager sharedInstance] changeTheme:@"SDTheme-Black"];
18 | [[UIApplication sharedApplication] theme_setStatusBarColor:@"status_bar_default" animated:YES];
19 | return YES;
20 | }
21 |
22 | - (void)applicationWillResignActive:(UIApplication *)application {
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 | - (void)applicationDidEnterBackground:(UIApplication *)application {
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 | - (void)applicationWillEnterForeground:(UIApplication *)application {
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 | - (void)applicationDidBecomeActive:(UIApplication *)application {
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 | - (void)applicationWillTerminate:(UIApplication *)application {
41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
42 | }
43 |
44 | @end
45 |
--------------------------------------------------------------------------------
/Example/SDTheme/SDTheme-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | ${PRODUCT_NAME}
9 | CFBundleExecutable
10 | ${EXECUTABLE_NAME}
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | ${PRODUCT_NAME}
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1.0
25 | LSRequiresIPhoneOS
26 |
27 | UILaunchStoryboardName
28 | LaunchScreen
29 | UIMainStoryboardFile
30 | Main
31 | UIRequiredDeviceCapabilities
32 |
33 | armv7
34 |
35 | UISupportedInterfaceOrientations
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationLandscapeLeft
39 | UIInterfaceOrientationLandscapeRight
40 |
41 | UIViewControllerBasedStatusBarAppearance
42 |
43 | UISupportedInterfaceOrientations~ipad
44 |
45 | UIInterfaceOrientationPortrait
46 | UIInterfaceOrientationPortraitUpsideDown
47 | UIInterfaceOrientationLandscapeLeft
48 | UIInterfaceOrientationLandscapeRight
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/Example/SDTheme/SDTheme-Prefix.pch:
--------------------------------------------------------------------------------
1 | //
2 | // Prefix header
3 | //
4 | // The contents of this file are implicitly included at the beginning of every source file.
5 | //
6 |
7 | #import
8 |
9 | #ifndef __IPHONE_5_0
10 | #warning "This project uses features only available in iOS SDK 5.0 and later."
11 | #endif
12 |
13 | #ifdef __OBJC__
14 | @import UIKit;
15 | @import Foundation;
16 | #endif
17 |
--------------------------------------------------------------------------------
/Example/SDTheme/SDViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // SDViewController.h
3 | // SDTheme
4 | //
5 | // Created by SlashDevelopers on 2018/06/07.
6 | // Copyright (c) 2018 SlashDevelopers. All rights reserved.
7 | //
8 |
9 | @import UIKit;
10 |
11 | @interface SDViewController : UIViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Example/SDTheme/SDViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // SDViewController.m
3 | // SDTheme
4 | //
5 | // Created by SlashDevelopers on 2018/06/07.
6 | // Copyright (c) 2018 SlashDevelopers. All rights reserved.
7 | //
8 |
9 | #import "SDViewController.h"
10 | #import
11 |
12 | @interface SDViewController ()
13 |
14 | @property (weak, nonatomic) IBOutlet UIActivityIndicatorView *indicatorView;
15 | @property (weak, nonatomic) IBOutlet UIPageControl *pageControl;
16 | @property (weak, nonatomic) IBOutlet UISwitch *switchControl;
17 | @property (weak, nonatomic) IBOutlet UITextField *textField;
18 | @property (weak, nonatomic) IBOutlet UIButton *whiteButton;
19 | @property (weak, nonatomic) IBOutlet UIButton *blackButton;
20 |
21 | @end
22 |
23 | @implementation SDViewController
24 |
25 | - (void)viewDidLoad {
26 | [super viewDidLoad];
27 | self.indicatorView.theme_color = @"block_activity_indicator";
28 | self.pageControl.theme_pageIndicatorTintColor = @"block_pageControl_normal";
29 | self.pageControl.theme_currentPageIndicatorTintColor = @"block_pageControl_current";
30 | self.textField.theme_textColor = @"text_h1";
31 | self.textField.theme_attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"最多5个汉字/10个字符" attributes:@{SDThemeForegroundColorAttributeName: @"text_placeholder" }];
32 | [self.whiteButton theme_setTitleColor:@"text_h1" forState:UIControlStateNormal];
33 | [self.blackButton theme_setTitleColor:@"text_h1" forState:UIControlStateNormal];
34 | [self.whiteButton theme_setBackgroundColor:@"block_orange" forState:UIControlStateNormal];
35 | [self.blackButton theme_setBackgroundColor:@"block_orange" forState:UIControlStateNormal];
36 | self.switchControl.theme_onTintColor = @"block_orange";
37 | self.switchControl.theme_thumbTintColor = @"block_tab_bg";
38 | }
39 |
40 | - (IBAction)buttonClicked:(UIButton *)sender {
41 | NSArray *themeArray = @[@"SDTheme-White", @"SDTheme-Black"];
42 | NSString *themeName = themeArray[sender.tag-100];
43 | [[SDThemeManager sharedInstance] changeTheme:themeName];
44 | }
45 |
46 |
47 | @end
48 |
--------------------------------------------------------------------------------
/Example/SDTheme/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/Example/SDTheme/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // SDTheme
4 | //
5 | // Created by SlashDevelopers on 2018/06/07.
6 | // Copyright (c) 2018 SlashDevelopers. All rights reserved.
7 | //
8 |
9 | @import UIKit;
10 | #import "SDAppDelegate.h"
11 |
12 | int main(int argc, char * argv[])
13 | {
14 | @autoreleasepool {
15 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([SDAppDelegate class]));
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Example/Tests/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 | CFBundlePackageType
14 | BNDL
15 | CFBundleShortVersionString
16 | 1.0
17 | CFBundleSignature
18 | ????
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Example/Tests/Tests-Prefix.pch:
--------------------------------------------------------------------------------
1 | // The contents of this file are implicitly included at the beginning of every test case source file.
2 |
3 | #ifdef __OBJC__
4 |
5 |
6 |
7 | #endif
8 |
--------------------------------------------------------------------------------
/Example/Tests/Tests.m:
--------------------------------------------------------------------------------
1 | //
2 | // SDThemeTests.m
3 | // SDThemeTests
4 | //
5 | // Created by SlashDevelopers on 2018/06/07.
6 | // Copyright (c) 2018 SlashDevelopers. All rights reserved.
7 | //
8 |
9 | @import XCTest;
10 |
11 | @interface Tests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation Tests
16 |
17 | - (void)setUp {
18 | [super setUp];
19 | // Put setup code here. This method is called before the invocation of each test method in the class.
20 | }
21 |
22 | - (void)tearDown {
23 | // Put teardown code here. This method is called after the invocation of each test method in the class.
24 | [super tearDown];
25 | }
26 |
27 | - (void)testExample {
28 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__);
29 | }
30 |
31 | @end
32 |
33 |
--------------------------------------------------------------------------------
/Example/Tests/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # SDTheme
2 |
3 | [](https://travis-ci.org/SlashDevelopers/SDTheme)
4 | 
5 | 
6 | 
7 | 
8 | [](https://codebeat.co/projects/github-com-slashdevelopers-sdtheme-master)
9 | 
10 |
11 | ## 效果图
12 | 
13 |
14 | Demo做的有点丑,大家多忍耐一下😅
15 |
16 | ## 使用方法非常简单:
17 | ### 初始化:
18 | ```
19 | [[SDThemeManager sharedInstance] setupThemeNameArray:@[@"SDTheme-White", @"SDTheme-Black"]];
20 | ```
21 | `SDTheme-White`和`SDTheme-Black`是资源主题Bundle的名称,下面会说到资源Bundle的引入方法。
22 | ### 切换主题:
23 | ```
24 | [[SDThemeManager sharedInstance] changeTheme:@"SDTheme-Black"];
25 | ```
26 | ### 具体设置皮肤:
27 |
28 | 具体调用非常简单,比如需要换肤的视图控件原本是调用`backgroundColor`设置颜色,只需要换成调用扩展方法`theme_backgroundColor`即可,例如:
29 | ```
30 | self.view.theme_backgroundColor = @"block_bg";
31 | self.textField.theme_textColor = @"text_h1";
32 | self.image.theme_image = @"icon_face";
33 | ```
34 | 富文本需要用`SDThemeForegroundColorAttributeName`替换`NSForegroundColorAttributeName`,例如:
35 | ```
36 | navBar.theme_titleTextAttributes = @{SDThemeForegroundColorAttributeName:@"text_h1"};
37 | ```
38 |
39 | 另外有些常用的属性在XIB等可视化视图也可以直接设置,例如:
40 | 
41 |
42 |
43 | 如果直接设置属性的方式不满足需求,还可以自己监听通知`SDThemeChangedNotification`,收到通知之后自行做颜色图标等切换。
44 |
45 | ## 资源管理
46 | 颜色字符串和图片是放在单独的Bundle里面进行管理的,所以刚开始要新建自己的主题Bundle.
47 | Bundle中 新建`ColorsMap.plist`和`Images.xcassets`
48 | * 图片:就放在相应的主题bundle中的Images.xcassets管理,图片在不同主题下名字要保证一致。
49 | * 颜色字符串:颜色字符串可以参考一下Demo中的文件,首先要有一个大分类,例如Demo中的`block、text、line`(跟随自己需要分类就好,这里的分类我是扒竞品`富途牛牛`的🤠),如果你有一个分类叫`SomeThing`,那分类下内容命名要带上相应的前缀`SomeThing_`,不然会报找不到,`color string`是HEX 或者AHEX格式。
50 |
51 |
52 | ## Bundle 创建注意事项:
53 |
54 | 资源bundle**不要**直接新建文件夹之后改扩展名或者用Settings Bundle
55 | 
56 |
57 | ### 推荐Bundle创建方式:
58 | 
59 | `file`->`New`->`Target`->`macOS`->`Bundle`
60 |
61 | 创建完成之后,对
62 | Base SDK 设置为 iOS
63 | Build Active Architecture Only 设置为 "YES"
64 | Installation Directory 删除掉后面的路径
65 | Code Signing Identity 选择 Don't Code Sign
66 | iOS Deployment Target 设置为 合适的版本
67 | Skip Install 设置为 "NO"
68 | Strip Debug Symbols During Copy 设置为 "YES"
69 | COMBINE_HIDPI_IMAGES 设置为 "NO"
70 | 再设置一下依赖
71 | 
72 | 好,到现在Bundle就完成了
73 |
74 | ## 主要实现原理:
75 | 其实实现原理也是非常简单的,我这里拿`UIView`举例子:
76 |
77 | ```
78 | @interface UIView (SDTheme)
79 |
80 | @property (nonatomic, copy) NSString *theme_backgroundColor;
81 | @property (nonatomic, copy) IBInspectable NSString *sd_background;
82 | @property (nonatomic, copy) NSString *theme_tintColor;
83 |
84 | @en
85 | ```
86 |
87 | 这是针对UIView提供的扩展,大家可以看到其中有换肤属性`theme_backgroundColor `,如下图,我们在属性`theme_backgroundColor `的`Setter`方法中有根据主题配置调用系统的相应方法,然后对控件注册监听,等切换主题之后就会收到通知,然后执行`theme_didChanged`方法,为控件设置正确的主题UI,That’s all~
88 | 
89 |
90 | ## Mac工具
91 | 另外同事写了[一个Mac小工具](https://github.com/SlashDevelopers/HSThemeColorMap/releases/download/v1.0.0/HSThemeColorMap.zip)也顺便分享一下,找一些颜色的时候会提高一些效率。
92 | 
93 |
94 | 使用的时候只要把对应的ColorMaps拖进框即可,可能第一次需要输入密码,是因为对文件执行了一个`chmod 777`的命令,目前只支持两个,[代码在这里](https://github.com/SlashDevelopers/HSThemeColorMap),有大佬有兴趣的欢迎扩展,欢迎RP。
95 | * 双击Cell 可以快速拿到对应颜色的key到剪贴板,直接`Ctrl+V`到项目代码中即可。
96 | * 在菜单栏-Eidt->Add Color 可以快捷添加颜色
97 |
98 | [成品可以在这里直接下载到](https://github.com/SlashDevelopers/HSThemeColorMap/releases/download/v1.0.0/HSThemeColorMap.zip)
99 |
100 | ---
101 |
102 | ⭐⭐⭐如果觉得本仓库对您有帮助,请不要吝啬你的Star⭐。您的支持将鼓励我们继续创作!⭐⭐⭐
103 |
104 |
105 |
106 |
--------------------------------------------------------------------------------
/SDTheme.podspec:
--------------------------------------------------------------------------------
1 | #
2 | # Be sure to run `pod lib lint SDTheme.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 = 'SDTheme'
11 | s.version = '0.1.0'
12 | s.summary = 'A lightweight skin switching solution.'
13 |
14 | s.description = <<-DESC
15 | TODO: Add long description of the pod here.
16 | DESC
17 |
18 | s.homepage = 'https://github.com/SlashDevelopers/SDTheme'
19 | s.license = { :type => 'MIT', :file => 'LICENSE' }
20 | s.author = { 'maligh' => '455080311@qq.com' , 'culeo' => '1823280359@qq.com'}
21 | s.source = { :git => 'https://github.com/SlashDevelopers/SDTheme.git', :tag => s.version.to_s }
22 | s.ios.deployment_target = '8.0'
23 | s.source_files = 'SDTheme/Classes/SDTheme.h'
24 | s.public_header_files = 'SDTheme/Classes/SDTheme.h'
25 |
26 | s.subspec 'Core' do |ss|
27 | ss.source_files = 'SDTheme/Classes/Core/*.{m,h}'
28 | ss.public_header_files = 'SDTheme/Classes/Core/*.h'
29 | end
30 | s.subspec 'UIKit' do |ss|
31 | ss.source_files = 'SDTheme/Classes/UIKit/*.{m,h}'
32 | ss.public_header_files = 'SDTheme/Classes/UIKit/*.h'
33 | ss.dependency 'SDTheme/Core'
34 | end
35 |
36 |
37 | end
38 |
--------------------------------------------------------------------------------
/SDTheme/Assets/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlashDevelopers/SDTheme/7e43d5ed0a165a19831908509f25d9bf7afbbd45/SDTheme/Assets/.gitkeep
--------------------------------------------------------------------------------
/SDTheme/Classes/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlashDevelopers/SDTheme/7e43d5ed0a165a19831908509f25d9bf7afbbd45/SDTheme/Classes/.gitkeep
--------------------------------------------------------------------------------
/SDTheme/Classes/Core/NSAttributedString+SDTheme.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSAttributedString+SDTheme.h
3 | // SDTheme
4 | //
5 | // Created by SlashDevelopers on 2018/06/07.
6 | // Copyright (c) 2018 SlashDevelopers. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | FOUNDATION_EXPORT NSAttributedStringKey const SDThemeForegroundColorAttributeName;
12 |
13 | @interface NSAttributedString (SDTheme)
14 |
15 | /// 取得真实颜色值
16 | - (NSAttributedString *)theme_replaceRealityColor;
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/SDTheme/Classes/Core/NSAttributedString+SDTheme.m:
--------------------------------------------------------------------------------
1 | //
2 | // NSAttributedString+SDTheme.m
3 | // SDTheme
4 | //
5 | // Created by SlashDevelopers on 2018/06/07.
6 | // Copyright (c) 2018 SlashDevelopers. All rights reserved.
7 | //
8 |
9 | #import "NSAttributedString+SDTheme.h"
10 | #import "SDThemeManager.h"
11 |
12 | NSAttributedStringKey const SDThemeForegroundColorAttributeName = @"SDThemeForegroundColorAttributeName";
13 |
14 | @implementation NSAttributedString (SDTheme)
15 |
16 | - (NSAttributedString *)theme_replaceRealityColor {
17 | NSMutableAttributedString *tmpAttributedText = [self mutableCopy];
18 | [self enumerateAttributesInRange:NSMakeRange(0, self.length) options:NSAttributedStringEnumerationLongestEffectiveRangeNotRequired usingBlock:^(NSDictionary * _Nonnull attrs, NSRange range, BOOL * _Nonnull stop) {
19 | if (!attrs[SDThemeForegroundColorAttributeName]) {
20 | return;
21 | }
22 | NSMutableDictionary *tmpAttrs = [attrs mutableCopy];
23 | tmpAttrs[NSForegroundColorAttributeName] = [SDThemeManager colorWithID:attrs[SDThemeForegroundColorAttributeName]];
24 | [tmpAttributedText setAttributes:tmpAttrs range:range];
25 | }];
26 | return tmpAttributedText;
27 | }
28 |
29 | @end
30 |
--------------------------------------------------------------------------------
/SDTheme/Classes/Core/NSDictionary+SDTheme.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSDictionary+SDTheme.h
3 | // SDTheme
4 | //
5 | // Created by SlashDevelopers on 2018/5/8.
6 | //
7 |
8 | #import
9 |
10 | @interface NSDictionary (SDTheme)
11 |
12 | - (NSDictionary *)theme_replaceTitleTextAttributes;
13 |
14 | @end
15 |
--------------------------------------------------------------------------------
/SDTheme/Classes/Core/NSDictionary+SDTheme.m:
--------------------------------------------------------------------------------
1 | //
2 | // NSDictionary+SDTheme.m
3 | // SDTheme
4 | //
5 | // Created by SlashDevelopers on 2018/5/8.
6 | //
7 |
8 | #import "NSDictionary+SDTheme.h"
9 | #import "NSAttributedString+SDTheme.h"
10 | #import "SDThemeManager.h"
11 |
12 | @implementation NSDictionary (SDTheme)
13 |
14 | - (NSDictionary *)theme_replaceTitleTextAttributes {
15 | if (!self[SDThemeForegroundColorAttributeName]) {
16 | return self;
17 | }
18 | NSMutableDictionary *tmpAttributes = [self mutableCopy];
19 | tmpAttributes[NSForegroundColorAttributeName] = [SDThemeManager colorWithID:self[SDThemeForegroundColorAttributeName]];
20 | return [tmpAttributes copy];
21 | }
22 |
23 | @end
24 |
25 |
--------------------------------------------------------------------------------
/SDTheme/Classes/Core/NSObject+SDDeallocBlock.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSObject+SDDeallocBlock.h
3 | // SDTheme
4 | //
5 | // Created by SlashDevelopers on 2018/06/07.
6 | // Copyright (c) 2018 SlashDevelopers. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface NSObject (SDDeallocBlock)
12 |
13 | - (void)sd_executeAtDealloc:(void (^)(void))block;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/SDTheme/Classes/Core/NSObject+SDDeallocBlock.m:
--------------------------------------------------------------------------------
1 | //
2 | // NSObject+SDDeallocBlock.m
3 | // SDTheme
4 | //
5 | // Created by SlashDevelopers on 2018/06/07.
6 | // Copyright (c) 2018 SlashDevelopers. All rights reserved.
7 | //
8 |
9 | #import "NSObject+SDDeallocBlock.h"
10 | #import
11 |
12 | const void *SDDeallocExecutorsKey = &SDDeallocExecutorsKey;
13 |
14 | @interface SDDeallocExecutor : NSObject
15 |
16 | @property (nonatomic, copy) void(^deallocExecutorBlock)(void);
17 |
18 | @end
19 |
20 | @implementation SDDeallocExecutor
21 |
22 | - (id)initWithBlock:(void(^)(void))deallocExecutorBlock {
23 | self = [super init];
24 | if (self) {
25 | _deallocExecutorBlock = [deallocExecutorBlock copy];
26 | }
27 | return self;
28 | }
29 |
30 | - (void)dealloc {
31 | _deallocExecutorBlock ? _deallocExecutorBlock() : nil;
32 | }
33 |
34 | @end
35 |
36 |
37 | @implementation NSObject (SDDeallocBlock)
38 |
39 | - (void)sd_executeAtDealloc:(void (^)(void))block {
40 | if (block) {
41 | SDDeallocExecutor *executor = [[SDDeallocExecutor alloc] initWithBlock:block];
42 | @synchronized (self) {
43 | [[self hs_deallocExecutors] addObject:executor];
44 | }
45 | }
46 | }
47 |
48 | - (NSHashTable *)hs_deallocExecutors {
49 | NSHashTable *table = objc_getAssociatedObject(self,SDDeallocExecutorsKey);
50 | if (!table) {
51 | table = [NSHashTable hashTableWithOptions:NSPointerFunctionsStrongMemory];
52 | objc_setAssociatedObject(self, SDDeallocExecutorsKey, table, OBJC_ASSOCIATION_RETAIN);
53 | }
54 | return table;
55 | }
56 |
57 | @end
58 |
--------------------------------------------------------------------------------
/SDTheme/Classes/Core/NSObject+SDTheme.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSObject+SDTheme.h
3 | // SDTheme
4 | //
5 | // Created by SlashDevelopers on 2018/06/07.
6 | // Copyright (c) 2018 SlashDevelopers. All rights reserved
7 | //
8 |
9 | #import
10 |
11 | @interface NSObject (SDTheme)
12 |
13 | /**
14 | * 注册换肤监听,不会重复监听。
15 | * 收到通知后会调用 theme_didChanged 方法。
16 | */
17 | - (void)theme_registChangedNotification;
18 |
19 | /**
20 | * 注册换肤监听,不会重复监听。
21 | * 会立即调用一次 themeChangeBlock,和收到通知后调用
22 | */
23 | - (void)theme_observerChangedUsingBlock:(void(^)(id observer))themeChangeBlock;
24 |
25 | /**
26 | * 子类重写,收到换肤通知会调用本方法
27 | */
28 | - (void)theme_didChanged;
29 |
30 | @end
31 |
--------------------------------------------------------------------------------
/SDTheme/Classes/Core/NSObject+SDTheme.m:
--------------------------------------------------------------------------------
1 | //
2 | // NSObject+SDTheme.m
3 | // SDTheme
4 | //
5 | // Created by SlashDevelopers on 2018/06/07.
6 | // Copyright (c) 2018 SlashDevelopers. All rights reserved
7 | //
8 |
9 | #import "NSObject+SDTheme.h"
10 | #import "NSObject+SDDeallocBlock.h"
11 | #import "SDThemeManager.h"
12 | #import
13 |
14 | static NSString *const kHasRegistChangedThemeNotification;
15 |
16 | @interface NSObject ()
17 |
18 | @property (nonatomic, copy) void(^theme_changeBlock)(id observer);
19 |
20 | @end
21 |
22 | @implementation NSObject (SDTheme)
23 |
24 | - (void)theme_registChangedNotification {
25 | NSNumber *hasRegist = objc_getAssociatedObject(self, &kHasRegistChangedThemeNotification);
26 | if (hasRegist) {
27 | return;
28 | }
29 | objc_setAssociatedObject(self, &kHasRegistChangedThemeNotification, @(YES), OBJC_ASSOCIATION_COPY_NONATOMIC);
30 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(theme_didChanged) name:SDThemeChangedNotification object:nil];
31 | __weak typeof(self) weakSelf = self;
32 | [self sd_executeAtDealloc:^{
33 | [[NSNotificationCenter defaultCenter] removeObserver:weakSelf];
34 | }];
35 | }
36 |
37 | - (void)theme_observerChangedUsingBlock:(void(^)(id observer))themeChangeBlock {
38 | self.theme_changeBlock = themeChangeBlock;
39 | [self theme_didChanged];
40 | [self theme_registChangedNotification];
41 | }
42 |
43 | - (void)theme_didChanged {
44 | if (self.theme_changeBlock) {
45 | __weak typeof(self) weakSelf = self;
46 | self.theme_changeBlock(weakSelf);
47 | }
48 | }
49 |
50 | - (void)setTheme_changeBlock:(void (^)(void))block {
51 | objc_setAssociatedObject(self, @selector(theme_changeBlock), block, OBJC_ASSOCIATION_COPY_NONATOMIC);
52 | }
53 |
54 | - (void (^)(void))theme_changeBlock {
55 | return objc_getAssociatedObject(self, @selector(theme_changeBlock));
56 | }
57 |
58 | @end
59 |
--------------------------------------------------------------------------------
/SDTheme/Classes/Core/SDThemeManager.h:
--------------------------------------------------------------------------------
1 | //
2 | // SDThemeManager.h
3 | // SDTheme
4 | //
5 | // Created by SlashDevelopers on 2018/06/07.
6 | // Copyright (c) 2018 SlashDevelopers. All rights reserved
7 | //
8 |
9 | #import
10 |
11 | /// 主题切换通知
12 | FOUNDATION_EXPORT NSString *const SDThemeChangedNotification;
13 |
14 | /// 主题管理
15 | @interface SDThemeManager : NSObject
16 |
17 | @property (nonatomic, assign, readonly) NSString *themeName; ///< 当前主题名称
18 |
19 | + (instancetype)sharedInstance;
20 | /// 初始化主题数组
21 | - (void)setupThemeNameArray:(NSArray *)array;
22 | /// 改变主题
23 | - (BOOL)changeTheme:(NSString *)themeName;
24 | /// 获取颜色
25 | + (UIColor *)colorWithID:(NSString *)colorID;
26 | /// 获取图片
27 | + (UIImage *)imageWithName:(NSString *)imageName;
28 | /// 获取颜色值
29 | + (NSString *)colorStringWithID:(NSString *)colorID;
30 |
31 | @end
32 |
--------------------------------------------------------------------------------
/SDTheme/Classes/Core/SDThemeManager.m:
--------------------------------------------------------------------------------
1 | //
2 | // SDThemeManager.m
3 | // SDTheme
4 | //
5 | // Created by SlashDevelopers on 2018/06/07.
6 | // Copyright (c) 2018 SlashDevelopers. All rights reserved
7 | //
8 |
9 | #import "SDThemeManager.h"
10 | #import "UIColor+SDExtension.h"
11 |
12 | NSString * const SDThemeChangedNotification = @"SDThemeChangedNotification";
13 |
14 | @interface SDThemeManager()
15 |
16 | @property (nonatomic, strong) NSBundle *bundle; ///< 主题bundle
17 | @property (nonatomic, copy) NSDictionary *colorsMap; ///< 颜色对照表
18 | @property (nonatomic, copy) NSArray *themeArray; ///< 主题数组
19 |
20 | @end
21 |
22 | @implementation SDThemeManager
23 |
24 | // MARK: - ================ Public M ===========================
25 |
26 | + (instancetype)sharedInstance {
27 | static dispatch_once_t onceToken;
28 | static SDThemeManager *instance = nil;
29 | dispatch_once(&onceToken, ^{
30 | instance = [[SDThemeManager alloc] init];
31 | });
32 | return instance;
33 | }
34 |
35 | - (void)setupThemeNameArray:(NSArray *)array {
36 | self.themeArray = array;
37 | }
38 |
39 | - (BOOL)changeTheme:(NSString *)themeName {
40 | if (![_themeArray containsObject:themeName]) {
41 | return NO;
42 | }
43 | NSBundle *bundle = [NSBundle bundleWithURL:[[NSBundle mainBundle] URLForResource:themeName withExtension:@"bundle"]];
44 | if (!bundle) {
45 | return NO;
46 | }
47 | NSString *mapPath = [bundle pathForResource:@"ColorsMap" ofType:@"plist"];
48 | if (!mapPath) {
49 | return NO;
50 | }
51 | NSDictionary *colorsMap = [NSDictionary dictionaryWithContentsOfFile:mapPath];
52 | _themeName = themeName;
53 | self.bundle = bundle;
54 | self.colorsMap = colorsMap;
55 | [self sendChangeThemeNotification];
56 | return YES;
57 | }
58 |
59 | + (UIColor *)colorWithID:(NSString *)colorID {
60 | if (!colorID) {
61 | return [UIColor clearColor];
62 | }
63 | return [UIColor sd_colorWithHexString:[[self class] colorStringWithID:colorID]];
64 | }
65 |
66 |
67 | + (NSString *)colorStringWithID:(NSString *)colorID {
68 | NSArray *array = [colorID componentsSeparatedByString:@"_"];
69 | NSAssert(array.count > 1, @"未找到对应颜色-%@", colorID);
70 |
71 | NSDictionary *colorDict = [[SDThemeManager sharedInstance].colorsMap valueForKeyPath:array[0]];
72 | NSString *value = colorDict[colorID][@"Color"];
73 | NSAssert(value, @"未找到对应颜色-%@", colorID);
74 | return value;
75 | }
76 |
77 | + (UIImage *)imageWithName:(NSString *)imageName {
78 | if (!imageName) {
79 | return nil;
80 | }
81 | UIImage *image = [UIImage imageNamed:imageName inBundle:[SDThemeManager sharedInstance].bundle compatibleWithTraitCollection:nil];
82 | NSAssert(image, @"未找到对应图片-%@", imageName);
83 | return image;
84 | }
85 |
86 | // MARK: - ================ Private M ===========================
87 |
88 | - (void)sendChangeThemeNotification {
89 | [[NSNotificationCenter defaultCenter] postNotificationName:SDThemeChangedNotification object:nil];
90 | }
91 |
92 | @end
93 |
--------------------------------------------------------------------------------
/SDTheme/Classes/Core/UIColor+SDExtension.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIColor+SDExtension.h
3 | // SDTheme
4 | //
5 | // Created by SlashDevelopers on 2018/6/7.
6 | //
7 |
8 | #import
9 |
10 | @interface UIColor (SDExtension)
11 |
12 | + (UIColor *)sd_colorWithHexString:(NSString *)hexString;
13 |
14 | @end
15 |
--------------------------------------------------------------------------------
/SDTheme/Classes/Core/UIColor+SDExtension.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIColor+SDExtension.m
3 | // SDTheme
4 | //
5 | // Created by SlashDevelopers on 2018/6/7.
6 | //
7 |
8 | #import "UIColor+SDExtension.h"
9 |
10 | @implementation UIColor (SDExtension)
11 |
12 | + (UIColor *)sd_colorWithHexString:(NSString *)hexString {
13 | NSString *colorString = [[hexString stringByReplacingOccurrencesOfString:@"#" withString:@""] uppercaseString];
14 | CGFloat alpha,red, blue, green;
15 | switch ([colorString length]) {
16 | case 3: // #RGB
17 | alpha = 1.0f;
18 | red = [self colorComponentFrom:colorString start:0 length:1];
19 | green = [self colorComponentFrom:colorString start:1 length:1];
20 | blue = [self colorComponentFrom:colorString start:2 length:1];
21 | break;
22 | case 4: // #ARGB
23 | alpha = [self colorComponentFrom:colorString start:0 length:1];
24 | red = [self colorComponentFrom:colorString start:1 length:1];
25 | green = [self colorComponentFrom:colorString start:2 length:1];
26 | blue = [self colorComponentFrom:colorString start:3 length:1];
27 | break;
28 | case 6: // #RRGGBB
29 | alpha = 1.0f;
30 | red = [self colorComponentFrom:colorString start:0 length:2];
31 | green = [self colorComponentFrom:colorString start:2 length:2];
32 | blue = [self colorComponentFrom:colorString start:4 length:2];
33 | break;
34 | case 8: // #AARRGGBB
35 | alpha = [self colorComponentFrom:colorString start:0 length:2];
36 | red = [self colorComponentFrom:colorString start:2 length:2];
37 | green = [self colorComponentFrom:colorString start:4 length:2];
38 | blue = [self colorComponentFrom:colorString start:6 length:2];
39 | break;
40 | default:
41 | [NSException raise:@"Invalid color value" format: @"Color value %@ is invalid. It should be a hex value of the form #RBG, #ARGB, #RRGGBB, or #AARRGGBB", hexString];
42 | break;
43 | }
44 | return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
45 | }
46 |
47 | + (CGFloat)colorComponentFrom:(NSString *)string start:(NSUInteger)start length:(NSUInteger)length {
48 | NSString *substring = [string substringWithRange:NSMakeRange(start, length)];
49 | NSString *fullHex = length == 2 ? substring : [NSString stringWithFormat:@"%@%@", substring, substring];
50 | unsigned hexComponent;
51 | NSScanner *scanner = [NSScanner scannerWithString:fullHex];
52 | [scanner scanHexInt:&hexComponent];
53 | fullHex = nil;
54 | substring = nil;
55 | scanner = nil;
56 | return hexComponent / 255.0;
57 | }
58 |
59 | @end
60 |
--------------------------------------------------------------------------------
/SDTheme/Classes/SDTheme.h:
--------------------------------------------------------------------------------
1 | //
2 | // SDTheme.h
3 | // SDTheme
4 | //
5 | // Created by SlashDevelopers on 2018/06/07.
6 | // Copyright (c) 2018 SlashDevelopers. All rights reserved.
7 | //
8 |
9 | #ifndef SDTheme_h
10 | #define SDTheme_h
11 |
12 | #import "SDThemeManager.h"
13 | #import "NSObject+SDTheme.h"
14 | #import "NSAttributedString+SDTheme.h"
15 | #import "CALayer+SDTheme.h"
16 | #import "CAShapeLayer+SDTheme.h"
17 | #import "UIApplication+SDTheme.h"
18 | #import "UIActivityIndicatorView+SDTheme.h"
19 | #import "UIBarItem+SDTheme.h"
20 | #import "UIButton+SDTheme.h"
21 | #import "UIView+SDTheme.h"
22 | #import "UILabel+SDTheme.h"
23 | #import "UITextField+SDTheme.h"
24 | #import "UITextView+SDTheme.h"
25 | #import "UIImageView+SDTheme.h"
26 | #import "UISegmentedControl+SDTheme.h"
27 | #import "UISwitch+SDTheme.h"
28 | #import "UIPageControl+SDTheme.h"
29 | #import "UITabBar+SDTheme.h"
30 | #import "UITabBarItem+SDTheme.h"
31 | #import "UITableView+SDTheme.h"
32 | #import "UINavigationBar+SDTheme.h"
33 |
34 | #endif /* SDTheme_h */
35 |
--------------------------------------------------------------------------------
/SDTheme/Classes/UIKit/CALayer+SDTheme.h:
--------------------------------------------------------------------------------
1 | //
2 | // CALayer+SDTheme.h
3 | // SDTheme
4 | //
5 | // Created by SlashDevelopers on 2018/5/18.
6 | //
7 |
8 | #import
9 |
10 | @interface CALayer (SDTheme)
11 |
12 | @property (nonatomic, copy) NSString *theme_borderColor;
13 | @property (nonatomic, copy) NSString *theme_shadowColor;
14 | @property (nonatomic, copy) NSString *theme_backgroundColor;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/SDTheme/Classes/UIKit/CALayer+SDTheme.m:
--------------------------------------------------------------------------------
1 | //
2 | // CALayer+SDTheme.m
3 | // SDTheme
4 | //
5 | // Created by SlashDevelopers on 2018/5/18.
6 | //
7 |
8 | #import "CALayer+SDTheme.h"
9 | #import "NSObject+SDTheme.h"
10 | #import "SDThemeManager.h"
11 | #import
12 |
13 | @interface CALayer ()
14 |
15 | @end
16 |
17 | @implementation CALayer (SDTheme)
18 |
19 | - (void)theme_didChanged {
20 | [super theme_didChanged];
21 | if (self.theme_borderColor) {
22 | self.borderColor = [SDThemeManager colorWithID:self.theme_borderColor].CGColor;
23 | }
24 | if (self.theme_shadowColor) {
25 | self.shadowColor = [SDThemeManager colorWithID:self.theme_shadowColor].CGColor;
26 | }
27 | if (self.theme_backgroundColor) {
28 | self.backgroundColor = [SDThemeManager colorWithID:self.theme_backgroundColor].CGColor;
29 | }
30 | }
31 |
32 | // MARK: - ================ Setter ===========================
33 |
34 | - (void)setTheme_borderColor:(NSString *)color {
35 | self.borderColor = [SDThemeManager colorWithID:color].CGColor;
36 | objc_setAssociatedObject(self, @selector(theme_borderColor), color, OBJC_ASSOCIATION_COPY_NONATOMIC);
37 | [self theme_registChangedNotification];
38 | }
39 |
40 | - (void)setTheme_shadowColor:(NSString *)color {
41 | self.shadowColor = [SDThemeManager colorWithID:color].CGColor;
42 | objc_setAssociatedObject(self, @selector(theme_shadowColor), color, OBJC_ASSOCIATION_COPY_NONATOMIC);
43 | [self theme_registChangedNotification];
44 | }
45 |
46 | - (void)setTheme_backgroundColor:(NSString *)color {
47 | self.backgroundColor = [SDThemeManager colorWithID:color].CGColor;
48 | objc_setAssociatedObject(self, @selector(theme_backgroundColor), color, OBJC_ASSOCIATION_COPY_NONATOMIC);
49 | [self theme_registChangedNotification];
50 | }
51 |
52 | // MARK: - ================ Getter ===========================
53 |
54 | - (NSString *)theme_borderColor {
55 | return objc_getAssociatedObject(self, @selector(theme_borderColor));
56 | }
57 |
58 | - (NSString *)theme_shadowColor {
59 | return objc_getAssociatedObject(self, @selector(theme_shadowColor));
60 | }
61 |
62 | - (NSString *)theme_backgroundColor {
63 | return objc_getAssociatedObject(self, @selector(theme_backgroundColor));
64 | }
65 |
66 | @end
67 |
--------------------------------------------------------------------------------
/SDTheme/Classes/UIKit/CAShapeLayer+SDTheme.h:
--------------------------------------------------------------------------------
1 | //
2 | // CAShapeLayer+SDTheme.h
3 | // Pods
4 | //
5 | // Created by SlashDevelopers on 2018/06/07.
6 | // Copyright (c) 2018 SlashDevelopers. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface CAShapeLayer (SDTheme)
12 |
13 | @property (nonatomic, copy) NSString *theme_fillColor;
14 | @property (nonatomic, copy) NSString *theme_strokeColor;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/SDTheme/Classes/UIKit/CAShapeLayer+SDTheme.m:
--------------------------------------------------------------------------------
1 | //
2 | // CAShapeLayer+SDTheme.m
3 | // Pods
4 | //
5 | // Created by SlashDevelopers on 2018/06/07.
6 | // Copyright (c) 2018 SlashDevelopers. All rights reserved.
7 | //
8 |
9 | #import "CAShapeLayer+SDTheme.h"
10 | #import "NSObject+SDTheme.h"
11 | #import "SDThemeManager.h"
12 | #import
13 |
14 | @implementation CAShapeLayer (SDTheme)
15 |
16 | - (void)theme_didChanged {
17 | [super theme_didChanged];
18 | if (self.theme_fillColor) {
19 | self.fillColor = [SDThemeManager colorWithID:self.theme_fillColor].CGColor;
20 | }
21 | if (self.theme_strokeColor) {
22 | self.strokeColor = [SDThemeManager colorWithID:self.theme_strokeColor].CGColor;
23 | }
24 | }
25 |
26 | // MARK: - ================ Setter ===========================
27 |
28 | - (void)setTheme_fillColor:(NSString *)color {
29 | self.fillColor = [SDThemeManager colorWithID:color].CGColor;
30 | objc_setAssociatedObject(self, @selector(theme_fillColor), color, OBJC_ASSOCIATION_COPY_NONATOMIC);
31 | [self theme_registChangedNotification];
32 | }
33 |
34 | - (void)setTheme_strokeColor:(NSString *)color {
35 | self.strokeColor = [SDThemeManager colorWithID:color].CGColor;
36 | objc_setAssociatedObject(self, @selector(theme_strokeColor), color, OBJC_ASSOCIATION_COPY_NONATOMIC);
37 | [self theme_registChangedNotification];
38 | }
39 |
40 | // MARK: - ================ Getter ===========================
41 |
42 | - (NSString *)theme_fillColor {
43 | return objc_getAssociatedObject(self, @selector(theme_fillColor));
44 | }
45 |
46 | - (NSString *)theme_strokeColor {
47 | return objc_getAssociatedObject(self, @selector(theme_strokeColor));
48 | }
49 |
50 | @end
51 |
--------------------------------------------------------------------------------
/SDTheme/Classes/UIKit/UIActivityIndicatorView+SDTheme.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIActivityIndicatorView+SDTheme.h
3 | // Pods
4 | //
5 | // Created by SlashDevelopers on 2018/06/07.
6 | // Copyright (c) 2018 SlashDevelopers. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface UIActivityIndicatorView (SDTheme)
12 |
13 | @property (nonatomic, copy) NSString *theme_color;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/SDTheme/Classes/UIKit/UIActivityIndicatorView+SDTheme.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIActivityIndicatorView+SDTheme.m
3 | // Pods
4 | //
5 | // Created by SlashDevelopers on 2018/06/07.
6 | // Copyright (c) 2018 SlashDevelopers. All rights reserved.
7 | //
8 |
9 | #import "UIActivityIndicatorView+SDTheme.h"
10 | #import "NSObject+SDTheme.h"
11 | #import "SDThemeManager.h"
12 | #import
13 |
14 | @implementation UIActivityIndicatorView (SDTheme)
15 |
16 | - (void)theme_didChanged {
17 | [super theme_didChanged];
18 | if (self.theme_color) {
19 | self.color = [SDThemeManager colorWithID:self.theme_color];
20 | }
21 | }
22 |
23 | // MARK: - ================ Setters ===========================
24 |
25 | - (void)setTheme_color:(NSString *)color {
26 | self.color = [SDThemeManager colorWithID:color];
27 | objc_setAssociatedObject(self, @selector(theme_color), color, OBJC_ASSOCIATION_COPY_NONATOMIC);
28 | [self theme_registChangedNotification];
29 | }
30 |
31 | // MARK: - ================ Getters ===========================
32 |
33 | - (NSString *)theme_color {
34 | return objc_getAssociatedObject(self, @selector(theme_color));
35 | }
36 |
37 | @end
38 |
--------------------------------------------------------------------------------
/SDTheme/Classes/UIKit/UIApplication+SDTheme.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIApplication+SDTheme.h
3 | // SDTheme
4 | //
5 | // Created by SlashDevelopers on 2018/06/07.
6 | // Copyright (c) 2018 SlashDevelopers. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface UIApplication (SDTheme)
12 |
13 | - (void)theme_setStatusBarColor:(NSString *)color
14 | animated:(BOOL)animated;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/SDTheme/Classes/UIKit/UIApplication+SDTheme.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIApplication+SDTheme.m
3 | // SDTheme
4 | //
5 | // Created by SlashDevelopers on 2018/06/07.
6 | // Copyright (c) 2018 SlashDevelopers. All rights reserved.
7 | //
8 |
9 | #import "UIApplication+SDTheme.h"
10 | #import "SDThemeManager.h"
11 | #import "NSObject+SDTheme.h"
12 | #import
13 |
14 | @interface UIApplication ()
15 |
16 | @property (nonatomic, copy) NSString *theme_barColor;
17 |
18 | @end
19 |
20 | @implementation UIApplication (SDTheme)
21 |
22 | - (void)theme_setStatusBarColor:(NSString *)color
23 | animated:(BOOL)animated
24 | {
25 | self.theme_barColor = color;
26 | #pragma clang diagnostic ignored "-Wdeprecated-declarations"
27 | UIStatusBarStyle barStyle = [self barStyleWithColorId:color];
28 | [self setStatusBarStyle:barStyle animated:animated];
29 | #pragma clang diagnostic pop
30 | [self theme_registChangedNotification];
31 | }
32 |
33 | - (void)theme_didChanged {
34 | [super theme_didChanged];
35 | if (self.theme_barColor) {
36 | #pragma clang diagnostic ignored "-Wdeprecated-declarations"
37 | UIStatusBarStyle barStyle = [self barStyleWithColorId:self.theme_barColor];
38 | [self setStatusBarStyle:barStyle animated:NO];
39 | #pragma clang diagnostic pop
40 | }
41 | }
42 |
43 | - (UIStatusBarStyle)barStyleWithColorId:(NSString *)colorId {
44 | UIColor *barColor = [SDThemeManager colorWithID:colorId];
45 | if (CGColorEqualToColor(barColor.CGColor, [UIColor colorWithRed:1 green:1 blue:1 alpha:1].CGColor)) {
46 | return UIStatusBarStyleLightContent;
47 | }
48 | return UIStatusBarStyleDefault;
49 | }
50 |
51 | // MARK: - ================ Setters ===========================
52 |
53 | - (void)setTheme_barColor:(NSString *)barColorId {
54 | objc_setAssociatedObject(self, @selector(theme_barColor), barColorId, OBJC_ASSOCIATION_COPY_NONATOMIC);
55 | }
56 |
57 | // MARK: - ================ Getters ===========================
58 |
59 | - (NSString *)theme_barColor {
60 | return objc_getAssociatedObject(self, @selector(theme_barColor));
61 | }
62 |
63 | @end
64 |
--------------------------------------------------------------------------------
/SDTheme/Classes/UIKit/UIBarItem+SDTheme.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIBarItem+SDTheme.h
3 | // SDTheme
4 | //
5 | // Created by SlashDevelopers on 2018/06/07.
6 | // Copyright (c) 2018 SlashDevelopers. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface UIBarItem (SDTheme)
12 |
13 | @property (nonatomic, copy) NSString *theme_image;
14 |
15 | - (void)theme_setTitleTextAttributes:(NSDictionary *)attributes
16 | forState:(UIControlState)state;
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/SDTheme/Classes/UIKit/UIBarItem+SDTheme.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIBarItem+SDTheme.m
3 | // SDTheme
4 | //
5 | // Created by SlashDevelopers on 2018/06/07.
6 | // Copyright (c) 2018 SlashDevelopers. All rights reserved.
7 | //
8 |
9 | #import "UIBarItem+SDTheme.h"
10 | #import "NSObject+SDTheme.h"
11 | #import "NSDictionary+SDTheme.h"
12 | #import "SDThemeManager.h"
13 | #import
14 |
15 | @interface UIBarItem ()
16 |
17 | @property (nonatomic, strong) NSMutableDictionary *theme_attributes;
18 |
19 | @end
20 |
21 | @implementation UIBarItem (SDTheme)
22 |
23 | - (void)theme_setTitleTextAttributes:(NSDictionary *)attributes
24 | forState:(UIControlState)state
25 | {
26 | attributes = attributes.theme_replaceTitleTextAttributes;
27 | self.theme_attributes[@(state)] = attributes;
28 | [self theme_registChangedNotification];
29 | [self setTitleTextAttributes:attributes forState:state];
30 | }
31 |
32 | - (void)theme_didChanged {
33 | [super theme_didChanged];
34 | if (self.theme_image) {
35 | self.image = [[SDThemeManager imageWithName:self.theme_image] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
36 | }
37 | [self.theme_attributes enumerateKeysAndObjectsUsingBlock:^(NSNumber *key, NSDictionary *obj, BOOL * _Nonnull stop) {
38 | obj = obj.theme_replaceTitleTextAttributes;
39 | [self setTitleTextAttributes:obj
40 | forState:key.unsignedIntegerValue];
41 | }];
42 | }
43 |
44 | // MARK: - ================ Setters ===========================
45 |
46 | - (void)setTheme_image:(NSString *)image {
47 | self.image = [[SDThemeManager imageWithName:image] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
48 | objc_setAssociatedObject(self, @selector(theme_image), image, OBJC_ASSOCIATION_COPY_NONATOMIC);
49 | [self theme_registChangedNotification];
50 | }
51 |
52 | // MARK: - ================ Getters ===========================
53 |
54 | - (NSString *)theme_image {
55 | return objc_getAssociatedObject(self, @selector(theme_image));
56 | }
57 |
58 | - (NSMutableDictionary *)theme_attributes {
59 | NSMutableDictionary *attributes = objc_getAssociatedObject(self, @selector(theme_attributes));
60 | if (attributes) {
61 | return attributes;
62 | }
63 | attributes = [NSMutableDictionary dictionary];
64 | objc_setAssociatedObject(self, @selector(theme_attributes), attributes, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
65 | return attributes;
66 | }
67 |
68 | @end
69 |
--------------------------------------------------------------------------------
/SDTheme/Classes/UIKit/UIButton+SDTheme.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIButton+SDTheme.h
3 | // SDTheme
4 | //
5 | // Created by SlashDevelopers on 2018/06/07.
6 | // Copyright (c) 2018 SlashDevelopers. All rights reserved
7 | //
8 |
9 | #import
10 |
11 | @interface UIButton (SDTheme)
12 |
13 | - (void)theme_setImage:(NSString *)imageName
14 | forState:(UIControlState)state;
15 |
16 | - (void)theme_setBackgroundImage:(NSString *)imageName
17 | forState:(UIControlState)state;
18 |
19 | - (void)theme_setTitleColor:(NSString *)color
20 | forState:(UIControlState)state;
21 |
22 | - (void)theme_setBackgroundColor:(NSString *)color
23 | forState:(UIControlState)state;
24 |
25 | - (void)theme_setAttributedTitle:(NSAttributedString *)title
26 | forState:(UIControlState)state;
27 |
28 | @end
29 |
--------------------------------------------------------------------------------
/SDTheme/Classes/UIKit/UIButton+SDTheme.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIButton+SDTheme.m
3 | // SDTheme
4 | //
5 | // Created by SlashDevelopers on 2018/06/07.
6 | // Copyright (c) 2018 SlashDevelopers. All rights reserved
7 | //
8 |
9 | #import "UIButton+SDTheme.h"
10 | #import "NSObject+SDTheme.h"
11 | #import "NSAttributedString+SDTheme.h"
12 | #import "UIImage+SDExtension.h"
13 | #import "SDThemeManager.h"
14 | #import
15 |
16 | @interface UIButton ()
17 |
18 | @property (nonatomic, strong) NSMutableDictionary *theme_images;
19 | @property (nonatomic, strong) NSMutableDictionary *theme_backgroundImages;
20 | @property (nonatomic, strong) NSMutableDictionary *theme_titleColors;
21 | @property (nonatomic, strong) NSMutableDictionary *theme_backgroundColors;
22 | @property (nonatomic, strong) NSMutableDictionary *theme_attributedTitles;
23 |
24 | @end
25 |
26 | @implementation UIButton (SDTheme)
27 |
28 | - (void)theme_setImage:(NSString *)imageName
29 | forState:(UIControlState)state
30 | {
31 | self.theme_images[@(state)] = imageName;
32 | [self theme_registChangedNotification];
33 | [self setImage:[SDThemeManager imageWithName:imageName] forState:state];
34 | }
35 |
36 | - (void)theme_setBackgroundImage:(NSString *)imageName
37 | forState:(UIControlState)state
38 | {
39 | self.theme_backgroundImages[@(state)] = imageName;
40 | [self theme_registChangedNotification];
41 | [self setBackgroundImage:[SDThemeManager imageWithName:imageName] forState:state];
42 | }
43 |
44 | - (void)theme_setTitleColor:(NSString *)color
45 | forState:(UIControlState)state
46 | {
47 | self.theme_titleColors[@(state)] = color;
48 | [self theme_registChangedNotification];
49 | [self setTitleColor:[SDThemeManager colorWithID:color] forState:state];
50 | }
51 |
52 | - (void)theme_setBackgroundColor:(NSString *)color
53 | forState:(UIControlState)state
54 | {
55 | UIImage *image = [UIImage sd_imageWithColor:[SDThemeManager colorWithID:color]];
56 | self.theme_backgroundColors[@(state)] = color;
57 | [self theme_registChangedNotification];
58 | [self setBackgroundImage:image forState:state];
59 | }
60 |
61 | - (void)theme_setAttributedTitle:(NSAttributedString *)title
62 | forState:(UIControlState)state
63 | {
64 | self.theme_attributedTitles[@(state)] = title;
65 | [self theme_registChangedNotification];
66 | [self setAttributedTitle:title.theme_replaceRealityColor forState:state];
67 | }
68 |
69 | - (void)theme_didChanged {
70 | [super theme_didChanged];
71 | [self.theme_images enumerateKeysAndObjectsUsingBlock:^(NSNumber *key, NSString *obj, BOOL * _Nonnull stop) {
72 | [self setImage:[SDThemeManager imageWithName:obj]
73 | forState:key.unsignedIntegerValue];
74 | }];
75 | [self.theme_backgroundImages enumerateKeysAndObjectsUsingBlock:^(NSNumber *key, NSString *obj, BOOL * _Nonnull stop) {
76 | [self setBackgroundImage:[SDThemeManager imageWithName:obj] forState:key.unsignedIntegerValue];
77 | }];
78 | [self.theme_titleColors enumerateKeysAndObjectsUsingBlock:^(NSNumber *key, NSString *obj, BOOL * _Nonnull stop) {
79 | [self setTitleColor:[SDThemeManager colorWithID:obj] forState:key.unsignedIntegerValue];
80 | }];
81 | [self.theme_backgroundColors enumerateKeysAndObjectsUsingBlock:^(NSNumber *key, NSString *obj, BOOL * _Nonnull stop) {
82 | UIImage *image = [UIImage sd_imageWithColor:[SDThemeManager colorWithID:obj]];
83 | [self setBackgroundImage:image forState:key.unsignedIntegerValue];
84 | }];
85 | [self.theme_attributedTitles enumerateKeysAndObjectsUsingBlock:^(NSNumber *key,NSAttributedString *obj, BOOL * _Nonnull stop) {
86 | [self setAttributedTitle:obj.theme_replaceRealityColor forState:key.unsignedIntegerValue];
87 | }];
88 | }
89 |
90 | // MARK: - ================ Getters ===========================
91 |
92 | - (NSMutableDictionary *)theme_images {
93 | NSMutableDictionary *images = objc_getAssociatedObject(self, @selector(theme_images));
94 | if (images) {
95 | return images;
96 | }
97 | images = [NSMutableDictionary dictionary];
98 | objc_setAssociatedObject(self, @selector(theme_images), images, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
99 | return images;
100 | }
101 |
102 | - (NSMutableDictionary *)theme_backgroundImages {
103 | NSMutableDictionary *backgroundImages = objc_getAssociatedObject(self, @selector(theme_backgroundImages));
104 | if (backgroundImages) {
105 | return backgroundImages;
106 | }
107 | backgroundImages = [NSMutableDictionary dictionary];
108 | objc_setAssociatedObject(self, @selector(theme_backgroundImages), backgroundImages, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
109 | return backgroundImages;
110 | }
111 |
112 | - (NSMutableDictionary *)theme_titleColors {
113 | NSMutableDictionary *titleColors = objc_getAssociatedObject(self, @selector(theme_titleColors));
114 | if (titleColors) {
115 | return titleColors;
116 | }
117 | titleColors = [NSMutableDictionary dictionary];
118 | objc_setAssociatedObject(self, @selector(theme_titleColors), titleColors, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
119 | return titleColors;
120 | }
121 |
122 | - (NSMutableDictionary *)theme_backgroundColors {
123 | NSMutableDictionary *backgroundColors = objc_getAssociatedObject(self, @selector(theme_backgroundColors));
124 | if (backgroundColors) {
125 | return backgroundColors;
126 | }
127 | backgroundColors = [NSMutableDictionary dictionary];
128 | objc_setAssociatedObject(self, @selector(theme_backgroundColors), backgroundColors, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
129 | return backgroundColors;
130 | }
131 |
132 | - (NSMutableDictionary *)theme_attributedTitles {
133 | NSMutableDictionary *attributedTitles = objc_getAssociatedObject(self, @selector(theme_attributedTitles));
134 | if (attributedTitles) {
135 | return attributedTitles;
136 | }
137 | attributedTitles = [NSMutableDictionary dictionary];
138 | objc_setAssociatedObject(self, @selector(theme_attributedTitles), attributedTitles, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
139 | return attributedTitles;
140 | }
141 |
142 | @end
143 |
--------------------------------------------------------------------------------
/SDTheme/Classes/UIKit/UIImage+SDExtension.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIImage+SDExtension.h
3 | // SDTheme
4 | //
5 | // Created by SlashDevelopers on 2018/06/07.
6 | // Copyright (c) 2018 SlashDevelopers. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface UIImage (SDExtension)
12 |
13 | + (UIImage *)sd_imageWithColor:(UIColor*)color;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/SDTheme/Classes/UIKit/UIImage+SDExtension.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIImage+SDExtension.m
3 | // SDTheme
4 | //
5 | // Created by SlashDevelopers on 2018/06/07.
6 | // Copyright (c) 2018 SlashDevelopers. All rights reserved.
7 | //
8 |
9 | #import "UIImage+SDExtension.h"
10 |
11 | @implementation UIImage (SDExtension)
12 |
13 | + (UIImage *)sd_imageWithColor:(UIColor*)color {
14 | CGRect rect = CGRectMake(0.0f, 0.0f, 1.0f, 1.0f);
15 | UIGraphicsBeginImageContext(rect.size);
16 | CGContextRef context = UIGraphicsGetCurrentContext();
17 | CGContextSetFillColorWithColor(context, [color CGColor]);
18 | CGContextFillRect(context, rect);
19 | UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
20 | UIGraphicsEndImageContext();
21 | return image;
22 | }
23 |
24 | @end
25 |
--------------------------------------------------------------------------------
/SDTheme/Classes/UIKit/UIImageView+SDTheme.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIImageView+SDTheme.h
3 | // SDTheme
4 | //
5 | // Created by SlashDevelopers on 2018/06/07.
6 | // Copyright (c) 2018 SlashDevelopers. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface UIImageView (SDTheme)
12 |
13 | @property (nonatomic, copy) NSString *theme_image;
14 | @property (nonatomic, copy) IBInspectable NSString *sd_image;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/SDTheme/Classes/UIKit/UIImageView+SDTheme.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIImageView+SDTheme.m
3 | // SDTheme
4 | //
5 | // Created by SlashDevelopers on 2018/06/07.
6 | // Copyright (c) 2018 SlashDevelopers. All rights reserved.
7 | //
8 |
9 | #import "UIImageView+SDTheme.h"
10 | #import "NSObject+SDTheme.h"
11 | #import "SDThemeManager.h"
12 | #import
13 |
14 | @interface UIImageView ()
15 |
16 | @end
17 |
18 | @implementation UIImageView (SDTheme)
19 |
20 | - (void)theme_didChanged {
21 | [super theme_didChanged];
22 | if (self.theme_image) {
23 | self.image = [SDThemeManager imageWithName:self.theme_image];
24 | }
25 | }
26 |
27 | // MARK: - ================ Setters ===========================
28 |
29 | - (void)setTheme_image:(NSString *)image {
30 | self.image = [SDThemeManager imageWithName:image];
31 | objc_setAssociatedObject(self, @selector(theme_image), image, OBJC_ASSOCIATION_COPY_NONATOMIC);
32 | [self theme_registChangedNotification];
33 | }
34 |
35 | - (void)setSd_image:(NSString *)sd_image {
36 | self.theme_image = sd_image;
37 | }
38 |
39 | // MARK: - ================ Getters ===========================
40 |
41 | - (NSString *)theme_image {
42 | return objc_getAssociatedObject(self, @selector(theme_image));
43 | }
44 |
45 | - (NSString *)sd_image {
46 | return self.theme_image;
47 | }
48 |
49 | @end
50 |
--------------------------------------------------------------------------------
/SDTheme/Classes/UIKit/UILabel+SDTheme.h:
--------------------------------------------------------------------------------
1 | //
2 | // UILabel+SDTheme.h
3 | // SDTheme
4 | //
5 | // Created by SlashDevelopers on 2018/06/07.
6 | // Copyright (c) 2018 SlashDevelopers. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface UILabel (SDTheme)
12 |
13 | @property (nonatomic, copy) NSString *theme_textColor;
14 | @property (nonatomic, copy) IBInspectable NSString *sd_textColor;
15 | @property (nonatomic, copy) NSAttributedString *theme_attributedText;
16 |
17 | @end
18 |
--------------------------------------------------------------------------------
/SDTheme/Classes/UIKit/UILabel+SDTheme.m:
--------------------------------------------------------------------------------
1 | //
2 | // UILabel+SDTheme.m
3 | // SDTheme
4 | //
5 | // Created by SlashDevelopers on 2018/06/07.
6 | // Copyright (c) 2018 SlashDevelopers. All rights reserved.
7 | //
8 |
9 | #import "UILabel+SDTheme.h"
10 | #import "NSObject+SDTheme.h"
11 | #import "NSAttributedString+SDTheme.h"
12 | #import "SDThemeManager.h"
13 | #import
14 |
15 | @interface UILabel()
16 |
17 | @end
18 |
19 | @implementation UILabel (SDTheme)
20 |
21 | - (void)theme_didChanged {
22 | [super theme_didChanged];
23 | if (self.theme_textColor) {
24 | self.textColor = [SDThemeManager colorWithID:self.theme_textColor];
25 | }
26 | if (self.attributedText) {
27 | self.attributedText = self.attributedText.theme_replaceRealityColor;
28 | }
29 | }
30 |
31 | // MARK: - ================ Setters ===========================
32 |
33 | - (void)setTheme_textColor:(NSString *)color {
34 | self.textColor = [SDThemeManager colorWithID:color];
35 | objc_setAssociatedObject(self, @selector(theme_textColor), color, OBJC_ASSOCIATION_COPY_NONATOMIC);
36 | [self theme_registChangedNotification];
37 | }
38 |
39 | - (void)setTheme_attributedText:(NSAttributedString *)attributedText {
40 | self.attributedText = attributedText.theme_replaceRealityColor;
41 | [self theme_registChangedNotification];
42 | }
43 |
44 | - (void)setSDTextColorID:(NSString *)SDTextColorID {
45 | self.theme_textColor = SDTextColorID;
46 | }
47 |
48 | - (void)setSd_textColor:(NSString *)sd_textColor {
49 | self.theme_textColor = sd_textColor;
50 | }
51 |
52 | // MARK: - ================ Getters ===========================
53 |
54 | - (NSString *)theme_textColor {
55 | return objc_getAssociatedObject(self, @selector(theme_textColor));
56 | }
57 |
58 | - (NSAttributedString *)theme_attributedText {
59 | return self.attributedText;
60 | }
61 |
62 | - (NSString *)sd_textColor {
63 | return self.theme_textColor;
64 | }
65 |
66 | @end
67 |
--------------------------------------------------------------------------------
/SDTheme/Classes/UIKit/UINavigationBar+SDTheme.h:
--------------------------------------------------------------------------------
1 | //
2 | // UINavigationBar+SDTheme.h
3 | // Pods
4 | //
5 | // Created by SlashDevelopers on 2018/06/07.
6 | // Copyright (c) 2018 SlashDevelopers. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface UINavigationBar (SDTheme)
12 |
13 | @property (nonatomic, copy) NSString *theme_barTintColor;
14 | @property (nonatomic, copy) NSDictionary *theme_titleTextAttributes;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/SDTheme/Classes/UIKit/UINavigationBar+SDTheme.m:
--------------------------------------------------------------------------------
1 | //
2 | // UINavigationBar+SDTheme.m
3 | // Pods
4 | //
5 | // Created by SlashDevelopers on 2018/06/07.
6 | // Copyright (c) 2018 SlashDevelopers. All rights reserved.
7 | //
8 |
9 | #import "UINavigationBar+SDTheme.h"
10 | #import "NSObject+SDTheme.h"
11 | #import "NSDictionary+SDTheme.h"
12 | #import "SDThemeManager.h"
13 | #import
14 |
15 | @interface UINavigationBar ()
16 |
17 | @end
18 |
19 | @implementation UINavigationBar (SDTheme)
20 |
21 | - (void)theme_setBarTintColor:(NSString *)color {
22 | self.theme_barTintColor = color;
23 | }
24 |
25 | - (void)theme_setTitleTextAttributes:(NSDictionary *)attributes {
26 | [self theme_registChangedNotification];
27 | }
28 |
29 | - (void)theme_didChanged {
30 | [super theme_didChanged];
31 | if (self.theme_barTintColor) {
32 | self.barTintColor = [SDThemeManager colorWithID:self.theme_barTintColor];
33 | }
34 | if (self.titleTextAttributes) {
35 | self.titleTextAttributes = self.titleTextAttributes.theme_replaceTitleTextAttributes;
36 | }
37 | }
38 |
39 | // MARK: - ================ Setters ===========================
40 |
41 | - (void)setTheme_barTintColor:(NSString *)barTintColor {
42 | self.barTintColor = [SDThemeManager colorWithID:barTintColor];
43 | objc_setAssociatedObject(self, @selector(theme_barTintColor), barTintColor, OBJC_ASSOCIATION_COPY_NONATOMIC);
44 | [self theme_registChangedNotification];
45 | }
46 |
47 | - (void)setTheme_titleTextAttributes:(NSDictionary *)titleTextAttributes {
48 | titleTextAttributes = titleTextAttributes.theme_replaceTitleTextAttributes;
49 | self.titleTextAttributes = titleTextAttributes;
50 | [self theme_registChangedNotification];
51 | }
52 |
53 | // MARK: - ================ Getters ===========================
54 |
55 | - (NSString *)theme_barTintColor {
56 | return objc_getAssociatedObject(self, @selector(theme_barTintColor));
57 | }
58 |
59 | - (NSDictionary *)theme_titleTextAttributes {
60 | return self.titleTextAttributes;
61 | }
62 |
63 | @end
64 |
--------------------------------------------------------------------------------
/SDTheme/Classes/UIKit/UIPageControl+SDTheme.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIPageControl+SDTheme.h
3 | // SDTheme
4 | //
5 | // Created by SlashDevelopers on 2018/5/8.
6 | //
7 |
8 | #import
9 |
10 | @interface UIPageControl (SDTheme)
11 |
12 | @property (nonatomic, copy) NSString *theme_currentPageIndicatorTintColor;
13 | @property (nonatomic, copy) NSString *theme_pageIndicatorTintColor;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/SDTheme/Classes/UIKit/UIPageControl+SDTheme.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIPageControl+SDTheme.m
3 | // SDTheme
4 | //
5 | // Created by SlashDevelopers on 2018/5/8.
6 | //
7 |
8 | #import "UIPageControl+SDTheme.h"
9 | #import "NSObject+SDTheme.h"
10 | #import "SDThemeManager.h"
11 | #import
12 |
13 | @interface UIPageControl ()
14 |
15 | @end
16 |
17 | @implementation UIPageControl (SDTheme)
18 |
19 | - (void)theme_didChanged {
20 | [super theme_didChanged];
21 | if (self.theme_pageIndicatorTintColor) {
22 | self.pageIndicatorTintColor = [SDThemeManager colorWithID:self.theme_pageIndicatorTintColor];
23 | }
24 | if (self.theme_currentPageIndicatorTintColor) {
25 | self.currentPageIndicatorTintColor = [SDThemeManager colorWithID:self.theme_currentPageIndicatorTintColor];
26 | }
27 | }
28 |
29 | // MARK: - ================ Setters ===========================
30 |
31 | - (void)setTheme_pageIndicatorTintColor:(NSString *)pageIndicatorTintColor {
32 | [self setPageIndicatorTintColor:[SDThemeManager colorWithID:pageIndicatorTintColor]];
33 | objc_setAssociatedObject(self, @selector(theme_pageIndicatorTintColor), pageIndicatorTintColor, OBJC_ASSOCIATION_COPY_NONATOMIC);
34 | [self theme_registChangedNotification];
35 | }
36 |
37 | - (void)setTheme_currentPageIndicatorTintColor:(NSString *)currentPageIndicatorTintColor {
38 | [self setCurrentPageIndicatorTintColor:[SDThemeManager colorWithID:currentPageIndicatorTintColor]];
39 | objc_setAssociatedObject(self, @selector(theme_currentPageIndicatorTintColor), currentPageIndicatorTintColor, OBJC_ASSOCIATION_COPY_NONATOMIC);
40 | [self theme_registChangedNotification];
41 | }
42 |
43 | // MARK: - ================ Getters ===========================
44 |
45 | - (NSString *)theme_pageIndicatorTintColor {
46 | return objc_getAssociatedObject(self, @selector(theme_pageIndicatorTintColor));
47 | }
48 |
49 | - (NSString *)theme_currentPageIndicatorTintColor {
50 | return objc_getAssociatedObject(self, @selector(theme_currentPageIndicatorTintColor));
51 | }
52 |
53 | @end
54 |
--------------------------------------------------------------------------------
/SDTheme/Classes/UIKit/UISegmentedControl+SDTheme.h:
--------------------------------------------------------------------------------
1 | //
2 | // UISegmentedControl+SDTheme.h
3 | // SDTheme
4 | //
5 | // Created by SlashDevelopers on 2018/5/8.
6 | //
7 |
8 | #import
9 |
10 | @interface UISegmentedControl (SDTheme)
11 |
12 | - (void)theme_setTitleTextAttributes:(NSDictionary *)attributes
13 | forState:(UIControlState)state;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/SDTheme/Classes/UIKit/UISegmentedControl+SDTheme.m:
--------------------------------------------------------------------------------
1 | //
2 | // UISegmentedControl+SDTheme.m
3 | // SDTheme
4 | //
5 | // Created by SlashDevelopers on 2018/5/8.
6 | //
7 |
8 | #import "UISegmentedControl+SDTheme.h"
9 | #import "NSAttributedString+SDTheme.h"
10 | #import "NSObject+SDTheme.h"
11 | #import "NSDictionary+SDTheme.h"
12 | #import "SDThemeManager.h"
13 | #import
14 |
15 | @interface UISegmentedControl ()
16 |
17 | @property (nonatomic, strong) NSMutableDictionary *theme_titleTextAttributes;
18 |
19 | @end
20 |
21 | @implementation UISegmentedControl (SDTheme)
22 |
23 | - (void)theme_setTitleTextAttributes:(NSDictionary *)attributes
24 | forState:(UIControlState)state
25 | {
26 | self.theme_titleTextAttributes[@(state)] = attributes;
27 | [self setTitleTextAttributes:attributes.theme_replaceTitleTextAttributes forState:state];
28 | [self theme_registChangedNotification];
29 | }
30 |
31 | - (void)theme_didChanged {
32 | [super theme_didChanged];
33 | [self.theme_titleTextAttributes enumerateKeysAndObjectsUsingBlock:^(NSNumber *key, NSDictionary *obj, BOOL * _Nonnull stop) {
34 | [self setTitleTextAttributes:obj.theme_replaceTitleTextAttributes forState:(UIControlState)key.unsignedIntegerValue];
35 | }];
36 | }
37 |
38 | // MARK: - ================ Getters ===========================
39 |
40 | - (NSMutableDictionary *)theme_titleTextAttributes {
41 | NSMutableDictionary *dict = objc_getAssociatedObject(self, @selector(theme_titleTextAttributes));
42 | if (dict) {
43 | return dict;
44 | }
45 | dict = [NSMutableDictionary dictionary];
46 | objc_setAssociatedObject(self, @selector(theme_titleTextAttributes), dict, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
47 | return dict;
48 | }
49 |
50 | @end
51 |
--------------------------------------------------------------------------------
/SDTheme/Classes/UIKit/UISwitch+SDTheme.h:
--------------------------------------------------------------------------------
1 | //
2 | // UISwitch+SDTheme.h
3 | // SDTheme
4 | //
5 | // Created by SlashDevelopers on 2018/5/8.
6 | //
7 |
8 | #import
9 |
10 | @interface UISwitch (SDTheme)
11 |
12 | @property (nonatomic, copy) NSString *theme_onTintColor;
13 | @property (nonatomic, copy) NSString *theme_thumbTintColor;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/SDTheme/Classes/UIKit/UISwitch+SDTheme.m:
--------------------------------------------------------------------------------
1 | //
2 | // UISwitch+SDTheme.m
3 | // SDTheme
4 | //
5 | // Created by SlashDevelopers on 2018/5/8.
6 | //
7 |
8 | #import "UISwitch+SDTheme.h"
9 | #import "NSObject+SDTheme.h"
10 | #import "SDThemeManager.h"
11 | #import
12 |
13 | @interface UISwitch ()
14 |
15 | @end
16 |
17 | @implementation UISwitch (SDTheme)
18 |
19 | - (void)theme_didChanged {
20 | [super theme_didChanged];
21 | if (self.theme_onTintColor) {
22 | UIColor *color = [SDThemeManager colorWithID:self.theme_onTintColor];
23 | self.onTintColor = color;
24 | }
25 | if (self.theme_thumbTintColor) {
26 | UIColor *color = [SDThemeManager colorWithID:self.theme_thumbTintColor];
27 | self.thumbTintColor = color;
28 | }
29 | }
30 |
31 | // MARK: - ================ Setter ===========================
32 |
33 | - (void)setTheme_onTintColor:(NSString *)color {
34 | self.onTintColor = [SDThemeManager colorWithID:color];
35 | objc_setAssociatedObject(self, @selector(theme_onTintColor), color, OBJC_ASSOCIATION_COPY_NONATOMIC);
36 | [self theme_registChangedNotification];
37 | }
38 |
39 | - (void)setTheme_thumbTintColor:(NSString *)color {
40 | self.thumbTintColor = [SDThemeManager colorWithID:color];
41 | objc_setAssociatedObject(self, @selector(theme_thumbTintColor), color, OBJC_ASSOCIATION_COPY_NONATOMIC);
42 | [self theme_registChangedNotification];
43 | }
44 |
45 | // MARK: - ================ Getter ===========================
46 |
47 | - (NSString *)theme_onTintColor {
48 | return objc_getAssociatedObject(self, @selector(theme_onTintColor));
49 | }
50 |
51 | - (NSString *)theme_thumbTintColor {
52 | return objc_getAssociatedObject(self, @selector(theme_thumbTintColor));
53 | }
54 |
55 | @end
56 |
--------------------------------------------------------------------------------
/SDTheme/Classes/UIKit/UITabBar+SDTheme.h:
--------------------------------------------------------------------------------
1 | //
2 | // UITabBar+SDTheme.h
3 | // SDTheme
4 | //
5 | // Created by SlashDevelopers on 2018/06/07.
6 | // Copyright (c) 2018 SlashDevelopers. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface UITabBar (SDTheme)
12 |
13 | @property (nonatomic, copy) NSString *theme_barTintColor;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/SDTheme/Classes/UIKit/UITabBar+SDTheme.m:
--------------------------------------------------------------------------------
1 | //
2 | // UITabBar+SDTheme.m
3 | // SDTheme
4 | //
5 | // Created by SlashDevelopers on 2018/06/07.
6 | // Copyright (c) 2018 SlashDevelopers. All rights reserved.
7 | //
8 |
9 | #import "UITabBar+SDTheme.h"
10 | #import "NSObject+SDTheme.h"
11 | #import "SDThemeManager.h"
12 | #import
13 |
14 | @interface UITabBar ()
15 |
16 | @end
17 |
18 | @implementation UITabBar (SDTheme)
19 |
20 | - (void)theme_didChanged {
21 | [super theme_didChanged];
22 | if (self.theme_barTintColor) {
23 | self.barTintColor = [SDThemeManager colorWithID:self.theme_barTintColor];
24 | }
25 | }
26 |
27 | // MARK: - ================ Setters ===========================
28 |
29 | - (void)setTheme_barTintColor:(NSString *)barTintColor {
30 | self.barTintColor = [SDThemeManager colorWithID:barTintColor];
31 | objc_setAssociatedObject(self, @selector(theme_barTintColor), barTintColor, OBJC_ASSOCIATION_COPY_NONATOMIC);
32 | [self theme_registChangedNotification];
33 | }
34 |
35 | // MARK: - ================ Getters ===========================
36 |
37 | - (NSString *)theme_barTintColor {
38 | return objc_getAssociatedObject(self, @selector(theme_barTintColor));
39 | }
40 |
41 | @end
42 |
--------------------------------------------------------------------------------
/SDTheme/Classes/UIKit/UITabBarItem+SDTheme.h:
--------------------------------------------------------------------------------
1 | //
2 | // UITabBarItem+SDTheme.h
3 | // Pods
4 | //
5 | // Created by SlashDevelopers on 2018/06/07.
6 | // Copyright (c) 2018 SlashDevelopers. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface UITabBarItem (SDTheme)
12 |
13 | @property (nonatomic, copy) NSString *theme_selectedImage;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/SDTheme/Classes/UIKit/UITabBarItem+SDTheme.m:
--------------------------------------------------------------------------------
1 | //
2 | // UITabBarItem+SDTheme.m
3 | // Pods
4 | //
5 | // Created by SlashDevelopers on 2018/06/07.
6 | // Copyright (c) 2018 SlashDevelopers. All rights reserved.
7 | //
8 |
9 | #import "UITabBarItem+SDTheme.h"
10 | #import "NSObject+SDTheme.h"
11 | #import "SDThemeManager.h"
12 | #import
13 |
14 | @implementation UITabBarItem (SDTheme)
15 |
16 | - (void)theme_didChanged {
17 | [super theme_didChanged];
18 | if (self.theme_selectedImage) {
19 | self.selectedImage = [[SDThemeManager imageWithName:self.theme_selectedImage] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
20 | }
21 | }
22 |
23 | // MARK: - ================ Setters ===========================
24 |
25 | - (void)setTheme_selectedImage:(NSString *)image {
26 | self.selectedImage = [[SDThemeManager imageWithName:image] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
27 | objc_setAssociatedObject(self, @selector(theme_selectedImage), image, OBJC_ASSOCIATION_COPY_NONATOMIC);
28 | [self theme_registChangedNotification];
29 | }
30 |
31 | // MARK: - ================ Getters ===========================
32 |
33 | - (NSString *)theme_selectedImage {
34 | return objc_getAssociatedObject(self, @selector(theme_selectedImage));
35 | }
36 |
37 | @end
38 |
--------------------------------------------------------------------------------
/SDTheme/Classes/UIKit/UITableView+SDTheme.h:
--------------------------------------------------------------------------------
1 | //
2 | // UITableView+SDTheme.h
3 | // SDTheme
4 | //
5 | // Created by SlashDevelopers on 2018/06/07.
6 | // Copyright (c) 2018 SlashDevelopers. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface UITableView (SDTheme)
12 |
13 | @property (nonatomic, copy) NSString *theme_separatorColor;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/SDTheme/Classes/UIKit/UITableView+SDTheme.m:
--------------------------------------------------------------------------------
1 | //
2 | // UITableView+SDTheme.m
3 | // SDTheme
4 | //
5 | // Created by SlashDevelopers on 2018/06/07.
6 | // Copyright (c) 2018 SlashDevelopers. All rights reserved.
7 | //
8 |
9 | #import "UITableView+SDTheme.h"
10 | #import "NSObject+SDTheme.h"
11 | #import "SDThemeManager.h"
12 | #import
13 |
14 | @implementation UITableView (SDTheme)
15 |
16 | - (void)theme_didChanged {
17 | [super theme_didChanged];
18 | if (self.theme_separatorColor) {
19 | self.separatorColor = [SDThemeManager colorWithID:self.theme_separatorColor];
20 | }
21 | }
22 |
23 | // MARK: - ================ Setters ===========================
24 |
25 | - (void)setTheme_separatorColor:(NSString *)separatorColor {
26 | self.separatorColor = [SDThemeManager colorWithID:separatorColor];
27 | objc_setAssociatedObject(self, @selector(theme_separatorColor), separatorColor, OBJC_ASSOCIATION_COPY_NONATOMIC);
28 | [self theme_registChangedNotification];
29 | }
30 |
31 | // MARK: - ================ Getters ===========================
32 |
33 | - (NSString *)theme_separatorColor {
34 | return objc_getAssociatedObject(self, @selector(theme_separatorColor));
35 | }
36 |
37 | @end
38 |
--------------------------------------------------------------------------------
/SDTheme/Classes/UIKit/UITextField+SDTheme.h:
--------------------------------------------------------------------------------
1 | //
2 | // UITextField+SDTheme.h
3 | // SDTheme
4 | //
5 | // Created by SlashDevelopers on 2018/06/07.
6 | // Copyright (c) 2018 SlashDevelopers. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface UITextField (SDTheme)
12 |
13 | @property (nonatomic, copy) NSString *theme_textColor;
14 | @property (nonatomic, copy) NSAttributedString *theme_attributedPlaceholder;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/SDTheme/Classes/UIKit/UITextField+SDTheme.m:
--------------------------------------------------------------------------------
1 | //
2 | // UITextField+SDTheme.m
3 | // SDTheme
4 | //
5 | // Created by SlashDevelopers on 2018/06/07.
6 | // Copyright (c) 2018 SlashDevelopers. All rights reserved.
7 | //
8 |
9 | #import "UITextField+SDTheme.h"
10 | #import "NSObject+SDTheme.h"
11 | #import "NSAttributedString+SDTheme.h"
12 | #import "SDThemeManager.h"
13 | #import
14 |
15 | @interface UITextField ()
16 |
17 | @end
18 |
19 | @implementation UITextField (SDTheme)
20 |
21 | - (void)theme_didChanged {
22 | [super theme_didChanged];
23 | if (self.theme_textColor) {
24 | self.textColor = [SDThemeManager colorWithID:self.theme_textColor];
25 | }
26 | if (self.attributedPlaceholder) {
27 | self.attributedPlaceholder = self.attributedPlaceholder.theme_replaceRealityColor;
28 | }
29 | }
30 |
31 | // MARK: - ================ Setters ===========================
32 |
33 | - (void)setTheme_textColor:(NSString *)color {
34 | self.textColor = [SDThemeManager colorWithID:color];
35 | objc_setAssociatedObject(self, @selector(theme_textColor), color, OBJC_ASSOCIATION_COPY_NONATOMIC);
36 | [self theme_registChangedNotification];
37 | }
38 |
39 | - (void)setTheme_attributedPlaceholder:(NSAttributedString *)attributedPlaceholder {
40 | self.attributedPlaceholder = attributedPlaceholder.theme_replaceRealityColor;
41 | [self theme_registChangedNotification];
42 | }
43 |
44 | // MARK: - ================ Getters ===========================
45 |
46 | - (NSString *)theme_textColor {
47 | return objc_getAssociatedObject(self, @selector(theme_textColor));
48 | }
49 |
50 | - (NSAttributedString *)theme_attributedPlaceholder {
51 | return self.attributedPlaceholder;
52 | }
53 |
54 | @end
55 |
--------------------------------------------------------------------------------
/SDTheme/Classes/UIKit/UITextView+SDTheme.h:
--------------------------------------------------------------------------------
1 | //
2 | // UITextView+SDTheme.h
3 | // Pods
4 | //
5 | // Created by SlashDevelopers on 2018/06/07.
6 | // Copyright (c) 2018 SlashDevelopers. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface UITextView (SDTheme)
12 |
13 | @property (nonatomic, copy) NSString *theme_textColor;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/SDTheme/Classes/UIKit/UITextView+SDTheme.m:
--------------------------------------------------------------------------------
1 | //
2 | // UITextView+SDTheme.m
3 | // Pods
4 | //
5 | // Created by SlashDevelopers on 2018/06/07.
6 | // Copyright (c) 2018 SlashDevelopers. All rights reserved.
7 | //
8 |
9 | #import "UITextView+SDTheme.h"
10 | #import "NSObject+SDTheme.h"
11 | #import "SDThemeManager.h"
12 | #import
13 |
14 | @implementation UITextView (SDTheme)
15 |
16 | - (void)theme_didChanged {
17 | [super theme_didChanged];
18 | if (self.theme_textColor) {
19 | self.textColor = [SDThemeManager colorWithID:self.theme_textColor];
20 | }
21 | }
22 |
23 | // MARK: - ================ Setters ===========================
24 |
25 | - (void)setTheme_textColor:(NSString *)color {
26 | self.textColor = [SDThemeManager colorWithID:color];
27 | objc_setAssociatedObject(self, @selector(theme_textColor), color, OBJC_ASSOCIATION_COPY_NONATOMIC);
28 | [self theme_registChangedNotification];
29 | }
30 |
31 | // MARK: - ================ Getters ===========================
32 |
33 | - (NSString *)theme_textColor {
34 | return objc_getAssociatedObject(self, @selector(theme_textColor));
35 | }
36 |
37 | @end
38 |
--------------------------------------------------------------------------------
/SDTheme/Classes/UIKit/UIView+SDTheme.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIView+SDTheme.h
3 | // HuashengSecurities
4 | //
5 | // Created by SlashDevelopers on 2018/4/25.
6 | // Copyright © 2018年 www.hstong.com. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface UIView (SDTheme)
12 |
13 | @property (nonatomic, copy) NSString *theme_backgroundColor;
14 | @property (nonatomic, copy) IBInspectable NSString *sd_background;
15 | @property (nonatomic, copy) NSString *theme_tintColor;
16 |
17 | @end
18 |
--------------------------------------------------------------------------------
/SDTheme/Classes/UIKit/UIView+SDTheme.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIView+SDTheme.m
3 | // HuashengSecurities
4 | //
5 | // Created by SlashDevelopers on 2018/4/25.
6 | // Copyright © 2018年 www.hstong.com. All rights reserved.
7 | //
8 |
9 | #import "UIView+SDTheme.h"
10 | #import "NSObject+SDTheme.h"
11 | #import "SDThemeManager.h"
12 | #import
13 |
14 | @interface UIView ()
15 |
16 | @end
17 |
18 | @implementation UIView (SDTheme)
19 |
20 | - (void)theme_didChanged {
21 | [super theme_didChanged];
22 | if (self.theme_backgroundColor) {
23 | self.backgroundColor = [SDThemeManager colorWithID:self.theme_backgroundColor];
24 | }
25 | if (self.theme_tintColor) {
26 | self.tintColor = [SDThemeManager colorWithID:self.theme_tintColor];
27 | }
28 | }
29 |
30 | // MARK: - ================ Setters ===========================
31 |
32 | - (void)setTheme_backgroundColor:(NSString *)backgroundColorId {
33 | self.backgroundColor = [SDThemeManager colorWithID:backgroundColorId];
34 | objc_setAssociatedObject(self, @selector(theme_backgroundColor), backgroundColorId, OBJC_ASSOCIATION_COPY_NONATOMIC);
35 | [self theme_registChangedNotification];
36 | }
37 |
38 | - (void)setTheme_tintColor:(NSString *)tintColorId {
39 | self.tintColor = [SDThemeManager colorWithID:tintColorId];
40 | objc_setAssociatedObject(self, @selector(theme_tintColor), tintColorId, OBJC_ASSOCIATION_COPY_NONATOMIC);
41 | [self theme_registChangedNotification];
42 | }
43 |
44 | - (void)setSd_background:(NSString *)sd_background {
45 | self.theme_backgroundColor = sd_background;
46 | }
47 |
48 | // MARK: - ================ Getters ===========================
49 |
50 | - (NSString *)theme_backgroundColor {
51 | return objc_getAssociatedObject(self, @selector(theme_backgroundColor));
52 | }
53 |
54 | - (NSString *)theme_tintColor {
55 | return objc_getAssociatedObject(self, @selector(theme_tintColor));
56 | }
57 |
58 | - (NSString *)sd_background {
59 | return self.theme_backgroundColor;
60 | }
61 |
62 | @end
63 |
--------------------------------------------------------------------------------
/_Pods.xcodeproj:
--------------------------------------------------------------------------------
1 | Example/Pods/Pods.xcodeproj
--------------------------------------------------------------------------------