├── .gitignore ├── CalendarPopUp.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── atakishiyev.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ ├── atakishiyev.xcuserdatad │ └── xcschemes │ │ ├── CalendarPopUp.xcscheme │ │ └── xcschememanagement.plist │ └── sistemas.xcuserdatad │ └── xcschemes │ └── xcschememanagement.plist ├── CalendarPopUp.xcworkspace ├── contents.xcworkspacedata ├── xcshareddata │ └── IDEWorkspaceChecks.plist └── xcuserdata │ ├── atakishiyev.xcuserdatad │ └── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ └── sistemas.xcuserdatad │ ├── UserInterfaceState.xcuserstate │ └── xcdebugger │ └── Breakpoints_v2.xcbkptlist ├── CalendarPopUp ├── AnimationClass.swift ├── AppDelegate.swift ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── CalendarLanguageConstants.swift ├── CalendarPopUp.swift ├── CalendarPopUp.xib ├── CellView.swift ├── CellView.xib ├── Extensions.swift ├── Info.plist ├── PopupContainer.swift └── ViewController.swift ├── CalendarPopUpDemo.gif ├── License.md ├── Podfile ├── Podfile.lock ├── README.md └── v.gif /.gitignore: -------------------------------------------------------------------------------- 1 | Pods/ 2 | .DS_Store 3 | ## Build generated 4 | build/ 5 | DerivedData/ 6 | CalendarPopUp.xcworkspace/xcuserdata/atakishiyev.xcuserdatad/UserInterfaceState.xcuserstate 7 | -------------------------------------------------------------------------------- /CalendarPopUp.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1AC2BF85216E63870047B7C4 /* CalendarLanguageConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1AC2BF84216E63870047B7C4 /* CalendarLanguageConstants.swift */; }; 11 | 8E609D7C1DDCD841005A52F3 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E609D7B1DDCD841005A52F3 /* Extensions.swift */; }; 12 | 8E71C5AA1FE6A41D0050632D /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = 8E71C5A91FE6A41D0050632D /* README.md */; }; 13 | 8E9519801DDC47BA00432EC2 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E95197F1DDC47BA00432EC2 /* AppDelegate.swift */; }; 14 | 8E9519821DDC47BA00432EC2 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E9519811DDC47BA00432EC2 /* ViewController.swift */; }; 15 | 8E9519851DDC47BA00432EC2 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8E9519831DDC47BA00432EC2 /* Main.storyboard */; }; 16 | 8E9519871DDC47BA00432EC2 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8E9519861DDC47BA00432EC2 /* Assets.xcassets */; }; 17 | 8E95198A1DDC47BA00432EC2 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8E9519881DDC47BA00432EC2 /* LaunchScreen.storyboard */; }; 18 | 8E9519931DDC744A00432EC2 /* PopupContainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E9519921DDC744A00432EC2 /* PopupContainer.swift */; }; 19 | 8E9519961DDC746100432EC2 /* CalendarPopUp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E9519941DDC746100432EC2 /* CalendarPopUp.swift */; }; 20 | 8E9519971DDC746100432EC2 /* CalendarPopUp.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8E9519951DDC746100432EC2 /* CalendarPopUp.xib */; }; 21 | 8E95199D1DDC78FB00432EC2 /* AnimationClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E95199C1DDC78FB00432EC2 /* AnimationClass.swift */; }; 22 | 8E9519A01DDC8B2900432EC2 /* CellView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8E95199E1DDC8B2900432EC2 /* CellView.xib */; }; 23 | 8E9519A11DDC8B2900432EC2 /* CellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E95199F1DDC8B2900432EC2 /* CellView.swift */; }; 24 | C5E064A4512386C0FD579EDE /* Pods_CalendarPopUp.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 09ED5D86FFBE64261F32D8FC /* Pods_CalendarPopUp.framework */; }; 25 | /* End PBXBuildFile section */ 26 | 27 | /* Begin PBXFileReference section */ 28 | 09ED5D86FFBE64261F32D8FC /* Pods_CalendarPopUp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CalendarPopUp.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 29 | 1AC2BF84216E63870047B7C4 /* CalendarLanguageConstants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalendarLanguageConstants.swift; sourceTree = ""; }; 30 | 2454BEC858982D3547CB686A /* Pods-CalendarPopUp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CalendarPopUp.release.xcconfig"; path = "Pods/Target Support Files/Pods-CalendarPopUp/Pods-CalendarPopUp.release.xcconfig"; sourceTree = ""; }; 31 | 8E609D7B1DDCD841005A52F3 /* Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; 32 | 8E71C5A91FE6A41D0050632D /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = SOURCE_ROOT; }; 33 | 8E95197C1DDC47BA00432EC2 /* CalendarPopUp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CalendarPopUp.app; sourceTree = BUILT_PRODUCTS_DIR; }; 34 | 8E95197F1DDC47BA00432EC2 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 35 | 8E9519811DDC47BA00432EC2 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 36 | 8E9519841DDC47BA00432EC2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 37 | 8E9519861DDC47BA00432EC2 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 38 | 8E9519891DDC47BA00432EC2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 39 | 8E95198B1DDC47BA00432EC2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 40 | 8E9519921DDC744A00432EC2 /* PopupContainer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PopupContainer.swift; sourceTree = ""; }; 41 | 8E9519941DDC746100432EC2 /* CalendarPopUp.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CalendarPopUp.swift; sourceTree = ""; }; 42 | 8E9519951DDC746100432EC2 /* CalendarPopUp.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CalendarPopUp.xib; sourceTree = ""; }; 43 | 8E95199C1DDC78FB00432EC2 /* AnimationClass.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AnimationClass.swift; sourceTree = ""; }; 44 | 8E95199E1DDC8B2900432EC2 /* CellView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CellView.xib; sourceTree = ""; }; 45 | 8E95199F1DDC8B2900432EC2 /* CellView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CellView.swift; sourceTree = ""; }; 46 | EAB2E530E12DB72EDA578491 /* Pods-CalendarPopUp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CalendarPopUp.debug.xcconfig"; path = "Pods/Target Support Files/Pods-CalendarPopUp/Pods-CalendarPopUp.debug.xcconfig"; sourceTree = ""; }; 47 | /* End PBXFileReference section */ 48 | 49 | /* Begin PBXFrameworksBuildPhase section */ 50 | 8E9519791DDC47BA00432EC2 /* Frameworks */ = { 51 | isa = PBXFrameworksBuildPhase; 52 | buildActionMask = 2147483647; 53 | files = ( 54 | C5E064A4512386C0FD579EDE /* Pods_CalendarPopUp.framework in Frameworks */, 55 | ); 56 | runOnlyForDeploymentPostprocessing = 0; 57 | }; 58 | /* End PBXFrameworksBuildPhase section */ 59 | 60 | /* Begin PBXGroup section */ 61 | 79D77824ECEAA675E54FDC50 /* Frameworks */ = { 62 | isa = PBXGroup; 63 | children = ( 64 | 09ED5D86FFBE64261F32D8FC /* Pods_CalendarPopUp.framework */, 65 | ); 66 | name = Frameworks; 67 | sourceTree = ""; 68 | }; 69 | 84217A14EDF01AFCB4D7A8C5 /* Pods */ = { 70 | isa = PBXGroup; 71 | children = ( 72 | EAB2E530E12DB72EDA578491 /* Pods-CalendarPopUp.debug.xcconfig */, 73 | 2454BEC858982D3547CB686A /* Pods-CalendarPopUp.release.xcconfig */, 74 | ); 75 | name = Pods; 76 | sourceTree = ""; 77 | }; 78 | 8E9519731DDC47BA00432EC2 = { 79 | isa = PBXGroup; 80 | children = ( 81 | 8E95197E1DDC47BA00432EC2 /* CalendarPopUp */, 82 | 8E95197D1DDC47BA00432EC2 /* Products */, 83 | 84217A14EDF01AFCB4D7A8C5 /* Pods */, 84 | 79D77824ECEAA675E54FDC50 /* Frameworks */, 85 | ); 86 | sourceTree = ""; 87 | }; 88 | 8E95197D1DDC47BA00432EC2 /* Products */ = { 89 | isa = PBXGroup; 90 | children = ( 91 | 8E95197C1DDC47BA00432EC2 /* CalendarPopUp.app */, 92 | ); 93 | name = Products; 94 | sourceTree = ""; 95 | }; 96 | 8E95197E1DDC47BA00432EC2 /* CalendarPopUp */ = { 97 | isa = PBXGroup; 98 | children = ( 99 | 8E9519921DDC744A00432EC2 /* PopupContainer.swift */, 100 | 8E95197F1DDC47BA00432EC2 /* AppDelegate.swift */, 101 | 8E9519811DDC47BA00432EC2 /* ViewController.swift */, 102 | 8E9519831DDC47BA00432EC2 /* Main.storyboard */, 103 | 8E9519941DDC746100432EC2 /* CalendarPopUp.swift */, 104 | 8E9519951DDC746100432EC2 /* CalendarPopUp.xib */, 105 | 8E95199E1DDC8B2900432EC2 /* CellView.xib */, 106 | 8E95199F1DDC8B2900432EC2 /* CellView.swift */, 107 | 8E95199C1DDC78FB00432EC2 /* AnimationClass.swift */, 108 | 8E9519861DDC47BA00432EC2 /* Assets.xcassets */, 109 | 8E9519881DDC47BA00432EC2 /* LaunchScreen.storyboard */, 110 | 8E95198B1DDC47BA00432EC2 /* Info.plist */, 111 | 8E609D7B1DDCD841005A52F3 /* Extensions.swift */, 112 | 8E71C5A91FE6A41D0050632D /* README.md */, 113 | 1AC2BF84216E63870047B7C4 /* CalendarLanguageConstants.swift */, 114 | ); 115 | path = CalendarPopUp; 116 | sourceTree = ""; 117 | }; 118 | /* End PBXGroup section */ 119 | 120 | /* Begin PBXNativeTarget section */ 121 | 8E95197B1DDC47BA00432EC2 /* CalendarPopUp */ = { 122 | isa = PBXNativeTarget; 123 | buildConfigurationList = 8E95198E1DDC47BA00432EC2 /* Build configuration list for PBXNativeTarget "CalendarPopUp" */; 124 | buildPhases = ( 125 | 5BAA3B9B71D82794AEC238D9 /* [CP] Check Pods Manifest.lock */, 126 | 8E9519781DDC47BA00432EC2 /* Sources */, 127 | 8E9519791DDC47BA00432EC2 /* Frameworks */, 128 | 8E95197A1DDC47BA00432EC2 /* Resources */, 129 | 9C306648FA7ED8BD73D098F3 /* [CP] Embed Pods Frameworks */, 130 | ); 131 | buildRules = ( 132 | ); 133 | dependencies = ( 134 | ); 135 | name = CalendarPopUp; 136 | productName = CalendarPopUp; 137 | productReference = 8E95197C1DDC47BA00432EC2 /* CalendarPopUp.app */; 138 | productType = "com.apple.product-type.application"; 139 | }; 140 | /* End PBXNativeTarget section */ 141 | 142 | /* Begin PBXProject section */ 143 | 8E9519741DDC47BA00432EC2 /* Project object */ = { 144 | isa = PBXProject; 145 | attributes = { 146 | LastSwiftUpdateCheck = 0820; 147 | LastUpgradeCheck = 1000; 148 | ORGANIZATIONNAME = Veriloft; 149 | TargetAttributes = { 150 | 8E95197B1DDC47BA00432EC2 = { 151 | CreatedOnToolsVersion = 8.2; 152 | DevelopmentTeam = 683U48NZTT; 153 | LastSwiftMigration = 1000; 154 | ProvisioningStyle = Automatic; 155 | }; 156 | }; 157 | }; 158 | buildConfigurationList = 8E9519771DDC47BA00432EC2 /* Build configuration list for PBXProject "CalendarPopUp" */; 159 | compatibilityVersion = "Xcode 3.2"; 160 | developmentRegion = English; 161 | hasScannedForEncodings = 0; 162 | knownRegions = ( 163 | en, 164 | Base, 165 | ); 166 | mainGroup = 8E9519731DDC47BA00432EC2; 167 | productRefGroup = 8E95197D1DDC47BA00432EC2 /* Products */; 168 | projectDirPath = ""; 169 | projectRoot = ""; 170 | targets = ( 171 | 8E95197B1DDC47BA00432EC2 /* CalendarPopUp */, 172 | ); 173 | }; 174 | /* End PBXProject section */ 175 | 176 | /* Begin PBXResourcesBuildPhase section */ 177 | 8E95197A1DDC47BA00432EC2 /* Resources */ = { 178 | isa = PBXResourcesBuildPhase; 179 | buildActionMask = 2147483647; 180 | files = ( 181 | 8E71C5AA1FE6A41D0050632D /* README.md in Resources */, 182 | 8E9519A01DDC8B2900432EC2 /* CellView.xib in Resources */, 183 | 8E9519971DDC746100432EC2 /* CalendarPopUp.xib in Resources */, 184 | 8E95198A1DDC47BA00432EC2 /* LaunchScreen.storyboard in Resources */, 185 | 8E9519871DDC47BA00432EC2 /* Assets.xcassets in Resources */, 186 | 8E9519851DDC47BA00432EC2 /* Main.storyboard in Resources */, 187 | ); 188 | runOnlyForDeploymentPostprocessing = 0; 189 | }; 190 | /* End PBXResourcesBuildPhase section */ 191 | 192 | /* Begin PBXShellScriptBuildPhase section */ 193 | 5BAA3B9B71D82794AEC238D9 /* [CP] Check Pods Manifest.lock */ = { 194 | isa = PBXShellScriptBuildPhase; 195 | buildActionMask = 2147483647; 196 | files = ( 197 | ); 198 | inputPaths = ( 199 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 200 | "${PODS_ROOT}/Manifest.lock", 201 | ); 202 | name = "[CP] Check Pods Manifest.lock"; 203 | outputPaths = ( 204 | "$(DERIVED_FILE_DIR)/Pods-CalendarPopUp-checkManifestLockResult.txt", 205 | ); 206 | runOnlyForDeploymentPostprocessing = 0; 207 | shellPath = /bin/sh; 208 | 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"; 209 | showEnvVarsInLog = 0; 210 | }; 211 | 9C306648FA7ED8BD73D098F3 /* [CP] Embed Pods Frameworks */ = { 212 | isa = PBXShellScriptBuildPhase; 213 | buildActionMask = 2147483647; 214 | files = ( 215 | ); 216 | inputPaths = ( 217 | "${SRCROOT}/Pods/Target Support Files/Pods-CalendarPopUp/Pods-CalendarPopUp-frameworks.sh", 218 | "${BUILT_PRODUCTS_DIR}/JTAppleCalendar/JTAppleCalendar.framework", 219 | ); 220 | name = "[CP] Embed Pods Frameworks"; 221 | outputPaths = ( 222 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/JTAppleCalendar.framework", 223 | ); 224 | runOnlyForDeploymentPostprocessing = 0; 225 | shellPath = /bin/sh; 226 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CalendarPopUp/Pods-CalendarPopUp-frameworks.sh\"\n"; 227 | showEnvVarsInLog = 0; 228 | }; 229 | /* End PBXShellScriptBuildPhase section */ 230 | 231 | /* Begin PBXSourcesBuildPhase section */ 232 | 8E9519781DDC47BA00432EC2 /* Sources */ = { 233 | isa = PBXSourcesBuildPhase; 234 | buildActionMask = 2147483647; 235 | files = ( 236 | 8E9519961DDC746100432EC2 /* CalendarPopUp.swift in Sources */, 237 | 8E9519821DDC47BA00432EC2 /* ViewController.swift in Sources */, 238 | 8E9519A11DDC8B2900432EC2 /* CellView.swift in Sources */, 239 | 8E9519931DDC744A00432EC2 /* PopupContainer.swift in Sources */, 240 | 8E9519801DDC47BA00432EC2 /* AppDelegate.swift in Sources */, 241 | 1AC2BF85216E63870047B7C4 /* CalendarLanguageConstants.swift in Sources */, 242 | 8E95199D1DDC78FB00432EC2 /* AnimationClass.swift in Sources */, 243 | 8E609D7C1DDCD841005A52F3 /* Extensions.swift in Sources */, 244 | ); 245 | runOnlyForDeploymentPostprocessing = 0; 246 | }; 247 | /* End PBXSourcesBuildPhase section */ 248 | 249 | /* Begin PBXVariantGroup section */ 250 | 8E9519831DDC47BA00432EC2 /* Main.storyboard */ = { 251 | isa = PBXVariantGroup; 252 | children = ( 253 | 8E9519841DDC47BA00432EC2 /* Base */, 254 | ); 255 | name = Main.storyboard; 256 | sourceTree = ""; 257 | }; 258 | 8E9519881DDC47BA00432EC2 /* LaunchScreen.storyboard */ = { 259 | isa = PBXVariantGroup; 260 | children = ( 261 | 8E9519891DDC47BA00432EC2 /* Base */, 262 | ); 263 | name = LaunchScreen.storyboard; 264 | sourceTree = ""; 265 | }; 266 | /* End PBXVariantGroup section */ 267 | 268 | /* Begin XCBuildConfiguration section */ 269 | 8E95198C1DDC47BA00432EC2 /* Debug */ = { 270 | isa = XCBuildConfiguration; 271 | buildSettings = { 272 | ALWAYS_SEARCH_USER_PATHS = NO; 273 | CLANG_ANALYZER_NONNULL = YES; 274 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 275 | CLANG_CXX_LIBRARY = "libc++"; 276 | CLANG_ENABLE_MODULES = YES; 277 | CLANG_ENABLE_OBJC_ARC = YES; 278 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 279 | CLANG_WARN_BOOL_CONVERSION = YES; 280 | CLANG_WARN_COMMA = YES; 281 | CLANG_WARN_CONSTANT_CONVERSION = YES; 282 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 283 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 284 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 285 | CLANG_WARN_EMPTY_BODY = YES; 286 | CLANG_WARN_ENUM_CONVERSION = YES; 287 | CLANG_WARN_INFINITE_RECURSION = YES; 288 | CLANG_WARN_INT_CONVERSION = YES; 289 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 290 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 291 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 292 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 293 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 294 | CLANG_WARN_STRICT_PROTOTYPES = YES; 295 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 296 | CLANG_WARN_UNREACHABLE_CODE = YES; 297 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 298 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 299 | COPY_PHASE_STRIP = NO; 300 | DEBUG_INFORMATION_FORMAT = dwarf; 301 | ENABLE_STRICT_OBJC_MSGSEND = YES; 302 | ENABLE_TESTABILITY = YES; 303 | GCC_C_LANGUAGE_STANDARD = gnu99; 304 | GCC_DYNAMIC_NO_PIC = NO; 305 | GCC_NO_COMMON_BLOCKS = YES; 306 | GCC_OPTIMIZATION_LEVEL = 0; 307 | GCC_PREPROCESSOR_DEFINITIONS = ( 308 | "DEBUG=1", 309 | "$(inherited)", 310 | ); 311 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 312 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 313 | GCC_WARN_UNDECLARED_SELECTOR = YES; 314 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 315 | GCC_WARN_UNUSED_FUNCTION = YES; 316 | GCC_WARN_UNUSED_VARIABLE = YES; 317 | IPHONEOS_DEPLOYMENT_TARGET = 10.2; 318 | MTL_ENABLE_DEBUG_INFO = YES; 319 | ONLY_ACTIVE_ARCH = YES; 320 | SDKROOT = iphoneos; 321 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 322 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 323 | TARGETED_DEVICE_FAMILY = "1,2"; 324 | }; 325 | name = Debug; 326 | }; 327 | 8E95198D1DDC47BA00432EC2 /* Release */ = { 328 | isa = XCBuildConfiguration; 329 | buildSettings = { 330 | ALWAYS_SEARCH_USER_PATHS = NO; 331 | CLANG_ANALYZER_NONNULL = YES; 332 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 333 | CLANG_CXX_LIBRARY = "libc++"; 334 | CLANG_ENABLE_MODULES = YES; 335 | CLANG_ENABLE_OBJC_ARC = YES; 336 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 337 | CLANG_WARN_BOOL_CONVERSION = YES; 338 | CLANG_WARN_COMMA = YES; 339 | CLANG_WARN_CONSTANT_CONVERSION = YES; 340 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 341 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 342 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 343 | CLANG_WARN_EMPTY_BODY = YES; 344 | CLANG_WARN_ENUM_CONVERSION = YES; 345 | CLANG_WARN_INFINITE_RECURSION = YES; 346 | CLANG_WARN_INT_CONVERSION = YES; 347 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 348 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 349 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 350 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 351 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 352 | CLANG_WARN_STRICT_PROTOTYPES = YES; 353 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 354 | CLANG_WARN_UNREACHABLE_CODE = YES; 355 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 356 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 357 | COPY_PHASE_STRIP = NO; 358 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 359 | ENABLE_NS_ASSERTIONS = NO; 360 | ENABLE_STRICT_OBJC_MSGSEND = YES; 361 | GCC_C_LANGUAGE_STANDARD = gnu99; 362 | GCC_NO_COMMON_BLOCKS = YES; 363 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 364 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 365 | GCC_WARN_UNDECLARED_SELECTOR = YES; 366 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 367 | GCC_WARN_UNUSED_FUNCTION = YES; 368 | GCC_WARN_UNUSED_VARIABLE = YES; 369 | IPHONEOS_DEPLOYMENT_TARGET = 10.2; 370 | MTL_ENABLE_DEBUG_INFO = NO; 371 | SDKROOT = iphoneos; 372 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 373 | TARGETED_DEVICE_FAMILY = "1,2"; 374 | VALIDATE_PRODUCT = YES; 375 | }; 376 | name = Release; 377 | }; 378 | 8E95198F1DDC47BA00432EC2 /* Debug */ = { 379 | isa = XCBuildConfiguration; 380 | baseConfigurationReference = EAB2E530E12DB72EDA578491 /* Pods-CalendarPopUp.debug.xcconfig */; 381 | buildSettings = { 382 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 383 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 384 | DEVELOPMENT_TEAM = 683U48NZTT; 385 | INFOPLIST_FILE = CalendarPopUp/Info.plist; 386 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 387 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 388 | PRODUCT_BUNDLE_IDENTIFIER = com.veriloft.CalendarPopUp; 389 | PRODUCT_NAME = "$(TARGET_NAME)"; 390 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 391 | SWIFT_VERSION = 4.2; 392 | }; 393 | name = Debug; 394 | }; 395 | 8E9519901DDC47BA00432EC2 /* Release */ = { 396 | isa = XCBuildConfiguration; 397 | baseConfigurationReference = 2454BEC858982D3547CB686A /* Pods-CalendarPopUp.release.xcconfig */; 398 | buildSettings = { 399 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 400 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 401 | DEVELOPMENT_TEAM = 683U48NZTT; 402 | INFOPLIST_FILE = CalendarPopUp/Info.plist; 403 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 404 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 405 | PRODUCT_BUNDLE_IDENTIFIER = com.veriloft.CalendarPopUp; 406 | PRODUCT_NAME = "$(TARGET_NAME)"; 407 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 408 | SWIFT_VERSION = 4.2; 409 | }; 410 | name = Release; 411 | }; 412 | /* End XCBuildConfiguration section */ 413 | 414 | /* Begin XCConfigurationList section */ 415 | 8E9519771DDC47BA00432EC2 /* Build configuration list for PBXProject "CalendarPopUp" */ = { 416 | isa = XCConfigurationList; 417 | buildConfigurations = ( 418 | 8E95198C1DDC47BA00432EC2 /* Debug */, 419 | 8E95198D1DDC47BA00432EC2 /* Release */, 420 | ); 421 | defaultConfigurationIsVisible = 0; 422 | defaultConfigurationName = Release; 423 | }; 424 | 8E95198E1DDC47BA00432EC2 /* Build configuration list for PBXNativeTarget "CalendarPopUp" */ = { 425 | isa = XCConfigurationList; 426 | buildConfigurations = ( 427 | 8E95198F1DDC47BA00432EC2 /* Debug */, 428 | 8E9519901DDC47BA00432EC2 /* Release */, 429 | ); 430 | defaultConfigurationIsVisible = 0; 431 | defaultConfigurationName = Release; 432 | }; 433 | /* End XCConfigurationList section */ 434 | }; 435 | rootObject = 8E9519741DDC47BA00432EC2 /* Project object */; 436 | } 437 | -------------------------------------------------------------------------------- /CalendarPopUp.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CalendarPopUp.xcodeproj/project.xcworkspace/xcuserdata/atakishiyev.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orazz/CalendarPopUp/cfc88c40a5a9c66205165d4f5765bd57d062231e/CalendarPopUp.xcodeproj/project.xcworkspace/xcuserdata/atakishiyev.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /CalendarPopUp.xcodeproj/xcuserdata/atakishiyev.xcuserdatad/xcschemes/CalendarPopUp.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 33 | 34 | 40 | 41 | 42 | 43 | 44 | 45 | 56 | 58 | 64 | 65 | 66 | 67 | 68 | 69 | 75 | 77 | 83 | 84 | 85 | 86 | 88 | 89 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /CalendarPopUp.xcodeproj/xcuserdata/atakishiyev.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | CalendarPopUp.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 8E95197B1DDC47BA00432EC2 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /CalendarPopUp.xcodeproj/xcuserdata/sistemas.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | CalendarPopUp.xcscheme 8 | 9 | orderHint 10 | 2 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /CalendarPopUp.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /CalendarPopUp.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /CalendarPopUp.xcworkspace/xcuserdata/atakishiyev.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /CalendarPopUp.xcworkspace/xcuserdata/sistemas.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orazz/CalendarPopUp/cfc88c40a5a9c66205165d4f5765bd57d062231e/CalendarPopUp.xcworkspace/xcuserdata/sistemas.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /CalendarPopUp.xcworkspace/xcuserdata/sistemas.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /CalendarPopUp/AnimationClass.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AnimationClass.swift 3 | // testApplicationCalendar 4 | // 5 | // Created by JayT on 2016-03-06. 6 | // Copyright © 2016 OS-Tech. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | class AnimationClass { 11 | 12 | class func BounceEffect() -> (UIView, @escaping (Bool) -> Void) -> () { 13 | 14 | return { 15 | view, completion in 16 | view.transform = CGAffineTransform(scaleX: 0.5, y: 0.5) 17 | UIView.animate( 18 | withDuration: 0.5, 19 | delay: 0, usingSpringWithDamping: 0.3, 20 | initialSpringVelocity: 0.1, 21 | options: UIView.AnimationOptions.beginFromCurrentState, 22 | animations: { 23 | view.transform = CGAffineTransform(scaleX: 1, y: 1) 24 | }, 25 | completion: completion 26 | ) 27 | } 28 | 29 | } 30 | 31 | class func fadeOutEffect() -> (UIView, @escaping (Bool) -> Void) -> () { 32 | 33 | return { 34 | view, completion in 35 | UIView.animate(withDuration: 0.6, 36 | delay: 0, usingSpringWithDamping: 0.6, 37 | initialSpringVelocity: 0, 38 | options: [], 39 | animations: { 40 | view.alpha = 0 41 | }, 42 | completion: completion) 43 | } 44 | 45 | } 46 | 47 | fileprivate class func get3DTransformation(_ angle: Double) -> 48 | CATransform3D { 49 | var transform = CATransform3DIdentity 50 | transform.m34 = -1.0 / 500.0 51 | transform = CATransform3DRotate(transform, 52 | CGFloat(angle * Double.pi / 180.0), 0, 1, 0.0) 53 | return transform 54 | } 55 | 56 | class func flipAnimation(_ view: UIView, completion: (() -> Void)?) { 57 | let angle = 180.0 58 | view.layer.transform = get3DTransformation(angle) 59 | UIView.animate(withDuration: 1, 60 | delay: 0, 61 | usingSpringWithDamping: 0.5, 62 | initialSpringVelocity: 0, 63 | options: [], 64 | animations: { () -> Void in 65 | view.layer.transform = CATransform3DIdentity 66 | }) { (finished) -> Void in 67 | completion?() 68 | } 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /CalendarPopUp/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // CalendarPopUp 4 | // 5 | // Created by Atakishiyev Orazdurdy on 11/16/16. 6 | // Copyright © 2016 Veriloft. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(_ application: UIApplication) { 23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 24 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 25 | } 26 | 27 | func applicationDidEnterBackground(_ application: UIApplication) { 28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(_ application: UIApplication) { 33 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | func applicationDidBecomeActive(_ application: UIApplication) { 37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 38 | } 39 | 40 | func applicationWillTerminate(_ application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /CalendarPopUp/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /CalendarPopUp/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 | -------------------------------------------------------------------------------- /CalendarPopUp/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 | 31 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /CalendarPopUp/CalendarLanguageConstants.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CalendarLanguageConstants.swift 3 | // CalendarPopUp 4 | // 5 | // Created by sistemas on 10/10/18. 6 | // Copyright © 2018 Veriloft. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | let weekArr_Tk: [Int: String] = 12 | [ 01 : "Duşenbe", 13 | 02 : "Sişenbe", 14 | 03 : "Çarşenbe", 15 | 04 : "Penşenbe", 16 | 05 : "Anna", 17 | 06 : "Şenbe", 18 | 07 : "Ýekşenbe", 19 | ] 20 | let monthArr_Tk: [Int: String] = 21 | [ 01 : "Ýanwar", 22 | 02 : "Fewral", 23 | 03 : "Mart", 24 | 04 : "Aprel", 25 | 05 : "Maý", 26 | 06 : "Iýun", 27 | 07 : "Iýul", 28 | 08 : "Awgust", 29 | 09 : "Sentýabr", 30 | 10 : "Oktýabr", 31 | 11 : "Noýabr", 32 | 12 : "Dekabr"] 33 | 34 | let weekArr_Sp: [Int: String] = 35 | [ 01 : "Lunes", 36 | 02 : "Martes", 37 | 03 : "Miércoles", 38 | 04 : "Jueves", 39 | 05 : "Viernes", 40 | 06 : "Sábado", 41 | 07 : "Domingo", 42 | ] 43 | let monthArr_Sp: [Int: String] = 44 | [ 01 : "Enero", 45 | 02 : "Febrero", 46 | 03 : "Marzo", 47 | 04 : "Abril", 48 | 05 : "Mayo", 49 | 06 : "Junio", 50 | 07 : "Julio", 51 | 08 : "Agosto", 52 | 09 : "Septiembre", 53 | 10 : "Octubre", 54 | 11 : "Noviembre", 55 | 12 : "Diciembre"] 56 | 57 | 58 | let weekArr_En: [Int: String] = 59 | [ 01 : "Monday", 60 | 02 : "Tuesday", 61 | 03 : "Wednesday", 62 | 04 : "Thursday", 63 | 05 : "Friday", 64 | 06 : "Saturday", 65 | 07 : "Sunday", 66 | ] 67 | let monthArr_En: [Int: String] = 68 | [ 01 : "January", 69 | 02 : "February", 70 | 03 : "March", 71 | 04 : "April", 72 | 05 : "May", 73 | 06 : "June", 74 | 07 : "July", 75 | 08 : "August", 76 | 09 : "September", 77 | 10 : "October", 78 | 11 : "November", 79 | 12 : "December"] 80 | 81 | 82 | let weekArr_De: [Int: String] = 83 | [ 01 : "Montag", 84 | 02 : "Dienstag", 85 | 03 : "Mittwoch", 86 | 04 : "Donnerstag", 87 | 05 : "Freitag", 88 | 06 : "Samstag", 89 | 07 : "Sonntag", 90 | ] 91 | let monthArr_De: [Int: String] = 92 | [ 01 : "Januar", 93 | 02 : "Februar", 94 | 03 : "Marz", 95 | 04 : "April", 96 | 05 : "Mai", 97 | 06 : "Juni", 98 | 07 : "Juli", 99 | 08 : "August", 100 | 09 : "September", 101 | 10 : "Oktober", 102 | 11 : "November", 103 | 12 : "Dezember"] 104 | 105 | 106 | let weekArr_It: [Int: String] = 107 | [ 01 : "lunedì", 108 | 02 : "martedì", 109 | 03 : "mercoledì", 110 | 04 : "giovedì", 111 | 05 : "venerdì", 112 | 06 : "sabato", 113 | 07 : "domenica", 114 | ] 115 | let monthArr_It: [Int: String] = 116 | [ 01 : "Gennaio", 117 | 02 : "Febbraio", 118 | 03 : "Marzo", 119 | 04 : "Aprile", 120 | 05 : "Maggio", 121 | 06 : "Giugno", 122 | 07 : "Luglio", 123 | 08 : "Agosto", 124 | 09 : "Settembre", 125 | 10 : "Ottobre", 126 | 11 : "Novembre", 127 | 12 : "Dicembre"] 128 | 129 | 130 | -------------------------------------------------------------------------------- /CalendarPopUp/CalendarPopUp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CalendarPopUp.swift 3 | // CalendarPopUp 4 | // 5 | // Created by Atakishiyev Orazdurdy on 11/16/16. 6 | // Copyright © 2016 Veriloft. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import JTAppleCalendar 11 | 12 | protocol CalendarPopUpDelegate: class { 13 | func dateChaged(date: Date) 14 | } 15 | 16 | class CalendarPopUp: UIView { 17 | 18 | @IBOutlet weak var calendarHeaderLabel: UILabel! 19 | @IBOutlet weak var calendarView: JTAppleCalendarView! 20 | @IBOutlet weak var dateLabel: UILabel! 21 | 22 | weak var calendarDelegate: CalendarPopUpDelegate? 23 | 24 | let calLanguage: CalendarLanguage = .turkmen 25 | var endDate: Date! 26 | var startDate: Date = Date().getStart() 27 | var testCalendar = Calendar(identifier: .gregorian) 28 | var selectedDate: Date! = Date() { 29 | didSet { 30 | setDate() 31 | } 32 | } 33 | var selected:Date = Date() { 34 | didSet { 35 | 36 | calendarView.scrollToDate(selected) 37 | calendarView.selectDates([selected]) 38 | } 39 | } 40 | 41 | @IBAction func closePopupButtonPressed(_ sender: AnyObject) { 42 | if let superView = self.superview as? PopupContainer { 43 | (superView ).close() 44 | } 45 | } 46 | 47 | @IBAction func GetDateOk(_ sender: Any) { 48 | calendarDelegate?.dateChaged(date: selectedDate) 49 | if let superView = self.superview as? PopupContainer { 50 | (superView ).close() 51 | } 52 | } 53 | 54 | override func awakeFromNib() { 55 | //Calendar 56 | // You can also use dates created from this function 57 | endDate = Calendar.current.date(byAdding: .month, value: 2, to: startDate)! 58 | setCalendar() 59 | setDate() 60 | self.calendarView.visibleDates {[unowned self] (visibleDates: DateSegmentInfo) in 61 | self.setupViewsOfCalendar(from: visibleDates) 62 | } 63 | let cornerRadius = CGFloat(10.0) 64 | let shadowOpacity = Float(1) 65 | self.layer.cornerRadius = cornerRadius 66 | let shadowPath = UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius) 67 | layer.masksToBounds = false 68 | layer.shadowColor = UIColor.gray.cgColor 69 | layer.shadowOffset = CGSize(width: 2, height: 5) 70 | layer.shadowOpacity = shadowOpacity 71 | layer.shadowPath = shadowPath.cgPath 72 | } 73 | 74 | func setDate() { 75 | let month = testCalendar.dateComponents([.month], from: selectedDate).month! 76 | let weekday = testCalendar.component(.weekday, from: selectedDate) 77 | 78 | let monthName = GetHumanDate(month: month, language: calLanguage) // DateFormatter().monthSymbols[(month-1) % 12] // 79 | let week = GetWeekByLang(weekDay: weekday, language: calLanguage) // DateFormatter().shortWeekdaySymbols[weekday-1] 80 | 81 | let day = testCalendar.component(.day, from: selectedDate) 82 | 83 | dateLabel.text = "\(week), " + monthName + " " + String(day) 84 | } 85 | 86 | func setupViewsOfCalendar(from visibleDates: DateSegmentInfo) { 87 | guard let startDate = visibleDates.monthDates.first?.date else { 88 | return 89 | } 90 | let month = testCalendar.dateComponents([.month], from: startDate).month! 91 | let monthName = GetHumanDate(month: month, language: calLanguage) // DateFormatter().monthSymbols[Int(month.month!)-1] 92 | 93 | let year = testCalendar.component(.year, from: startDate) 94 | calendarHeaderLabel.text = monthName + ", " + String(year) 95 | } 96 | 97 | func setCalendar() { 98 | calendarView.calendarDataSource = self 99 | calendarView.calendarDelegate = self 100 | let nibName = UINib(nibName: "CellView", bundle:nil) 101 | calendarView.register(nibName, forCellWithReuseIdentifier: "CellView") 102 | calendarView.minimumLineSpacing = 0 103 | calendarView.minimumInteritemSpacing = 0 104 | } 105 | 106 | } 107 | 108 | // MARK : JTAppleCalendarDelegate 109 | extension CalendarPopUp: JTAppleCalendarViewDelegate, JTAppleCalendarViewDataSource { 110 | 111 | func configureCalendar(_ calendar: JTAppleCalendarView) -> ConfigurationParameters { 112 | let formatter = DateFormatter() 113 | formatter.dateFormat = "yyyy MM dd" 114 | 115 | let parameters = ConfigurationParameters(startDate: startDate, 116 | endDate: endDate, 117 | numberOfRows: 6, 118 | calendar: testCalendar, 119 | generateInDates: .forAllMonths, 120 | generateOutDates: .tillEndOfGrid, 121 | firstDayOfWeek: DaysOfWeek.monday) 122 | 123 | return parameters 124 | } 125 | 126 | func calendar(_ calendar: JTAppleCalendarView, willDisplay cell: JTAppleCell, forItemAt date: Date, cellState: CellState, indexPath: IndexPath) { 127 | (cell as? CellView)?.handleCellSelection(cellState: cellState, date: date, selectedDate: selectedDate) 128 | } 129 | 130 | 131 | func calendar(_ calendar: JTAppleCalendarView, cellForItemAt date: Date, cellState: CellState, indexPath: IndexPath) -> JTAppleCell { 132 | let myCustomCell = calendar.dequeueReusableCell(withReuseIdentifier: "CellView", for: indexPath) as! CellView 133 | myCustomCell.handleCellSelection(cellState: cellState, date: date, selectedDate: selectedDate) 134 | return myCustomCell 135 | } 136 | 137 | func calendar(_ calendar: JTAppleCalendarView, didSelectDate date: Date, cell: JTAppleCell?, cellState: CellState) { 138 | selectedDate = date 139 | (cell as? CellView)?.cellSelectionChanged(cellState, date: date) 140 | } 141 | 142 | func calendar(_ calendar: JTAppleCalendarView, didDeselectDate date: Date, cell: JTAppleCell?, cellState: CellState) { 143 | (cell as? CellView)?.cellSelectionChanged(cellState, date: date) 144 | } 145 | 146 | func calendar(_ calendar: JTAppleCalendarView, willResetCell cell: JTAppleCell) { 147 | (cell as? CellView)?.selectedView.isHidden = true 148 | } 149 | 150 | func calendar(_ calendar: JTAppleCalendarView, didScrollToDateSegmentWith visibleDates: DateSegmentInfo) { 151 | self.setupViewsOfCalendar(from: visibleDates) 152 | } 153 | } 154 | 155 | -------------------------------------------------------------------------------- /CalendarPopUp/CalendarPopUp.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 43 | 52 | 61 | 70 | 79 | 88 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 140 | 141 | 142 | 143 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | -------------------------------------------------------------------------------- /CalendarPopUp/CellView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CellView.swift 3 | // Swipe 4 | // 5 | // Created by Yasuhiro Saigo on 2016/10/23. 6 | // Copyright © 2016年 YASUHIRO SAIGO. All rights reserved. 7 | // 8 | 9 | import JTAppleCalendar 10 | 11 | private let preDateSelectable: Bool = true 12 | private let todayColor: UIColor = UIColor.black 13 | private let selectableDateColor: UIColor = .white 14 | private let selectedRoundColor: UIColor = UIColor(hex: 0xA9620C) 15 | 16 | class CellView: JTAppleCell { 17 | 18 | @IBOutlet weak var stableBackView: AnimationView! 19 | @IBOutlet var selectedView: AnimationView! 20 | @IBOutlet var dayLabel: UILabel! 21 | 22 | override func awakeFromNib() { 23 | //self.stableBackView.layer.cornerRadius = self.frame.height * 0.13 24 | //self.stableBackView.layer.borderColor = UIColor.white.cgColor 25 | //self.stableBackView.layer.borderWidth = 0.3 26 | } 27 | 28 | func handleCellSelection(cellState: CellState, date: Date, selectedDate: Date) { 29 | 30 | //InDate, OutDate 31 | if cellState.dateBelongsTo != .thisMonth { 32 | self.dayLabel.text = "" 33 | self.isUserInteractionEnabled = false 34 | self.stableBackView.isHidden = true 35 | } else if date.isSmaller(to: Date()) && !preDateSelectable { 36 | self.dayLabel.text = "-" 37 | self.dayLabel.textColor = UIColor.white 38 | self.isUserInteractionEnabled = false 39 | self.stableBackView.isHidden = true 40 | }else{ 41 | self.stableBackView.isHidden = false 42 | self.isUserInteractionEnabled = true 43 | dayLabel.text = cellState.text 44 | dayLabel.textColor = selectableDateColor 45 | } 46 | 47 | configueViewIntoBubbleView(cellState, date: date) 48 | 49 | if date.isEqual(to: Date()) { 50 | if !cellState.isSelected { 51 | self.dayLabel.textColor = todayColor 52 | } 53 | } 54 | } 55 | 56 | func cellSelectionChanged(_ cellState: CellState, date: Date) { 57 | if cellState.isSelected == true { 58 | if self.selectedView.isHidden == true { 59 | configueViewIntoBubbleView(cellState, date: date) 60 | self.selectedView.animateWithBounceEffect(withCompletionHandler: { 61 | }) 62 | } 63 | } else { 64 | configueViewIntoBubbleView(cellState, date: date, animateDeselection: true) 65 | } 66 | } 67 | 68 | fileprivate func configueViewIntoBubbleView(_ cellState: CellState, date: Date, animateDeselection: Bool = false) { 69 | if cellState.isSelected && self.isUserInteractionEnabled { 70 | self.selectedView.isHidden = false 71 | self.selectedView.layer.cornerRadius = self.frame.height * 0.37 72 | self.selectedView.layer.backgroundColor = selectedRoundColor.cgColor 73 | self.dayLabel.textColor = .white 74 | } else { 75 | if animateDeselection { 76 | if date.isEqual(to: Date()) 77 | { 78 | self.dayLabel.textColor = todayColor 79 | }else{ 80 | self.dayLabel.textColor = selectableDateColor 81 | } 82 | if self.selectedView.isHidden == false { 83 | self.selectedView.animateWithFadeEffect(withCompletionHandler: { () -> Void in 84 | self.selectedView.isHidden = true 85 | self.selectedView.alpha = 1 86 | }) 87 | } 88 | } else { 89 | self.selectedView.isHidden = true 90 | } 91 | } 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /CalendarPopUp/CellView.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 27 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /CalendarPopUp/Extensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Extensions.swift 3 | // CalendarPopUp 4 | // 5 | // Created by Atakishiyev Orazdurdy on 11/16/16. 6 | // Copyright © 2016 Veriloft. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | // 12 | // Get week 13 | // 14 | // 15 | enum CalendarLanguage { 16 | case turkmen 17 | case english 18 | case spanish 19 | case deutsch 20 | case italian 21 | } 22 | 23 | func GetWeekByLang(weekDay: Int, language: CalendarLanguage = .spanish) -> String 24 | { 25 | switch language { 26 | case .turkmen: 27 | return weekArr_Tk[weekDay]! 28 | case .deutsch: 29 | return weekArr_De[weekDay]! 30 | case .english: 31 | return weekArr_En[weekDay]! 32 | case .italian: 33 | return weekArr_It[weekDay]! 34 | case .spanish: 35 | return weekArr_Sp[weekDay]! 36 | } 37 | } 38 | 39 | // 40 | // Get humanDate 41 | // Turkmen month 42 | // 43 | 44 | func GetHumanDate(month: Int, language: CalendarLanguage = .spanish) -> String 45 | { 46 | switch language { 47 | case .turkmen: 48 | return monthArr_Tk[month]! 49 | case .deutsch: 50 | return monthArr_De[month]! 51 | case .english: 52 | return monthArr_En[month]! 53 | case .italian: 54 | return monthArr_It[month]! 55 | case .spanish: 56 | return monthArr_Sp[month]! 57 | } 58 | } 59 | 60 | extension Date { 61 | 62 | //period -> .WeekOfYear, .Day 63 | func rangeOfPeriod(period: Calendar.Component) -> (Date, Date) { 64 | 65 | var startDate = Date() 66 | var interval : TimeInterval = 0 67 | let _ = Calendar.current.dateInterval(of: period, start: &startDate, interval: &interval, for: self) 68 | let endDate = startDate.addingTimeInterval(interval - 1) 69 | 70 | return (startDate, endDate) 71 | } 72 | 73 | func calcStartAndEndOfDay() -> (Date, Date) { 74 | return rangeOfPeriod(period: .day) 75 | } 76 | 77 | func calcStartAndEndOfWeek() -> (Date, Date) { 78 | return rangeOfPeriod(period: .weekday) 79 | } 80 | 81 | func calcStartAndEndOfMonth() -> (Date, Date) { 82 | return rangeOfPeriod(period: .month) 83 | } 84 | 85 | func getSpecificDate(interval: Int) -> Date { 86 | var timeInterval = DateComponents() 87 | timeInterval.day = interval 88 | return Calendar.current.date(byAdding: timeInterval, to: self)! 89 | } 90 | 91 | func getStart() -> Date { 92 | let (start, _) = calcStartAndEndOfDay() 93 | return start 94 | } 95 | 96 | func getEnd() -> Date { 97 | let (_, end) = calcStartAndEndOfDay() 98 | return end 99 | } 100 | 101 | func isBigger(to: Date) -> Bool { 102 | return Calendar.current.compare(self, to: to, toGranularity: .day) == .orderedDescending ? true : false 103 | } 104 | 105 | func isSmaller(to: Date) -> Bool { 106 | return Calendar.current.compare(self, to: to, toGranularity: .day) == .orderedAscending ? true : false 107 | } 108 | 109 | func isEqual(to: Date) -> Bool { 110 | return Calendar.current.isDate(self, inSameDayAs: to) 111 | } 112 | 113 | func isElement(of: [Date]) -> Bool { 114 | for element in of { 115 | if self.isEqual(to: element) { 116 | return true 117 | } 118 | } 119 | return false 120 | } 121 | 122 | func getElement(of: [Date]) -> Date { 123 | for element in of { 124 | if self.isEqual(to: element) { 125 | return element 126 | } 127 | } 128 | return Date() 129 | } 130 | 131 | } 132 | 133 | class AnimationView: UIView { 134 | func animateWithFlipEffect(withCompletionHandler completionHandler:(() -> Void)?) { 135 | AnimationClass.flipAnimation(self, completion: completionHandler) 136 | } 137 | func animateWithBounceEffect(withCompletionHandler completionHandler:(() -> Void)?) { 138 | let viewAnimation = AnimationClass.BounceEffect() 139 | viewAnimation(self) { _ in 140 | completionHandler?() 141 | } 142 | } 143 | func animateWithFadeEffect(withCompletionHandler completionHandler:(() -> Void)?) { 144 | let viewAnimation = AnimationClass.fadeOutEffect() 145 | viewAnimation(self) { _ in 146 | completionHandler?() 147 | } 148 | } 149 | } 150 | 151 | extension UIColor { 152 | 153 | convenience init(hex: Int, alpha: CGFloat = 1.0) { 154 | let red = CGFloat((hex & 0xFF0000) >> 16) / 255.0 155 | let green = CGFloat((hex & 0xFF00) >> 8) / 255.0 156 | let blue = CGFloat((hex & 0xFF)) / 255.0 157 | self.init(red:red, green:green, blue:blue, alpha:alpha) 158 | } 159 | 160 | } 161 | 162 | 163 | -------------------------------------------------------------------------------- /CalendarPopUp/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /CalendarPopUp/PopupContainer.swift: -------------------------------------------------------------------------------- 1 | // PopupContainer.swift 2 | // 3 | // Copyright (c) 2015 Technopix ( http://www.technopix.com.ar ) 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 13 | // all 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 21 | // THE SOFTWARE. 22 | 23 | import UIKit 24 | 25 | private let kDialogViewCornerRadius : CGFloat = 3 26 | 27 | open class PopupContainer: UIView { 28 | 29 | let kMotionEffectExtent : CGFloat = 10 30 | 31 | var dialogView : UIView! 32 | 33 | open class func generatePopupWithView(_ view: UIView) -> PopupContainer{ 34 | let popupContainer = PopupContainer() 35 | 36 | UIDevice.current.beginGeneratingDeviceOrientationNotifications() 37 | NotificationCenter.default.addObserver( 38 | popupContainer, 39 | selector: #selector(PopupContainer.interfaceOrientationChanged(_:)), 40 | name: UIDevice.orientationDidChangeNotification, 41 | object: nil) 42 | 43 | popupContainer.dialogView = view; 44 | popupContainer.dialogView.layer.cornerRadius = kDialogViewCornerRadius 45 | 46 | return popupContainer; 47 | } 48 | 49 | // MARK: - Initialization and deinitialization methods 50 | 51 | deinit { 52 | NotificationCenter.default.removeObserver(self) 53 | UIDevice.current.endGeneratingDeviceOrientationNotifications() 54 | } 55 | 56 | // MARK: Setup UI methods 57 | 58 | func applyMotionEffects() { 59 | let horizontalEfect = UIInterpolatingMotionEffect(keyPath: "center.x", type: .tiltAlongHorizontalAxis) 60 | horizontalEfect.minimumRelativeValue = -kMotionEffectExtent 61 | horizontalEfect.maximumRelativeValue = kMotionEffectExtent 62 | 63 | let verticalEffect = UIInterpolatingMotionEffect(keyPath: "center.y", type: .tiltAlongVerticalAxis) 64 | verticalEffect.minimumRelativeValue = -kMotionEffectExtent 65 | verticalEffect.maximumRelativeValue = kMotionEffectExtent 66 | 67 | let motionEffectGroup = UIMotionEffectGroup() 68 | motionEffectGroup.motionEffects = [horizontalEfect, verticalEffect] 69 | 70 | self.dialogView.addMotionEffect(motionEffectGroup) 71 | } 72 | 73 | @objc func interfaceOrientationChanged(_ notification: Notification) { 74 | var rotationAngle : CGFloat = 0 75 | 76 | switch UIApplication.shared.statusBarOrientation { 77 | case .landscapeLeft: rotationAngle = CGFloat(Double.pi/2) * 3 78 | case .landscapeRight: rotationAngle = CGFloat(Double.pi/2) 79 | case .portrait: rotationAngle = 0 80 | case .portraitUpsideDown: rotationAngle = CGFloat(Double.pi) 81 | default: rotationAngle = 0 82 | } 83 | 84 | UIView.animate( 85 | withDuration: 0.5, 86 | delay: 0.0, 87 | options: [], 88 | animations: { () -> Void in 89 | let window = UIApplication.shared.delegate!.window! 90 | self.center = CGPoint(x: window!.frame.size.width / 2, y: window!.frame.size.height / 2) 91 | if self.isInIOS8() == false { 92 | self.transform = CGAffineTransform(rotationAngle: rotationAngle) 93 | } 94 | }, completion: nil) 95 | } 96 | 97 | // MARK: Touch events 98 | 99 | open override func touchesEnded(_ touches: Set, with event: UIEvent?) { 100 | let touch = touches.first! 101 | if touchIsOutsideDialogView(touch) { 102 | //close() 103 | } 104 | } 105 | 106 | // MARK: - Interaction Methods 107 | 108 | open func show() { 109 | self.applyMotionEffects() 110 | 111 | let screenWidth = UIScreen.main.bounds.size.width 112 | let screenHeight = UIScreen.main.bounds.size.height 113 | let largerSide = screenWidth > screenHeight ? screenWidth : screenHeight 114 | 115 | //For the black background 116 | self.frame = CGRect(x: 0, y: 0, width: largerSide * 2, height: largerSide * 2) 117 | 118 | self.dialogView.layer.opacity = 0.5 119 | self.dialogView.layer.transform = CATransform3DMakeScale(1.3, 1.3, 1.0) 120 | 121 | self.backgroundColor = UIColor.black.withAlphaComponent(0) 122 | self.addSubview(self.dialogView) 123 | 124 | self.dialogView.center = self.center 125 | 126 | let window = UIApplication.shared.delegate!.window! 127 | window?.addSubview(self) 128 | self.center = CGPoint(x: window!.frame.size.width / 2, y: window!.frame.size.height / 2) 129 | 130 | let interfaceOrientation = UIApplication.shared.statusBarOrientation 131 | 132 | switch (interfaceOrientation) { 133 | case .landscapeLeft: self.transform = CGAffineTransform(rotationAngle: CGFloat(Double.pi/2) * 3) 134 | case .landscapeRight: self.transform = CGAffineTransform(rotationAngle: CGFloat(Double.pi/2)) 135 | case .portrait: self.transform = CGAffineTransform(rotationAngle: 0) 136 | case .portraitUpsideDown: self.transform = CGAffineTransform(rotationAngle: CGFloat(Double.pi)) 137 | default: break; 138 | } 139 | 140 | // iOS8 Fix: Transformations are applied only in an animation block. Don't know why... 141 | if self.isInIOS8() { 142 | UIView.animate(withDuration: 0.001, animations: { () -> Void in 143 | self.transform = CGAffineTransform(scaleX: 1, y: 1) 144 | }) 145 | } 146 | 147 | UIView.animate( 148 | withDuration: 0.2, 149 | delay: 0.0, 150 | options: UIView.AnimationOptions(), 151 | animations: { () -> Void in 152 | self.backgroundColor = UIColor.black.withAlphaComponent(0.4) 153 | self.dialogView.layer.opacity = 1 154 | self.dialogView.layer.transform = CATransform3DMakeScale(1, 1, 1) 155 | }, completion: nil) 156 | } 157 | 158 | open func close() { 159 | self.dialogView.layer.transform = CATransform3DMakeScale(1, 1, 1) 160 | self.dialogView.layer.opacity = 1.0 161 | 162 | UIView.animate( 163 | withDuration: 0.2, 164 | delay: 0.0, 165 | options: UIView.AnimationOptions(), 166 | animations: { () -> Void in 167 | self.backgroundColor = UIColor.black.withAlphaComponent(0) 168 | self.dialogView.layer.transform = CATransform3DMakeScale(0.6, 0.6, 1) 169 | self.dialogView.layer.opacity = 0 170 | }) { (finished: Bool) -> Void in 171 | self.removeFromSuperview() 172 | } 173 | } 174 | 175 | // MARK: - Helper Methods 176 | 177 | func isInIOS8() -> Bool { 178 | return (UIDevice.current.systemVersion as NSString).floatValue >= 8 179 | } 180 | 181 | func touchIsOutsideDialogView(_ touch: UITouch) -> Bool { 182 | let touchPoint = touch.location(in: dialogView) 183 | return touchPoint.x < 0 || touchPoint.y < 0 || touchPoint.x > dialogView.bounds.width || touchPoint.y > dialogView.bounds.height 184 | } 185 | 186 | } 187 | -------------------------------------------------------------------------------- /CalendarPopUp/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // CalendarPopUp 4 | // 5 | // Created by Atakishiyev Orazdurdy on 11/16/16. 6 | // Copyright © 2016 Veriloft. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController { 12 | 13 | @IBOutlet weak var dateLabel: UILabel! 14 | var aPopupContainer: PopupContainer? 15 | var testCalendar = Calendar(identifier: Calendar.Identifier.iso8601) 16 | var currentDate: Date! = Date() { 17 | didSet { 18 | setDate() 19 | } 20 | } 21 | 22 | override func viewDidLoad() { 23 | super.viewDidLoad() 24 | currentDate = Date() 25 | } 26 | 27 | @IBAction func showCalendar(_ sender: UIButton) { 28 | let xibView = Bundle.main.loadNibNamed("CalendarPopUp", owner: nil, options: nil)?[0] as! CalendarPopUp 29 | xibView.calendarDelegate = self 30 | xibView.selected = currentDate 31 | xibView.startDate = Calendar.current.date(byAdding: .month, value: -12, to: currentDate)! 32 | xibView.endDate = Calendar.current.date(byAdding: .year, value: 2, to: currentDate)! 33 | PopupContainer.generatePopupWithView(xibView).show() 34 | } 35 | 36 | override func prepare(for segue: UIStoryboardSegue, sender: Any?) { 37 | 38 | } 39 | 40 | func setDate() { 41 | let month = testCalendar.dateComponents([.month], from: currentDate).month! 42 | let weekday = testCalendar.component(.weekday, from: currentDate) 43 | let monthName = GetHumanDate(month: month, language: .turkmen) // DateFormatter().monthSymbols[(month-1) % 12] // 44 | let week = GetWeekByLang(weekDay: weekday, language: .turkmen) // DateFormatter().shortWeekdaySymbols[weekday-1] 45 | let day = testCalendar.component(.day, from: currentDate) 46 | dateLabel.text = "\(week), " + monthName + " " + String(day) 47 | } 48 | } 49 | 50 | extension ViewController: CalendarPopUpDelegate { 51 | func dateChaged(date: Date) { 52 | currentDate = date 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /CalendarPopUpDemo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orazz/CalendarPopUp/cfc88c40a5a9c66205165d4f5765bd57d062231e/CalendarPopUpDemo.gif -------------------------------------------------------------------------------- /License.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Orazz 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 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | platform :ios, '9.0' 3 | 4 | target 'CalendarPopUp' do 5 | # Comment the next line if you're not using Swift and don't want to use dynamic frameworks 6 | use_frameworks! 7 | 8 | # Pods for CalendarPopUp 9 | pod 'JTAppleCalendar' 10 | end 11 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - JTAppleCalendar (7.1.6) 3 | 4 | DEPENDENCIES: 5 | - JTAppleCalendar 6 | 7 | SPEC REPOS: 8 | https://github.com/CocoaPods/Specs.git: 9 | - JTAppleCalendar 10 | 11 | SPEC CHECKSUMS: 12 | JTAppleCalendar: abb30678f42a4ef8a340a932b1dcb8c85a33dac2 13 | 14 | PODFILE CHECKSUM: 7be3dd38bb58eb044244397990ba9cafa766c5f7 15 | 16 | COCOAPODS: 1.5.0 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CalendarPopUp 2 | CalendarPopUp - JTAppleCalendar library 3 | 4 | 5 | 6 | 7 | # Install 8 | **Run $ pod install in project directory.** 9 | 10 | **Open CalendarPopUp.xcworkspace and build.** 11 | 12 | # Parameters 13 | 14 | **In CellView.swift** 15 | 16 | * preDateSelectable: Bool 17 | * todayColor: UIColor 18 | * selectableDateColor: UIColor 19 | * selectedRoundColor: UIColor 20 | 21 | **CalendarPopUp.swift** 22 | 23 | * startDate: Date 24 | * endDate: Date 25 | 26 | ## Authors 27 | 28 | [Oraz Atakishiyev](https://github.com/orazz) 29 | 30 | ## License 31 | 32 | CalendarPopUp is available under the MIT license. See the LICENSE file for more info. 33 | -------------------------------------------------------------------------------- /v.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orazz/CalendarPopUp/cfc88c40a5a9c66205165d4f5765bd57d062231e/v.gif --------------------------------------------------------------------------------