├── .gitignore ├── Interview ├── Interview.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── Interview │ ├── AppDelegate.swift │ ├── Assets.xcassets │ ├── AccentColor.colorset │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Contents.json │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ ├── LifeCycleViewController.swift │ ├── RedBorderView.swift │ ├── RotationViewController.swift │ ├── SceneDelegate.swift │ └── ScrollViewController.swift ├── LICENSE.md ├── README.md └── interview.playground ├── Contents.swift ├── contents.xcplayground └── playground.xcworkspace └── contents.xcworkspacedata /.gitignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | .AppleDouble 4 | .LSOverride 5 | Icon 6 | ._* 7 | .Spotlight-V100 8 | .Trashes 9 | 10 | # Xcode 11 | # 12 | build/ 13 | *.pbxuser 14 | !default.pbxuser 15 | *.mode1v3 16 | !default.mode1v3 17 | *.mode2v3 18 | !default.mode2v3 19 | *.perspectivev3 20 | !default.perspectivev3 21 | xcuserdata 22 | *.xccheckout 23 | *.moved-aside 24 | DerivedData 25 | *.hmap 26 | *.ipa 27 | *.xcuserstate 28 | *.dSYM.zip -------------------------------------------------------------------------------- /Interview/Interview.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 55; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 7917395526B6F55500F39205 /* RedBorderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7917395426B6F55500F39205 /* RedBorderView.swift */; }; 11 | 797C535926ADE57E00E64EC3 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 797C535826ADE57E00E64EC3 /* AppDelegate.swift */; }; 12 | 797C535B26ADE57E00E64EC3 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 797C535A26ADE57E00E64EC3 /* SceneDelegate.swift */; }; 13 | 797C535D26ADE57E00E64EC3 /* LifeCycleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 797C535C26ADE57E00E64EC3 /* LifeCycleViewController.swift */; }; 14 | 797C536026ADE57E00E64EC3 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 797C535E26ADE57E00E64EC3 /* Main.storyboard */; }; 15 | 797C536226ADE57F00E64EC3 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 797C536126ADE57F00E64EC3 /* Assets.xcassets */; }; 16 | 797C536526ADE57F00E64EC3 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 797C536326ADE57F00E64EC3 /* LaunchScreen.storyboard */; }; 17 | 797C536D26ADE5A000E64EC3 /* ScrollViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 797C536C26ADE59F00E64EC3 /* ScrollViewController.swift */; }; 18 | 797C536F26ADE9BB00E64EC3 /* RotationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 797C536E26ADE9BB00E64EC3 /* RotationViewController.swift */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXFileReference section */ 22 | 7917395426B6F55500F39205 /* RedBorderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RedBorderView.swift; sourceTree = ""; }; 23 | 797C535526ADE57E00E64EC3 /* Interview.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Interview.app; sourceTree = BUILT_PRODUCTS_DIR; }; 24 | 797C535826ADE57E00E64EC3 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 25 | 797C535A26ADE57E00E64EC3 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; 26 | 797C535C26ADE57E00E64EC3 /* LifeCycleViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LifeCycleViewController.swift; sourceTree = ""; }; 27 | 797C535F26ADE57E00E64EC3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 28 | 797C536126ADE57F00E64EC3 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 29 | 797C536426ADE57F00E64EC3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 30 | 797C536626ADE57F00E64EC3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 31 | 797C536C26ADE59F00E64EC3 /* ScrollViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScrollViewController.swift; sourceTree = ""; }; 32 | 797C536E26ADE9BB00E64EC3 /* RotationViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RotationViewController.swift; sourceTree = ""; }; 33 | /* End PBXFileReference section */ 34 | 35 | /* Begin PBXFrameworksBuildPhase section */ 36 | 797C535226ADE57E00E64EC3 /* Frameworks */ = { 37 | isa = PBXFrameworksBuildPhase; 38 | buildActionMask = 2147483647; 39 | files = ( 40 | ); 41 | runOnlyForDeploymentPostprocessing = 0; 42 | }; 43 | /* End PBXFrameworksBuildPhase section */ 44 | 45 | /* Begin PBXGroup section */ 46 | 797C534C26ADE57E00E64EC3 = { 47 | isa = PBXGroup; 48 | children = ( 49 | 797C535726ADE57E00E64EC3 /* Interview */, 50 | 797C535626ADE57E00E64EC3 /* Products */, 51 | ); 52 | sourceTree = ""; 53 | }; 54 | 797C535626ADE57E00E64EC3 /* Products */ = { 55 | isa = PBXGroup; 56 | children = ( 57 | 797C535526ADE57E00E64EC3 /* Interview.app */, 58 | ); 59 | name = Products; 60 | sourceTree = ""; 61 | }; 62 | 797C535726ADE57E00E64EC3 /* Interview */ = { 63 | isa = PBXGroup; 64 | children = ( 65 | 797C535826ADE57E00E64EC3 /* AppDelegate.swift */, 66 | 797C535A26ADE57E00E64EC3 /* SceneDelegate.swift */, 67 | 797C535E26ADE57E00E64EC3 /* Main.storyboard */, 68 | 797C535C26ADE57E00E64EC3 /* LifeCycleViewController.swift */, 69 | 7917395426B6F55500F39205 /* RedBorderView.swift */, 70 | 797C536E26ADE9BB00E64EC3 /* RotationViewController.swift */, 71 | 797C536C26ADE59F00E64EC3 /* ScrollViewController.swift */, 72 | 797C536126ADE57F00E64EC3 /* Assets.xcassets */, 73 | 797C536326ADE57F00E64EC3 /* LaunchScreen.storyboard */, 74 | 797C536626ADE57F00E64EC3 /* Info.plist */, 75 | ); 76 | path = Interview; 77 | sourceTree = ""; 78 | }; 79 | /* End PBXGroup section */ 80 | 81 | /* Begin PBXNativeTarget section */ 82 | 797C535426ADE57E00E64EC3 /* Interview */ = { 83 | isa = PBXNativeTarget; 84 | buildConfigurationList = 797C536926ADE57F00E64EC3 /* Build configuration list for PBXNativeTarget "Interview" */; 85 | buildPhases = ( 86 | 797C535126ADE57E00E64EC3 /* Sources */, 87 | 797C535226ADE57E00E64EC3 /* Frameworks */, 88 | 797C535326ADE57E00E64EC3 /* Resources */, 89 | ); 90 | buildRules = ( 91 | ); 92 | dependencies = ( 93 | ); 94 | name = Interview; 95 | productName = Interview; 96 | productReference = 797C535526ADE57E00E64EC3 /* Interview.app */; 97 | productType = "com.apple.product-type.application"; 98 | }; 99 | /* End PBXNativeTarget section */ 100 | 101 | /* Begin PBXProject section */ 102 | 797C534D26ADE57E00E64EC3 /* Project object */ = { 103 | isa = PBXProject; 104 | attributes = { 105 | BuildIndependentTargetsInParallel = 1; 106 | LastSwiftUpdateCheck = 1300; 107 | LastUpgradeCheck = 1300; 108 | TargetAttributes = { 109 | 797C535426ADE57E00E64EC3 = { 110 | CreatedOnToolsVersion = 13.0; 111 | }; 112 | }; 113 | }; 114 | buildConfigurationList = 797C535026ADE57E00E64EC3 /* Build configuration list for PBXProject "Interview" */; 115 | compatibilityVersion = "Xcode 13.0"; 116 | developmentRegion = en; 117 | hasScannedForEncodings = 0; 118 | knownRegions = ( 119 | en, 120 | Base, 121 | ); 122 | mainGroup = 797C534C26ADE57E00E64EC3; 123 | productRefGroup = 797C535626ADE57E00E64EC3 /* Products */; 124 | projectDirPath = ""; 125 | projectRoot = ""; 126 | targets = ( 127 | 797C535426ADE57E00E64EC3 /* Interview */, 128 | ); 129 | }; 130 | /* End PBXProject section */ 131 | 132 | /* Begin PBXResourcesBuildPhase section */ 133 | 797C535326ADE57E00E64EC3 /* Resources */ = { 134 | isa = PBXResourcesBuildPhase; 135 | buildActionMask = 2147483647; 136 | files = ( 137 | 797C536526ADE57F00E64EC3 /* LaunchScreen.storyboard in Resources */, 138 | 797C536226ADE57F00E64EC3 /* Assets.xcassets in Resources */, 139 | 797C536026ADE57E00E64EC3 /* Main.storyboard in Resources */, 140 | ); 141 | runOnlyForDeploymentPostprocessing = 0; 142 | }; 143 | /* End PBXResourcesBuildPhase section */ 144 | 145 | /* Begin PBXSourcesBuildPhase section */ 146 | 797C535126ADE57E00E64EC3 /* Sources */ = { 147 | isa = PBXSourcesBuildPhase; 148 | buildActionMask = 2147483647; 149 | files = ( 150 | 797C535D26ADE57E00E64EC3 /* LifeCycleViewController.swift in Sources */, 151 | 797C536F26ADE9BB00E64EC3 /* RotationViewController.swift in Sources */, 152 | 7917395526B6F55500F39205 /* RedBorderView.swift in Sources */, 153 | 797C535926ADE57E00E64EC3 /* AppDelegate.swift in Sources */, 154 | 797C535B26ADE57E00E64EC3 /* SceneDelegate.swift in Sources */, 155 | 797C536D26ADE5A000E64EC3 /* ScrollViewController.swift in Sources */, 156 | ); 157 | runOnlyForDeploymentPostprocessing = 0; 158 | }; 159 | /* End PBXSourcesBuildPhase section */ 160 | 161 | /* Begin PBXVariantGroup section */ 162 | 797C535E26ADE57E00E64EC3 /* Main.storyboard */ = { 163 | isa = PBXVariantGroup; 164 | children = ( 165 | 797C535F26ADE57E00E64EC3 /* Base */, 166 | ); 167 | name = Main.storyboard; 168 | sourceTree = ""; 169 | }; 170 | 797C536326ADE57F00E64EC3 /* LaunchScreen.storyboard */ = { 171 | isa = PBXVariantGroup; 172 | children = ( 173 | 797C536426ADE57F00E64EC3 /* Base */, 174 | ); 175 | name = LaunchScreen.storyboard; 176 | sourceTree = ""; 177 | }; 178 | /* End PBXVariantGroup section */ 179 | 180 | /* Begin XCBuildConfiguration section */ 181 | 797C536726ADE57F00E64EC3 /* Debug */ = { 182 | isa = XCBuildConfiguration; 183 | buildSettings = { 184 | ALWAYS_SEARCH_USER_PATHS = NO; 185 | CLANG_ANALYZER_NONNULL = YES; 186 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 187 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; 188 | CLANG_CXX_LIBRARY = "libc++"; 189 | CLANG_ENABLE_MODULES = YES; 190 | CLANG_ENABLE_OBJC_ARC = YES; 191 | CLANG_ENABLE_OBJC_WEAK = YES; 192 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 193 | CLANG_WARN_BOOL_CONVERSION = YES; 194 | CLANG_WARN_COMMA = YES; 195 | CLANG_WARN_CONSTANT_CONVERSION = YES; 196 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 197 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 198 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 199 | CLANG_WARN_EMPTY_BODY = YES; 200 | CLANG_WARN_ENUM_CONVERSION = YES; 201 | CLANG_WARN_INFINITE_RECURSION = YES; 202 | CLANG_WARN_INT_CONVERSION = YES; 203 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 204 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 205 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 206 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 207 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 208 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 209 | CLANG_WARN_STRICT_PROTOTYPES = YES; 210 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 211 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 212 | CLANG_WARN_UNREACHABLE_CODE = YES; 213 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 214 | COPY_PHASE_STRIP = NO; 215 | DEBUG_INFORMATION_FORMAT = dwarf; 216 | ENABLE_STRICT_OBJC_MSGSEND = YES; 217 | ENABLE_TESTABILITY = YES; 218 | GCC_C_LANGUAGE_STANDARD = gnu11; 219 | GCC_DYNAMIC_NO_PIC = NO; 220 | GCC_NO_COMMON_BLOCKS = YES; 221 | GCC_OPTIMIZATION_LEVEL = 0; 222 | GCC_PREPROCESSOR_DEFINITIONS = ( 223 | "DEBUG=1", 224 | "$(inherited)", 225 | ); 226 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 227 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 228 | GCC_WARN_UNDECLARED_SELECTOR = YES; 229 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 230 | GCC_WARN_UNUSED_FUNCTION = YES; 231 | GCC_WARN_UNUSED_VARIABLE = YES; 232 | IPHONEOS_DEPLOYMENT_TARGET = 15.0; 233 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 234 | MTL_FAST_MATH = YES; 235 | ONLY_ACTIVE_ARCH = YES; 236 | SDKROOT = iphoneos; 237 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 238 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 239 | }; 240 | name = Debug; 241 | }; 242 | 797C536826ADE57F00E64EC3 /* Release */ = { 243 | isa = XCBuildConfiguration; 244 | buildSettings = { 245 | ALWAYS_SEARCH_USER_PATHS = NO; 246 | CLANG_ANALYZER_NONNULL = YES; 247 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 248 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; 249 | CLANG_CXX_LIBRARY = "libc++"; 250 | CLANG_ENABLE_MODULES = YES; 251 | CLANG_ENABLE_OBJC_ARC = YES; 252 | CLANG_ENABLE_OBJC_WEAK = YES; 253 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 254 | CLANG_WARN_BOOL_CONVERSION = YES; 255 | CLANG_WARN_COMMA = YES; 256 | CLANG_WARN_CONSTANT_CONVERSION = YES; 257 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 258 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 259 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 260 | CLANG_WARN_EMPTY_BODY = YES; 261 | CLANG_WARN_ENUM_CONVERSION = YES; 262 | CLANG_WARN_INFINITE_RECURSION = YES; 263 | CLANG_WARN_INT_CONVERSION = YES; 264 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 265 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 266 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 267 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 268 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 269 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 270 | CLANG_WARN_STRICT_PROTOTYPES = YES; 271 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 272 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 273 | CLANG_WARN_UNREACHABLE_CODE = YES; 274 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 275 | COPY_PHASE_STRIP = NO; 276 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 277 | ENABLE_NS_ASSERTIONS = NO; 278 | ENABLE_STRICT_OBJC_MSGSEND = YES; 279 | GCC_C_LANGUAGE_STANDARD = gnu11; 280 | GCC_NO_COMMON_BLOCKS = YES; 281 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 282 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 283 | GCC_WARN_UNDECLARED_SELECTOR = YES; 284 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 285 | GCC_WARN_UNUSED_FUNCTION = YES; 286 | GCC_WARN_UNUSED_VARIABLE = YES; 287 | IPHONEOS_DEPLOYMENT_TARGET = 15.0; 288 | MTL_ENABLE_DEBUG_INFO = NO; 289 | MTL_FAST_MATH = YES; 290 | SDKROOT = iphoneos; 291 | SWIFT_COMPILATION_MODE = wholemodule; 292 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 293 | VALIDATE_PRODUCT = YES; 294 | }; 295 | name = Release; 296 | }; 297 | 797C536A26ADE57F00E64EC3 /* Debug */ = { 298 | isa = XCBuildConfiguration; 299 | buildSettings = { 300 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 301 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 302 | CODE_SIGN_STYLE = Manual; 303 | CURRENT_PROJECT_VERSION = 1; 304 | DEVELOPMENT_TEAM = ""; 305 | GENERATE_INFOPLIST_FILE = YES; 306 | INFOPLIST_FILE = Interview/Info.plist; 307 | INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; 308 | INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; 309 | INFOPLIST_KEY_UIMainStoryboardFile = Main; 310 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 311 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 312 | LD_RUNPATH_SEARCH_PATHS = ( 313 | "$(inherited)", 314 | "@executable_path/Frameworks", 315 | ); 316 | MARKETING_VERSION = 1.0; 317 | PRODUCT_BUNDLE_IDENTIFIER = ck.Interview; 318 | PRODUCT_NAME = "$(TARGET_NAME)"; 319 | PROVISIONING_PROFILE_SPECIFIER = ""; 320 | SWIFT_EMIT_LOC_STRINGS = YES; 321 | SWIFT_VERSION = 5.0; 322 | TARGETED_DEVICE_FAMILY = "1,2"; 323 | }; 324 | name = Debug; 325 | }; 326 | 797C536B26ADE57F00E64EC3 /* Release */ = { 327 | isa = XCBuildConfiguration; 328 | buildSettings = { 329 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 330 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 331 | CODE_SIGN_STYLE = Manual; 332 | CURRENT_PROJECT_VERSION = 1; 333 | DEVELOPMENT_TEAM = ""; 334 | GENERATE_INFOPLIST_FILE = YES; 335 | INFOPLIST_FILE = Interview/Info.plist; 336 | INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; 337 | INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; 338 | INFOPLIST_KEY_UIMainStoryboardFile = Main; 339 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 340 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 341 | LD_RUNPATH_SEARCH_PATHS = ( 342 | "$(inherited)", 343 | "@executable_path/Frameworks", 344 | ); 345 | MARKETING_VERSION = 1.0; 346 | PRODUCT_BUNDLE_IDENTIFIER = ck.Interview; 347 | PRODUCT_NAME = "$(TARGET_NAME)"; 348 | PROVISIONING_PROFILE_SPECIFIER = ""; 349 | SWIFT_EMIT_LOC_STRINGS = YES; 350 | SWIFT_VERSION = 5.0; 351 | TARGETED_DEVICE_FAMILY = "1,2"; 352 | }; 353 | name = Release; 354 | }; 355 | /* End XCBuildConfiguration section */ 356 | 357 | /* Begin XCConfigurationList section */ 358 | 797C535026ADE57E00E64EC3 /* Build configuration list for PBXProject "Interview" */ = { 359 | isa = XCConfigurationList; 360 | buildConfigurations = ( 361 | 797C536726ADE57F00E64EC3 /* Debug */, 362 | 797C536826ADE57F00E64EC3 /* Release */, 363 | ); 364 | defaultConfigurationIsVisible = 0; 365 | defaultConfigurationName = Release; 366 | }; 367 | 797C536926ADE57F00E64EC3 /* Build configuration list for PBXNativeTarget "Interview" */ = { 368 | isa = XCConfigurationList; 369 | buildConfigurations = ( 370 | 797C536A26ADE57F00E64EC3 /* Debug */, 371 | 797C536B26ADE57F00E64EC3 /* Release */, 372 | ); 373 | defaultConfigurationIsVisible = 0; 374 | defaultConfigurationName = Release; 375 | }; 376 | /* End XCConfigurationList section */ 377 | }; 378 | rootObject = 797C534D26ADE57E00E64EC3 /* Project object */; 379 | } 380 | -------------------------------------------------------------------------------- /Interview/Interview.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Interview/Interview.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Interview/Interview/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // Interview 4 | // 5 | // Created by Richard Topchii on 25.7.2021. 6 | // 7 | 8 | import UIKit 9 | 10 | @main 11 | final class AppDelegate: UIResponder, UIApplicationDelegate { 12 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 13 | // Override point for customization after application launch. 14 | return true 15 | } 16 | 17 | // MARK: UISceneSession Lifecycle 18 | 19 | func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { 20 | // Called when a new scene session is being created. 21 | // Use this method to select a configuration to create the new scene with. 22 | return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) 23 | } 24 | 25 | func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { 26 | // Called when the user discards a scene session. 27 | // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. 28 | // Use this method to release any resources that were specific to the discarded scenes, as they will not return. 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Interview/Interview/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Interview/Interview/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "scale" : "2x", 36 | "size" : "60x60" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "scale" : "3x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "scale" : "1x", 46 | "size" : "20x20" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "scale" : "2x", 51 | "size" : "20x20" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "scale" : "1x", 56 | "size" : "29x29" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "scale" : "2x", 61 | "size" : "29x29" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "scale" : "1x", 66 | "size" : "40x40" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "scale" : "2x", 71 | "size" : "40x40" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "scale" : "1x", 76 | "size" : "76x76" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "scale" : "2x", 81 | "size" : "76x76" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "scale" : "2x", 86 | "size" : "83.5x83.5" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "scale" : "1x", 91 | "size" : "1024x1024" 92 | } 93 | ], 94 | "info" : { 95 | "author" : "xcode", 96 | "version" : 1 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /Interview/Interview/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Interview/Interview/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 | -------------------------------------------------------------------------------- /Interview/Interview/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 28 | 37 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | -------------------------------------------------------------------------------- /Interview/Interview/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | UIApplicationSceneManifest 6 | 7 | UIApplicationSupportsMultipleScenes 8 | 9 | UISceneConfigurations 10 | 11 | UIWindowSceneSessionRoleApplication 12 | 13 | 14 | UISceneConfigurationName 15 | Default Configuration 16 | UISceneDelegateClassName 17 | $(PRODUCT_MODULE_NAME).SceneDelegate 18 | UISceneStoryboardFile 19 | Main 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Interview/Interview/LifeCycleViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LifeCycleViewController.swift 3 | // Interview 4 | // 5 | // Created by Richard Topchii on 25.7.2021. 6 | // 7 | 8 | import UIKit 9 | 10 | final class LifeCycleViewController: UIViewController { 11 | 12 | // MARK: - Initialization 13 | 14 | override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) { 15 | super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil) 16 | print("\(#function)") 17 | } 18 | 19 | required init?(coder: NSCoder) { 20 | super.init(coder: coder) 21 | print("\(#function)") 22 | } 23 | 24 | override func loadViewIfNeeded() { 25 | super.loadViewIfNeeded() 26 | print("\(#function)") 27 | } 28 | 29 | override func loadView() { 30 | super.loadView() 31 | print("\(#function)") 32 | } 33 | 34 | override func viewDidLoad() { 35 | super.viewDidLoad() 36 | print("\(#function)") 37 | } 38 | 39 | // MARK: - Life Cycle 40 | 41 | override func viewWillAppear(_ animated: Bool) { 42 | super.viewWillAppear(animated) 43 | print("\(#function)") 44 | } 45 | 46 | override func viewDidAppear(_ animated: Bool) { 47 | super.viewDidAppear(animated) 48 | print("\(#function)") 49 | } 50 | 51 | override func viewWillDisappear(_ animated: Bool) { 52 | super.viewWillDisappear(animated) 53 | print("\(#function)") 54 | } 55 | 56 | override func viewDidDisappear(_ animated: Bool) { 57 | super.viewDidDisappear(animated) 58 | print("\(#function)") 59 | } 60 | 61 | override func viewWillLayoutSubviews() { 62 | super.viewWillLayoutSubviews() 63 | print("\(#function)") 64 | } 65 | 66 | override func viewDidLayoutSubviews() { 67 | super.viewDidLayoutSubviews() 68 | print("\(#function)") 69 | } 70 | 71 | override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { 72 | super.viewWillTransition(to: size, with: coordinator) 73 | print("\(#function)") 74 | } 75 | 76 | // MARK: - Deinitialization 77 | 78 | deinit { 79 | print("\(#function)") 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /Interview/Interview/RedBorderView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RedBorderView.swift 3 | // RedBorderView 4 | // 5 | // Created by Richard Topchii on 1.8.2021. 6 | // 7 | 8 | import UIKit 9 | 10 | final class RedBorderView: UIView { 11 | override func layoutSubviews() { 12 | super.layoutSubviews() 13 | layer.borderColor = UIColor.red.cgColor 14 | layer.borderWidth = 2 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Interview/Interview/RotationViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RotationViewController.swift 3 | // RotationViewController 4 | // 5 | // Created by Richard Topchii on 25.7.2021. 6 | // 7 | 8 | import UIKit 9 | 10 | final class RotationViewController: UIViewController { 11 | 12 | @IBOutlet weak var redBorderView: UIView! 13 | @IBOutlet weak var purpleView: UIView! 14 | @IBOutlet weak var rotationGestureRecognizer: UIRotationGestureRecognizer! 15 | 16 | @IBAction func rotationDetected(_ sender: UIRotationGestureRecognizer) { 17 | purpleView.transform = CGAffineTransform.init(rotationAngle: sender.rotation) 18 | print("Rotated Frame: \(purpleView.frame) Bounds: \(purpleView.bounds)") 19 | repositionRedView() 20 | } 21 | 22 | override func viewDidLoad() { 23 | super.viewDidLoad() 24 | repositionRedView() 25 | print("Initial Frame: \(purpleView.frame) Bounds: \(purpleView.bounds)") 26 | } 27 | 28 | 29 | private func repositionRedView() { 30 | redBorderView.frame = purpleView.frame 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Interview/Interview/SceneDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SceneDelegate.swift 3 | // Interview 4 | // 5 | // Created by Richard Topchii on 25.7.2021. 6 | // 7 | 8 | import UIKit 9 | 10 | final class SceneDelegate: UIResponder, UIWindowSceneDelegate { 11 | 12 | var window: UIWindow? 13 | 14 | 15 | func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { 16 | // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. 17 | // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. 18 | // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). 19 | guard let _ = (scene as? UIWindowScene) else { return } 20 | } 21 | 22 | func sceneDidDisconnect(_ scene: UIScene) { 23 | // Called as the scene is being released by the system. 24 | // This occurs shortly after the scene enters the background, or when its session is discarded. 25 | // Release any resources associated with this scene that can be re-created the next time the scene connects. 26 | // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead). 27 | } 28 | 29 | func sceneDidBecomeActive(_ scene: UIScene) { 30 | // Called when the scene has moved from an inactive state to an active state. 31 | // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. 32 | } 33 | 34 | func sceneWillResignActive(_ scene: UIScene) { 35 | // Called when the scene will move from an active state to an inactive state. 36 | // This may occur due to temporary interruptions (ex. an incoming phone call). 37 | } 38 | 39 | func sceneWillEnterForeground(_ scene: UIScene) { 40 | // Called as the scene transitions from the background to the foreground. 41 | // Use this method to undo the changes made on entering the background. 42 | } 43 | 44 | func sceneDidEnterBackground(_ scene: UIScene) { 45 | // Called as the scene transitions from the foreground to the background. 46 | // Use this method to save data, release shared resources, and store enough scene-specific state information 47 | // to restore the scene back to its current state. 48 | } 49 | 50 | 51 | } 52 | 53 | -------------------------------------------------------------------------------- /Interview/Interview/ScrollViewController.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | final class ScrollViewController: UIViewController, UIScrollViewDelegate { 4 | 5 | @IBOutlet var scrollView: UIScrollView! 6 | 7 | override func viewDidLoad() { 8 | super.viewDidLoad() 9 | scrollView.delegate = self 10 | } 11 | 12 | func scrollViewDidScroll(_ scrollView: UIScrollView) { 13 | print("Scrollview Frame: \(scrollView.frame) Bounds: \(scrollView.bounds)") 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT license 2 | 3 | Copyright (c) 2022 Richard Topchii 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![License](https://img.shields.io/github/license/richardtop/calendarkit)](https://swiftpackageindex.com/richardtop/CalendarKit) 2 | [![YouTube Channel Subscribers](https://img.shields.io/youtube/channel/subscribers/UCx1gvWpy5zjOd7yZyDwmXEA?style=social)](https://www.youtube.com/channel/UCx1gvWpy5zjOd7yZyDwmXEA?sub_confirmation=1) 3 | [![Twitter](https://img.shields.io/twitter/follow/richardtop_ios?style=social)](https://twitter.com/richardtop_ios) 4 | [![GitHub followers](https://img.shields.io/github/followers/richardtop?style=social)](https://github.com/richardtop) 5 | 6 | 7 | [Richard Topchii on Telegram](https://t.me/richardtop) 8 | # iOS Interview Questions (Sample Code) 9 | 10 | **iOS Interview Questions (Sample Code)** is a sample code repository serving as a supplementary resource to the Richard Topchii YouTube video: 11 | [iOS Developer Interview Questions and Answers with Sample Code](https://www.youtube.com/watch?v=gmyEHW7zDYc) 12 | 13 | ## Chapters 14 | 15 | 0:00 - Overview 16 | 17 | 0:21 - Daniel, the interviewer 18 | 19 | 1:50 - Why these questions? 20 | 21 | 22 | 2:30 - View Controller Life Cycle 23 | 24 | 11:55 - What’s the difference between a struct and a class 25 | 26 | 18:20 - What’s the difference between .frame and .bounds property of a UIView 27 | 28 | 25:45 - What is a Protocol Oriented Programming 29 | 30 | 32:03 - "defer" statement coding question 31 | 32 | 37:00 - GCD / DispatchQueue coding question 33 | 34 | 46:36 - MVC architecture (Model, View, Controller) 35 | 36 | 52:19 - "weak" and "unowned" keywords 37 | 38 | 56:54 - "lazy" keyword 39 | 40 | 1:01:52 - "@escaping" closure attribue and non-escaping closures 41 | 42 | 43 | 1:05:03 - Summary and feedback 44 | 45 | ## Requirements 46 | 47 | To run iOS Interview Questions (Sample Code): 48 | 49 | - Xcode 12 50 | - iOS 14 51 | - Playground 4 or Xcode with Playground support 52 | 53 | ## Author 54 | 55 | Richard Topchii 56 | 57 | 58 | ## License 59 | 60 | **iOS Interview Questions (Sample Code)** is available under the MIT license. See the LICENSE file for more info. 61 | -------------------------------------------------------------------------------- /interview.playground/Contents.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | func deferQuestion() { 4 | defer { 5 | print("A") 6 | } 7 | 8 | defer { 9 | print("B") 10 | defer { 11 | print("C") 12 | } 13 | print("D") 14 | } 15 | 16 | defer { 17 | print("E") 18 | } 19 | 20 | print("F") 21 | } 22 | 23 | // FEBDCA 24 | print("Defer Interview Question") 25 | deferQuestion() 26 | 27 | 28 | func dispatchQuestion() { 29 | print("A") 30 | DispatchQueue.global(qos: .default).async { 31 | print("B") 32 | DispatchQueue.main.async { 33 | print("C") 34 | } 35 | print("D") 36 | 37 | DispatchQueue.main.sync { 38 | print("E") 39 | } 40 | 41 | DispatchQueue.main.async { 42 | print("F") 43 | DispatchQueue.main.sync { 44 | print("G") 45 | } 46 | 47 | } 48 | print("H") 49 | } 50 | print("I") 51 | } 52 | // AIBDCEHF 53 | // G never be printed 54 | 55 | 56 | print("Dispatch/GCD Interview Question") 57 | dispatchQuestion() 58 | 59 | 60 | final class TestClass { 61 | var completionHandler: (() -> Void)? 62 | 63 | func exampleEscaping(handler: @escaping () -> Void) { 64 | self.completionHandler = handler 65 | handler() 66 | } 67 | 68 | func exampleNoEscape(handler: () -> Void) { 69 | handler() 70 | // self.completionHandler = handler 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /interview.playground/contents.xcplayground: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /interview.playground/playground.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | --------------------------------------------------------------------------------