├── .codecov.yml ├── .github └── PULL_REQUEST_TEMPLATE ├── .gitignore ├── .jazzy.yml ├── .swift-version ├── .swiftlint.yaml ├── .travis.yml ├── Assets ├── banner.png └── screenshot.gif ├── CONTRIBUTING.md ├── Dangerfile ├── Gemfile ├── LICENSE ├── README.md ├── RandomUserSwift.podspec ├── RandomUserSwift.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── xcshareddata │ └── xcschemes │ │ └── RandomUserSwift.xcscheme └── xcuserdata │ └── wilson.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ └── xcschememanagement.plist ├── RandomUserSwift ├── Info.plist ├── RandomUser.swift ├── RandomUserSwift.h └── Users.swift ├── RandomUserSwiftTests ├── Info.plist └── RandomUserSwiftTests.swift └── docs ├── Classes.html ├── Classes └── RandomUser.html ├── Structs.html ├── badge.svg ├── css ├── highlight.css └── jazzy.css ├── docsets ├── RandomUserSwift.docset │ └── Contents │ │ ├── Info.plist │ │ └── Resources │ │ ├── Documents │ │ ├── Classes.html │ │ ├── Classes │ │ │ └── RandomUser.html │ │ ├── Structs.html │ │ ├── css │ │ │ ├── highlight.css │ │ │ └── jazzy.css │ │ ├── img │ │ │ ├── carat.png │ │ │ ├── dash.png │ │ │ └── gh.png │ │ ├── index.html │ │ ├── js │ │ │ ├── jazzy.js │ │ │ └── jquery.min.js │ │ └── search.json │ │ └── docSet.dsidx └── RandomUserSwift.tgz ├── img ├── carat.png ├── dash.png └── gh.png ├── index.html ├── js ├── jazzy.js └── jquery.min.js ├── search.json └── undocumented.json /.codecov.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | ## What does this PR do? 8 | 9 | 10 | 11 | 12 | ## What issues (if any) are related to this PR? Or why was this change introduced? 13 | 14 | 15 | 16 | 17 | ## Checklist 18 | 19 | - [ ] Does this contain code changes? 20 | - [ ] Does this have tests? 21 | - [ ] Does this have documentation? 22 | - [ ] Does this break the public API (Requires major version bump)? 23 | - [ ] Is this a new feature (Requires minor version bump)? -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | build/ 3 | DerivedData/ 4 | xcuserdata 5 | -------------------------------------------------------------------------------- /.jazzy.yml: -------------------------------------------------------------------------------- 1 | module: RandomUserSwift 2 | github_url: https://github.com/dingwilson/RandomUserSwift 3 | clean: true 4 | -------------------------------------------------------------------------------- /.swift-version: -------------------------------------------------------------------------------- 1 | 5.0 2 | -------------------------------------------------------------------------------- /.swiftlint.yaml: -------------------------------------------------------------------------------- 1 | disabled_rules: 2 | - file_length 3 | - line_length 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | osx_image: xcode10.2 2 | language: objective-c 3 | xcode_project: RandomUserSwift.xcodeproj 4 | 5 | branches: 6 | only: 7 | master 8 | 9 | before_install: 10 | - gem install xcpretty 11 | - gem install xcpretty-json-formatter 12 | - git clone https://github.com/dingwilson/devops-ci.git 13 | 14 | script: 15 | - set -o pipefail 16 | - xcodebuild clean test -project RandomUserSwift.xcodeproj -scheme RandomUserSwift -configuration Debug -destination 'platform=iOS Simulator,name=iPhone XS,OS=latest' CODE_SIGN_IDENTITY=\"\" CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=NO -enableCodeCoverage yes | XCPRETTY_JSON_FILE_OUTPUT="xcodebuild.json" xcpretty -f `xcpretty-json-formatter` 17 | - bash <(curl -s https://codecov.io/bash) 18 | - bundle exec danger --fail-on-errors=true 19 | - source ./devops-ci/gen_jazzy_docs.sh 20 | -------------------------------------------------------------------------------- /Assets/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dingwilson/RandomUserSwift/a7899c7799e6bf1a669c274b8d8af71c47ac5a5d/Assets/banner.png -------------------------------------------------------------------------------- /Assets/screenshot.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dingwilson/RandomUserSwift/a7899c7799e6bf1a669c274b8d8af71c47ac5a5d/Assets/screenshot.gif -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to RandomUserSwift 2 | We love your input! We want to make contributing to this project as easy and transparent as possible, whether it's: 3 | 4 | - Reporting a bug 5 | - Discussing the current state of the code 6 | - Submitting a fix 7 | - Proposing new features 8 | 9 | ## We Develop with Github 10 | We use github to host code, to track issues and feature requests, as well as accept pull requests. Pull requests are the best way to propose changes to the codebase. We actively welcome your pull requests: 11 | 12 | 1. Fork the repo and create your branch from `master`. 13 | 2. If you've added code that should be tested, add tests. 14 | 3. If you've changed APIs, update the documentation. 15 | 4. Ensure the test suite passes. 16 | 5. Make sure your code lints. 17 | 6. Issue a pull request! 18 | 19 | ## Any contributions you make will be under the MIT Software License 20 | In short, when you submit code changes, your submissions are understood to be under the same [MIT License](http://choosealicense.com/licenses/mit/) that covers the project. Feel free to contact the maintainers if that's a concern. 21 | 22 | ## Report bugs using Github's [issues](https://github.com/dingwilson/RandomUserSwift/issues) 23 | We use GitHub issues to track public bugs. Report a bug by [opening a new issue](https://github.com/dingwilson/RandomUserSwift/issues); it's that easy! 24 | 25 | ## Use a Consistent Coding Style 26 | In order to ensure a consistent coding style, please use [SwiftLint](https://github.com/realm/SwiftLint). 27 | 28 | ## License 29 | By contributing, you agree that your contributions will be licensed under its MIT License. 30 | 31 | ## References 32 | This document was adapted from the open-source contribution guidelines for [Facebook's Draft](https://github.com/facebook/draft-js/blob/a9316a723f9e918afde44dea68b5f9f39b7d9b00/CONTRIBUTING.md) -------------------------------------------------------------------------------- /Dangerfile: -------------------------------------------------------------------------------- 1 | # Make it more obvious that a PR is a work in progress and shouldn't be merged yet 2 | warn('PR is classed as Work in Progress', sticky: false) if github.pr_title.include? '[WIP]' 3 | 4 | # Run SwiftLint 5 | swiftlint.lint_files 6 | 7 | # Report any xcodebuild warnings/errors 8 | xcode_summary.report 'xcodebuild.json' 9 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | source "https://rubygems.org" 4 | 5 | gem "danger" 6 | gem "danger-swiftlint" 7 | gem "danger-xcode_summary" 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright (c) <2016-present> 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 |

4 | 5 | [![Build Status](https://travis-ci.org/dingwilson/RandomUserSwift.svg?branch=master)](https://travis-ci.org/dingwilson/RandomUserSwift) 6 | [![codecov](https://codecov.io/gh/dingwilson/RandomUserSwift/branch/master/graph/badge.svg)](https://codecov.io/gh/dingwilson/RandomUserSwift) 7 | [![doccov](https://wilsonding.com/RandomUserSwift/badge.svg)](https://wilsonding.com/RandomUserSwift) 8 | [![CocoaPods Version Status](https://img.shields.io/cocoapods/v/RandomUserSwift.svg)](https://cocoapods.org/pods/RandomUserSwift) 9 | [![Carthage compatible](https://img.shields.io/badge/Carthage-Compatible-brightgreen.svg?style=flat)](https://github.com/Carthage/Carthage) 10 | ![Platform](https://img.shields.io/badge/platforms-iOS-333333.svg) 11 | [![Swift](https://img.shields.io/badge/Swift-5.0+-orange.svg)](https://swift.org) 12 | [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT) 13 | 14 |

15 | 16 |

17 | 18 | RandomUserSwift is an easy to use Swift framework that provides the ability to generate random users and their accompanying data for your Swift applications. It utilizes [randomuser.me](https://www.randomuser.me) API to generate the data. 19 | 20 | 1. [Integration](#integration) 21 | - [Cocoapods](#cocoapods) 22 | - [Carthage](#carthage) 23 | 2. [Usage](#usage) 24 | 3. [License](#license) 25 | 26 | ## Integration 27 | 28 | #### CocoaPods 29 | You can use [CocoaPods](https://cocoapods.org/) to install `RandomUserSwift` by adding it to your `Podfile`: 30 | ```ruby 31 | target 'MyApp' do 32 | pod 'RandomUserSwift' 33 | end 34 | ``` 35 | 36 | #### Carthage 37 | You can use [Carthage](https://github.com/Carthage/Carthage) to install `RandomUserSwift` by adding it to your `Cartfile`: 38 | ``` 39 | github "dingwilson/RandomUserSwift" 40 | ``` 41 | 42 | ## Usage 43 | 44 | Import the framework 45 | 46 | ```swift 47 | import RandomUserSwift 48 | ``` 49 | 50 | Then, use the `getUsers` function via the `shared` singleton with a completion handler. 51 | 52 | ```swift 53 | RandomUser.shared.getUsers { data, error in 54 | guard let data = data else { return } 55 | 56 | print(data) 57 | } 58 | ``` 59 | 60 | For more information on the configuration and returned values, check out the [RandomUserSwift documentation](https://wilsonding.com/RandomUserSwift) or [RandomUser official documentation](https://www.randomuser.me/documentation) 61 | 62 | 63 | ## License 64 | 65 | `RandomUserSwift` is released under an [MIT License](https://opensource.org/licenses/MIT). See `LICENSE` for details. 66 | 67 | **Copyright © 2016-present Wilson Ding.** 68 | 69 | *Please provide attribution, it is greatly appreciated.* 70 | -------------------------------------------------------------------------------- /RandomUserSwift.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "RandomUserSwift" 3 | s.version = "1.1.0" 4 | s.summary = "Swift Framework to Generate Random Users - An Unofficial SDK for randomuser.me" 5 | s.description = "Swift Framework to Generate Random Users - An Unofficial SDK for randomuser.me." 6 | s.homepage = "https://github.com/dingwilson/RandomUserSwift" 7 | s.license = "MIT" 8 | s.author = { "Wilson Ding" => "hello@wilsonding.com" } 9 | s.platform = :ios, "8.0" 10 | s.source = { :git => "https://github.com/dingwilson/RandomUserSwift.git", :tag => s.version } 11 | s.source_files = "RandomUserSwift", "RandomUserSwift/**/*.{h,m,swift}" 12 | s.exclude_files = "Classes/Exclude" 13 | end 14 | -------------------------------------------------------------------------------- /RandomUserSwift.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | C8A7AA2F1DAC2FE90054C75C /* RandomUserSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C8A7AA251DAC2FE80054C75C /* RandomUserSwift.framework */; }; 11 | C8A7AA341DAC2FE90054C75C /* RandomUserSwiftTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8A7AA331DAC2FE90054C75C /* RandomUserSwiftTests.swift */; }; 12 | C8A7AA361DAC2FE90054C75C /* RandomUserSwift.h in Headers */ = {isa = PBXBuildFile; fileRef = C8A7AA281DAC2FE80054C75C /* RandomUserSwift.h */; settings = {ATTRIBUTES = (Public, ); }; }; 13 | C8A7AA401DAC302F0054C75C /* RandomUser.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8A7AA3F1DAC302F0054C75C /* RandomUser.swift */; }; 14 | C8A7AA461DAC35FC0054C75C /* Users.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8A7AA451DAC35FC0054C75C /* Users.swift */; }; 15 | /* End PBXBuildFile section */ 16 | 17 | /* Begin PBXContainerItemProxy section */ 18 | C8A7AA301DAC2FE90054C75C /* PBXContainerItemProxy */ = { 19 | isa = PBXContainerItemProxy; 20 | containerPortal = C8A7AA1C1DAC2FE80054C75C /* Project object */; 21 | proxyType = 1; 22 | remoteGlobalIDString = C8A7AA241DAC2FE80054C75C; 23 | remoteInfo = RandomUserSwift; 24 | }; 25 | /* End PBXContainerItemProxy section */ 26 | 27 | /* Begin PBXFileReference section */ 28 | C8A7AA251DAC2FE80054C75C /* RandomUserSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = RandomUserSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 29 | C8A7AA281DAC2FE80054C75C /* RandomUserSwift.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RandomUserSwift.h; sourceTree = ""; }; 30 | C8A7AA291DAC2FE80054C75C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 31 | C8A7AA2E1DAC2FE90054C75C /* RandomUserSwiftTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RandomUserSwiftTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 32 | C8A7AA331DAC2FE90054C75C /* RandomUserSwiftTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RandomUserSwiftTests.swift; sourceTree = ""; }; 33 | C8A7AA351DAC2FE90054C75C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 34 | C8A7AA3F1DAC302F0054C75C /* RandomUser.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RandomUser.swift; sourceTree = ""; }; 35 | C8A7AA451DAC35FC0054C75C /* Users.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Users.swift; sourceTree = ""; }; 36 | /* End PBXFileReference section */ 37 | 38 | /* Begin PBXFrameworksBuildPhase section */ 39 | C8A7AA211DAC2FE80054C75C /* Frameworks */ = { 40 | isa = PBXFrameworksBuildPhase; 41 | buildActionMask = 2147483647; 42 | files = ( 43 | ); 44 | runOnlyForDeploymentPostprocessing = 0; 45 | }; 46 | C8A7AA2B1DAC2FE90054C75C /* Frameworks */ = { 47 | isa = PBXFrameworksBuildPhase; 48 | buildActionMask = 2147483647; 49 | files = ( 50 | C8A7AA2F1DAC2FE90054C75C /* RandomUserSwift.framework in Frameworks */, 51 | ); 52 | runOnlyForDeploymentPostprocessing = 0; 53 | }; 54 | /* End PBXFrameworksBuildPhase section */ 55 | 56 | /* Begin PBXGroup section */ 57 | C8A7AA1B1DAC2FE80054C75C = { 58 | isa = PBXGroup; 59 | children = ( 60 | C8A7AA271DAC2FE80054C75C /* RandomUserSwift */, 61 | C8A7AA321DAC2FE90054C75C /* RandomUserSwiftTests */, 62 | C8A7AA261DAC2FE80054C75C /* Products */, 63 | ); 64 | sourceTree = ""; 65 | }; 66 | C8A7AA261DAC2FE80054C75C /* Products */ = { 67 | isa = PBXGroup; 68 | children = ( 69 | C8A7AA251DAC2FE80054C75C /* RandomUserSwift.framework */, 70 | C8A7AA2E1DAC2FE90054C75C /* RandomUserSwiftTests.xctest */, 71 | ); 72 | name = Products; 73 | sourceTree = ""; 74 | }; 75 | C8A7AA271DAC2FE80054C75C /* RandomUserSwift */ = { 76 | isa = PBXGroup; 77 | children = ( 78 | C8A7AA281DAC2FE80054C75C /* RandomUserSwift.h */, 79 | C8A7AA3F1DAC302F0054C75C /* RandomUser.swift */, 80 | C8A7AA451DAC35FC0054C75C /* Users.swift */, 81 | C8A7AA291DAC2FE80054C75C /* Info.plist */, 82 | ); 83 | path = RandomUserSwift; 84 | sourceTree = ""; 85 | }; 86 | C8A7AA321DAC2FE90054C75C /* RandomUserSwiftTests */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | C8A7AA331DAC2FE90054C75C /* RandomUserSwiftTests.swift */, 90 | C8A7AA351DAC2FE90054C75C /* Info.plist */, 91 | ); 92 | path = RandomUserSwiftTests; 93 | sourceTree = ""; 94 | }; 95 | /* End PBXGroup section */ 96 | 97 | /* Begin PBXHeadersBuildPhase section */ 98 | C8A7AA221DAC2FE80054C75C /* Headers */ = { 99 | isa = PBXHeadersBuildPhase; 100 | buildActionMask = 2147483647; 101 | files = ( 102 | C8A7AA361DAC2FE90054C75C /* RandomUserSwift.h in Headers */, 103 | ); 104 | runOnlyForDeploymentPostprocessing = 0; 105 | }; 106 | /* End PBXHeadersBuildPhase section */ 107 | 108 | /* Begin PBXNativeTarget section */ 109 | C8A7AA241DAC2FE80054C75C /* RandomUserSwift */ = { 110 | isa = PBXNativeTarget; 111 | buildConfigurationList = C8A7AA391DAC2FE90054C75C /* Build configuration list for PBXNativeTarget "RandomUserSwift" */; 112 | buildPhases = ( 113 | C8A7AA201DAC2FE80054C75C /* Sources */, 114 | C8A7AA211DAC2FE80054C75C /* Frameworks */, 115 | C8A7AA221DAC2FE80054C75C /* Headers */, 116 | C8A7AA231DAC2FE80054C75C /* Resources */, 117 | C86C64C9213703DC0097C2AD /* ShellScript */, 118 | ); 119 | buildRules = ( 120 | ); 121 | dependencies = ( 122 | ); 123 | name = RandomUserSwift; 124 | productName = RandomUserSwift; 125 | productReference = C8A7AA251DAC2FE80054C75C /* RandomUserSwift.framework */; 126 | productType = "com.apple.product-type.framework"; 127 | }; 128 | C8A7AA2D1DAC2FE90054C75C /* RandomUserSwiftTests */ = { 129 | isa = PBXNativeTarget; 130 | buildConfigurationList = C8A7AA3C1DAC2FE90054C75C /* Build configuration list for PBXNativeTarget "RandomUserSwiftTests" */; 131 | buildPhases = ( 132 | C8A7AA2A1DAC2FE90054C75C /* Sources */, 133 | C8A7AA2B1DAC2FE90054C75C /* Frameworks */, 134 | C8A7AA2C1DAC2FE90054C75C /* Resources */, 135 | ); 136 | buildRules = ( 137 | ); 138 | dependencies = ( 139 | C8A7AA311DAC2FE90054C75C /* PBXTargetDependency */, 140 | ); 141 | name = RandomUserSwiftTests; 142 | productName = RandomUserSwiftTests; 143 | productReference = C8A7AA2E1DAC2FE90054C75C /* RandomUserSwiftTests.xctest */; 144 | productType = "com.apple.product-type.bundle.unit-test"; 145 | }; 146 | /* End PBXNativeTarget section */ 147 | 148 | /* Begin PBXProject section */ 149 | C8A7AA1C1DAC2FE80054C75C /* Project object */ = { 150 | isa = PBXProject; 151 | attributes = { 152 | LastSwiftUpdateCheck = 0800; 153 | LastUpgradeCheck = 1020; 154 | ORGANIZATIONNAME = "Wilson Ding"; 155 | TargetAttributes = { 156 | C8A7AA241DAC2FE80054C75C = { 157 | CreatedOnToolsVersion = 8.0; 158 | LastSwiftMigration = 1020; 159 | ProvisioningStyle = Automatic; 160 | }; 161 | C8A7AA2D1DAC2FE90054C75C = { 162 | CreatedOnToolsVersion = 8.0; 163 | DevelopmentTeam = 585SNYAD83; 164 | LastSwiftMigration = 1020; 165 | ProvisioningStyle = Automatic; 166 | }; 167 | }; 168 | }; 169 | buildConfigurationList = C8A7AA1F1DAC2FE80054C75C /* Build configuration list for PBXProject "RandomUserSwift" */; 170 | compatibilityVersion = "Xcode 3.2"; 171 | developmentRegion = en; 172 | hasScannedForEncodings = 0; 173 | knownRegions = ( 174 | en, 175 | Base, 176 | ); 177 | mainGroup = C8A7AA1B1DAC2FE80054C75C; 178 | productRefGroup = C8A7AA261DAC2FE80054C75C /* Products */; 179 | projectDirPath = ""; 180 | projectRoot = ""; 181 | targets = ( 182 | C8A7AA241DAC2FE80054C75C /* RandomUserSwift */, 183 | C8A7AA2D1DAC2FE90054C75C /* RandomUserSwiftTests */, 184 | ); 185 | }; 186 | /* End PBXProject section */ 187 | 188 | /* Begin PBXResourcesBuildPhase section */ 189 | C8A7AA231DAC2FE80054C75C /* Resources */ = { 190 | isa = PBXResourcesBuildPhase; 191 | buildActionMask = 2147483647; 192 | files = ( 193 | ); 194 | runOnlyForDeploymentPostprocessing = 0; 195 | }; 196 | C8A7AA2C1DAC2FE90054C75C /* Resources */ = { 197 | isa = PBXResourcesBuildPhase; 198 | buildActionMask = 2147483647; 199 | files = ( 200 | ); 201 | runOnlyForDeploymentPostprocessing = 0; 202 | }; 203 | /* End PBXResourcesBuildPhase section */ 204 | 205 | /* Begin PBXShellScriptBuildPhase section */ 206 | C86C64C9213703DC0097C2AD /* ShellScript */ = { 207 | isa = PBXShellScriptBuildPhase; 208 | buildActionMask = 2147483647; 209 | files = ( 210 | ); 211 | inputPaths = ( 212 | ); 213 | outputPaths = ( 214 | ); 215 | runOnlyForDeploymentPostprocessing = 0; 216 | shellPath = /bin/sh; 217 | shellScript = "if which swiftlint >/dev/null; then\nswiftlint\nelse\necho \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi"; 218 | }; 219 | /* End PBXShellScriptBuildPhase section */ 220 | 221 | /* Begin PBXSourcesBuildPhase section */ 222 | C8A7AA201DAC2FE80054C75C /* Sources */ = { 223 | isa = PBXSourcesBuildPhase; 224 | buildActionMask = 2147483647; 225 | files = ( 226 | C8A7AA461DAC35FC0054C75C /* Users.swift in Sources */, 227 | C8A7AA401DAC302F0054C75C /* RandomUser.swift in Sources */, 228 | ); 229 | runOnlyForDeploymentPostprocessing = 0; 230 | }; 231 | C8A7AA2A1DAC2FE90054C75C /* Sources */ = { 232 | isa = PBXSourcesBuildPhase; 233 | buildActionMask = 2147483647; 234 | files = ( 235 | C8A7AA341DAC2FE90054C75C /* RandomUserSwiftTests.swift in Sources */, 236 | ); 237 | runOnlyForDeploymentPostprocessing = 0; 238 | }; 239 | /* End PBXSourcesBuildPhase section */ 240 | 241 | /* Begin PBXTargetDependency section */ 242 | C8A7AA311DAC2FE90054C75C /* PBXTargetDependency */ = { 243 | isa = PBXTargetDependency; 244 | target = C8A7AA241DAC2FE80054C75C /* RandomUserSwift */; 245 | targetProxy = C8A7AA301DAC2FE90054C75C /* PBXContainerItemProxy */; 246 | }; 247 | /* End PBXTargetDependency section */ 248 | 249 | /* Begin XCBuildConfiguration section */ 250 | C8A7AA371DAC2FE90054C75C /* Debug */ = { 251 | isa = XCBuildConfiguration; 252 | buildSettings = { 253 | ALWAYS_SEARCH_USER_PATHS = NO; 254 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 255 | CLANG_ANALYZER_NONNULL = YES; 256 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 257 | CLANG_CXX_LIBRARY = "libc++"; 258 | CLANG_ENABLE_MODULES = YES; 259 | CLANG_ENABLE_OBJC_ARC = YES; 260 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 261 | CLANG_WARN_BOOL_CONVERSION = YES; 262 | CLANG_WARN_COMMA = YES; 263 | CLANG_WARN_CONSTANT_CONVERSION = YES; 264 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 265 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 266 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 267 | CLANG_WARN_EMPTY_BODY = YES; 268 | CLANG_WARN_ENUM_CONVERSION = YES; 269 | CLANG_WARN_INFINITE_RECURSION = YES; 270 | CLANG_WARN_INT_CONVERSION = YES; 271 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 272 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 273 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 274 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 275 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 276 | CLANG_WARN_STRICT_PROTOTYPES = YES; 277 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 278 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 279 | CLANG_WARN_UNREACHABLE_CODE = YES; 280 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 281 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 282 | COPY_PHASE_STRIP = NO; 283 | CURRENT_PROJECT_VERSION = 1; 284 | DEBUG_INFORMATION_FORMAT = dwarf; 285 | ENABLE_STRICT_OBJC_MSGSEND = YES; 286 | ENABLE_TESTABILITY = YES; 287 | GCC_C_LANGUAGE_STANDARD = gnu99; 288 | GCC_DYNAMIC_NO_PIC = NO; 289 | GCC_NO_COMMON_BLOCKS = YES; 290 | GCC_OPTIMIZATION_LEVEL = 0; 291 | GCC_PREPROCESSOR_DEFINITIONS = ( 292 | "DEBUG=1", 293 | "$(inherited)", 294 | ); 295 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 296 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 297 | GCC_WARN_UNDECLARED_SELECTOR = YES; 298 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 299 | GCC_WARN_UNUSED_FUNCTION = YES; 300 | GCC_WARN_UNUSED_VARIABLE = YES; 301 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 302 | MTL_ENABLE_DEBUG_INFO = YES; 303 | ONLY_ACTIVE_ARCH = YES; 304 | SDKROOT = iphoneos; 305 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 306 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 307 | TARGETED_DEVICE_FAMILY = "1,2"; 308 | VERSIONING_SYSTEM = "apple-generic"; 309 | VERSION_INFO_PREFIX = ""; 310 | }; 311 | name = Debug; 312 | }; 313 | C8A7AA381DAC2FE90054C75C /* Release */ = { 314 | isa = XCBuildConfiguration; 315 | buildSettings = { 316 | ALWAYS_SEARCH_USER_PATHS = NO; 317 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 318 | CLANG_ANALYZER_NONNULL = YES; 319 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 320 | CLANG_CXX_LIBRARY = "libc++"; 321 | CLANG_ENABLE_MODULES = YES; 322 | CLANG_ENABLE_OBJC_ARC = YES; 323 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 324 | CLANG_WARN_BOOL_CONVERSION = YES; 325 | CLANG_WARN_COMMA = YES; 326 | CLANG_WARN_CONSTANT_CONVERSION = YES; 327 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 328 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 329 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 330 | CLANG_WARN_EMPTY_BODY = YES; 331 | CLANG_WARN_ENUM_CONVERSION = YES; 332 | CLANG_WARN_INFINITE_RECURSION = YES; 333 | CLANG_WARN_INT_CONVERSION = YES; 334 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 335 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 336 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 337 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 338 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 339 | CLANG_WARN_STRICT_PROTOTYPES = YES; 340 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 341 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 342 | CLANG_WARN_UNREACHABLE_CODE = YES; 343 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 344 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 345 | COPY_PHASE_STRIP = NO; 346 | CURRENT_PROJECT_VERSION = 1; 347 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 348 | ENABLE_NS_ASSERTIONS = NO; 349 | ENABLE_STRICT_OBJC_MSGSEND = YES; 350 | GCC_C_LANGUAGE_STANDARD = gnu99; 351 | GCC_NO_COMMON_BLOCKS = YES; 352 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 353 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 354 | GCC_WARN_UNDECLARED_SELECTOR = YES; 355 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 356 | GCC_WARN_UNUSED_FUNCTION = YES; 357 | GCC_WARN_UNUSED_VARIABLE = YES; 358 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 359 | MTL_ENABLE_DEBUG_INFO = NO; 360 | SDKROOT = iphoneos; 361 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 362 | TARGETED_DEVICE_FAMILY = "1,2"; 363 | VALIDATE_PRODUCT = YES; 364 | VERSIONING_SYSTEM = "apple-generic"; 365 | VERSION_INFO_PREFIX = ""; 366 | }; 367 | name = Release; 368 | }; 369 | C8A7AA3A1DAC2FE90054C75C /* Debug */ = { 370 | isa = XCBuildConfiguration; 371 | buildSettings = { 372 | CLANG_ENABLE_MODULES = YES; 373 | CODE_SIGN_IDENTITY = ""; 374 | DEFINES_MODULE = YES; 375 | DEVELOPMENT_TEAM = ""; 376 | DYLIB_COMPATIBILITY_VERSION = 1; 377 | DYLIB_CURRENT_VERSION = 1; 378 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 379 | INFOPLIST_FILE = RandomUserSwift/Info.plist; 380 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 381 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 382 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 383 | PRODUCT_BUNDLE_IDENTIFIER = com.wilsonding.RandomUserSwift; 384 | PRODUCT_NAME = "$(TARGET_NAME)"; 385 | SKIP_INSTALL = YES; 386 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 387 | SWIFT_VERSION = 5.0; 388 | }; 389 | name = Debug; 390 | }; 391 | C8A7AA3B1DAC2FE90054C75C /* Release */ = { 392 | isa = XCBuildConfiguration; 393 | buildSettings = { 394 | CLANG_ENABLE_MODULES = YES; 395 | CODE_SIGN_IDENTITY = ""; 396 | DEFINES_MODULE = YES; 397 | DEVELOPMENT_TEAM = ""; 398 | DYLIB_COMPATIBILITY_VERSION = 1; 399 | DYLIB_CURRENT_VERSION = 1; 400 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 401 | INFOPLIST_FILE = RandomUserSwift/Info.plist; 402 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 403 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 404 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 405 | PRODUCT_BUNDLE_IDENTIFIER = com.wilsonding.RandomUserSwift; 406 | PRODUCT_NAME = "$(TARGET_NAME)"; 407 | SKIP_INSTALL = YES; 408 | SWIFT_VERSION = 5.0; 409 | }; 410 | name = Release; 411 | }; 412 | C8A7AA3D1DAC2FE90054C75C /* Debug */ = { 413 | isa = XCBuildConfiguration; 414 | buildSettings = { 415 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 416 | DEVELOPMENT_TEAM = 585SNYAD83; 417 | INFOPLIST_FILE = RandomUserSwiftTests/Info.plist; 418 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 419 | PRODUCT_BUNDLE_IDENTIFIER = com.wilsonding.RandomUserSwiftTests; 420 | PRODUCT_NAME = "$(TARGET_NAME)"; 421 | SWIFT_VERSION = 5.0; 422 | }; 423 | name = Debug; 424 | }; 425 | C8A7AA3E1DAC2FE90054C75C /* Release */ = { 426 | isa = XCBuildConfiguration; 427 | buildSettings = { 428 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 429 | DEVELOPMENT_TEAM = 585SNYAD83; 430 | INFOPLIST_FILE = RandomUserSwiftTests/Info.plist; 431 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 432 | PRODUCT_BUNDLE_IDENTIFIER = com.wilsonding.RandomUserSwiftTests; 433 | PRODUCT_NAME = "$(TARGET_NAME)"; 434 | SWIFT_VERSION = 5.0; 435 | }; 436 | name = Release; 437 | }; 438 | /* End XCBuildConfiguration section */ 439 | 440 | /* Begin XCConfigurationList section */ 441 | C8A7AA1F1DAC2FE80054C75C /* Build configuration list for PBXProject "RandomUserSwift" */ = { 442 | isa = XCConfigurationList; 443 | buildConfigurations = ( 444 | C8A7AA371DAC2FE90054C75C /* Debug */, 445 | C8A7AA381DAC2FE90054C75C /* Release */, 446 | ); 447 | defaultConfigurationIsVisible = 0; 448 | defaultConfigurationName = Release; 449 | }; 450 | C8A7AA391DAC2FE90054C75C /* Build configuration list for PBXNativeTarget "RandomUserSwift" */ = { 451 | isa = XCConfigurationList; 452 | buildConfigurations = ( 453 | C8A7AA3A1DAC2FE90054C75C /* Debug */, 454 | C8A7AA3B1DAC2FE90054C75C /* Release */, 455 | ); 456 | defaultConfigurationIsVisible = 0; 457 | defaultConfigurationName = Release; 458 | }; 459 | C8A7AA3C1DAC2FE90054C75C /* Build configuration list for PBXNativeTarget "RandomUserSwiftTests" */ = { 460 | isa = XCConfigurationList; 461 | buildConfigurations = ( 462 | C8A7AA3D1DAC2FE90054C75C /* Debug */, 463 | C8A7AA3E1DAC2FE90054C75C /* Release */, 464 | ); 465 | defaultConfigurationIsVisible = 0; 466 | defaultConfigurationName = Release; 467 | }; 468 | /* End XCConfigurationList section */ 469 | }; 470 | rootObject = C8A7AA1C1DAC2FE80054C75C /* Project object */; 471 | } 472 | -------------------------------------------------------------------------------- /RandomUserSwift.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /RandomUserSwift.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /RandomUserSwift.xcodeproj/xcshareddata/xcschemes/RandomUserSwift.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 34 | 40 | 41 | 42 | 43 | 44 | 50 | 51 | 52 | 53 | 54 | 55 | 65 | 66 | 72 | 73 | 74 | 75 | 76 | 77 | 83 | 84 | 90 | 91 | 92 | 93 | 95 | 96 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /RandomUserSwift.xcodeproj/xcuserdata/wilson.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /RandomUserSwift.xcodeproj/xcuserdata/wilson.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | RandomUserSwift.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | C8A7AA241DAC2FE80054C75C 16 | 17 | primary 18 | 19 | 20 | C8A7AA2D1DAC2FE90054C75C 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /RandomUserSwift/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSPrincipalClass 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /RandomUserSwift/RandomUser.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RandomUser.swift 3 | // RandomUserSwift 4 | // 5 | // Created by Wilson Ding on 10/10/16. 6 | // Copyright © 2016 Wilson Ding. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /// Class that interacts with the RandomUser API to generate random users 12 | public class RandomUser { 13 | 14 | /// Singleton 15 | public static let shared = RandomUser() 16 | 17 | /// API Version Number 18 | private static var apiVersion = 1.2 19 | 20 | /** 21 | Get one or more users from RandomUser API (https://www.randomuser.me/documentation) 22 | 23 | - parameter results: (optional) number of generated users to fetch in one request. Max is 5000. Default is 1. 24 | - parameter gender: (optional) specify whether you would like to have only male/female users generated. 25 | Valid values for the gender parameter are "male" or "female", or you may leave the parameter blank. 26 | Any other value will cause the service to return both male and female users. Default is both. 27 | - parameter nationality: (optional) specify nationality of generator users via comma separated values. 28 | Pictures won't be affected by this, but data such as location, cell/home phone, id, etc. will be more appropriate. 29 | Available nationalities for api v1.2 include: AU, BR, CA, CH, DE, DK, ES, FI, FR, GB, IE, IR, NO, NL, NZ, TR, US 30 | Default is random. 31 | */ 32 | public func getUsers(results: Int = 1, 33 | gender: String = "both", 34 | nationality: String = "", 35 | _ completionHandler: @escaping (_ data: Users?, _ error: Error?) -> Void) { 36 | 37 | guard let url = createUrl(results: results, gender: gender, nationality: nationality) else { return } 38 | 39 | let task = URLSession.shared.dataTask(with: url) { data, _, error in 40 | guard 41 | error == nil, 42 | let data = data 43 | else { 44 | completionHandler(nil, error) 45 | return 46 | } 47 | 48 | let users = try? JSONDecoder().decode(Users.self, from: data) 49 | completionHandler(users, nil) 50 | } 51 | 52 | task.resume() 53 | } 54 | 55 | /// Create URL with config query parameters to use for RandomUser API 56 | private func createUrl(results: Int, gender: String, nationality: String) -> URL? { 57 | // swiftlint:disable line_length 58 | return URL(string: "https://randomuser.me/api/\(RandomUser.apiVersion)/?format=json&results=\(results)&gender=\(gender)&nat=\(nationality)") 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /RandomUserSwift/RandomUserSwift.h: -------------------------------------------------------------------------------- 1 | // 2 | // RandomUserSwift.h 3 | // RandomUserSwift 4 | // 5 | // Created by Wilson Ding on 10/10/16. 6 | // Copyright © 2016 Wilson Ding. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for RandomUserSwift. 12 | FOUNDATION_EXPORT double RandomUserSwiftVersionNumber; 13 | 14 | //! Project version string for RandomUserSwift. 15 | FOUNDATION_EXPORT const unsigned char RandomUserSwiftVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /RandomUserSwift/Users.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Users.swift 3 | // RandomUserSwift 4 | // 5 | // Created by Wilson Ding on 10/10/16. 6 | // Copyright © 2016 Wilson Ding. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /// Codable Struct conforming to return payload from RandomUser API call 12 | public struct Users: Codable { 13 | let results: [Result]? 14 | let info: Info? 15 | } 16 | 17 | struct Info: Codable { 18 | let seed: String? 19 | let results, page: Int? 20 | let version: String? 21 | } 22 | 23 | struct Result: Codable { 24 | let gender: Gender? 25 | let name: NameClass? 26 | let location: Location? 27 | let email: String? 28 | let login: Login? 29 | let dob, registered: Dob? 30 | let phone, cell: String? 31 | // swiftlint:disable identifier_name 32 | let id: ID? 33 | let picture: Picture? 34 | let nat: String? 35 | } 36 | 37 | struct Dob: Codable { 38 | let date: String? 39 | let age: Int? 40 | } 41 | 42 | enum Gender: String, Codable { 43 | case female 44 | case male 45 | } 46 | 47 | // swiftlint:disable type_name 48 | struct ID: Codable { 49 | let name: NameEnum? 50 | let value: String? 51 | } 52 | 53 | enum NameEnum: String, Codable { 54 | case avs = "AVS" 55 | case bsn = "BSN" 56 | case cpr = "CPR" 57 | case dni = "DNI" 58 | case empty = "" 59 | // swiftlint:disable identifier_name 60 | case fn = "FN" 61 | case hetu = "HETU" 62 | case insee = "INSEE" 63 | case nino = "NINO" 64 | case pps = "PPS" 65 | case ssn = "SSN" 66 | case tfn = "TFN" 67 | } 68 | 69 | struct Location: Codable { 70 | let street, city, state: String? 71 | let postcode: Postcode? 72 | let coordinates: Coordinates? 73 | let timezone: Timezone? 74 | } 75 | 76 | struct Coordinates: Codable { 77 | let latitude, longitude: String? 78 | } 79 | 80 | enum Postcode: Codable { 81 | case integer(Int) 82 | case string(String) 83 | 84 | init(from decoder: Decoder) throws { 85 | let container = try decoder.singleValueContainer() 86 | if let value = try? container.decode(Int.self) { 87 | self = .integer(value) 88 | return 89 | } 90 | if let value = try? container.decode(String.self) { 91 | self = .string(value) 92 | return 93 | } 94 | throw DecodingError.typeMismatch(Postcode.self, 95 | DecodingError.Context(codingPath: decoder.codingPath, 96 | debugDescription: "Wrong type for Postcode")) 97 | } 98 | 99 | func encode(to encoder: Encoder) throws { 100 | var container = encoder.singleValueContainer() 101 | switch self { 102 | case .integer(let value): 103 | try container.encode(value) 104 | case .string(let value): 105 | try container.encode(value) 106 | } 107 | } 108 | } 109 | 110 | struct Timezone: Codable { 111 | let offset, description: String? 112 | } 113 | 114 | struct Login: Codable { 115 | let uuid, username, password, salt: String? 116 | let md5, sha1, sha256: String? 117 | } 118 | 119 | struct NameClass: Codable { 120 | let title: Title? 121 | let first, last: String? 122 | } 123 | 124 | enum Title: String, Codable { 125 | case madame 126 | case mademoiselle 127 | case miss 128 | case monsieur 129 | // swiftlint:disable identifier_name 130 | case mr 131 | // swiftlint:enable identifier_name 132 | case mrs 133 | // swiftlint:disable identifier_name 134 | case ms 135 | // swiftlint:enable identifier_name 136 | } 137 | 138 | struct Picture: Codable { 139 | let large, medium, thumbnail: String? 140 | } 141 | -------------------------------------------------------------------------------- /RandomUserSwiftTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /RandomUserSwiftTests/RandomUserSwiftTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RandomUserSwiftTests.swift 3 | // RandomUserSwiftTests 4 | // 5 | // Created by Wilson Ding on 10/10/16. 6 | // Copyright © 2016 Wilson Ding. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import RandomUserSwift 11 | 12 | class RandomUserSwiftTests: XCTestCase { 13 | 14 | var data: Users? 15 | var error: Error? 16 | 17 | var expectation: XCTestExpectation? 18 | 19 | override func setUp() { 20 | super.setUp() 21 | 22 | self.error = nil 23 | self.data = nil 24 | self.expectation = self.expectation(description: "api") 25 | } 26 | 27 | override func tearDown() { 28 | XCTAssertNil(self.error, "Running getUsers returns non-nil error.") 29 | XCTAssertNotNil(self.data, "Running getUsers returns nil value for data.") 30 | 31 | self.expectation = nil 32 | super.tearDown() 33 | } 34 | 35 | func testGetUsersWithMultipleResults() { 36 | RandomUser.shared.getUsers(results: 5) { 37 | self.data = $0 38 | self.error = $1 39 | 40 | self.expectation?.fulfill() 41 | } 42 | 43 | waitForExpectations(timeout: 5, handler: nil) 44 | 45 | XCTAssertEqual(data?.results?.count, 46 | 5, 47 | "Setting multiple results does not generate correct number of users.") 48 | } 49 | 50 | func testGetUsersByFemaleGender() { 51 | RandomUser.shared.getUsers(gender: "female") { 52 | self.data = $0 53 | self.error = $1 54 | 55 | self.expectation?.fulfill() 56 | } 57 | 58 | waitForExpectations(timeout: 5, handler: nil) 59 | 60 | XCTAssertEqual(data?.results?[0].gender?.rawValue, 61 | "female", 62 | "Setting gender as female does not generate a female user.") 63 | } 64 | 65 | func testGetUsersByMaleGender() { 66 | RandomUser.shared.getUsers(gender: "male") { 67 | self.data = $0 68 | self.error = $1 69 | 70 | self.expectation?.fulfill() 71 | } 72 | 73 | waitForExpectations(timeout: 5, handler: nil) 74 | 75 | XCTAssertEqual(data?.results?[0].gender?.rawValue, 76 | "male", 77 | "Setting gender as male does not generate a male user.") 78 | } 79 | 80 | func testGetUsersByNationality() { 81 | RandomUser.shared.getUsers(nationality: "us") { 82 | self.data = $0 83 | self.error = $1 84 | 85 | self.expectation?.fulfill() 86 | } 87 | 88 | waitForExpectations(timeout: 5, handler: nil) 89 | 90 | XCTAssertEqual(data?.results?[0].nat, 91 | "US", 92 | "Setting nationality as US does not generate a user with US nat.") 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /docs/Classes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Classes Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

RandomUserSwift Docs (100% documented)

18 |

View on GitHub

19 |
20 |
21 |
22 | 27 |
28 |
29 | 49 |
50 |
51 |
52 |

Classes

53 |

The following classes are available globally.

54 | 55 |
56 |
57 |
58 |
    59 |
  • 60 |
    61 | 62 | 63 | 64 | RandomUser 65 | 66 |
    67 |
    68 |
    69 |
    70 |
    71 |
    72 |

    Class that interacts with the RandomUser API to generate random users

    73 | 74 | See more 75 |
    76 |
    77 |

    Declaration

    78 |
    79 |

    Swift

    80 |
    public class RandomUser
    81 | 82 |
    83 |
    84 |
    85 |
    86 |
  • 87 |
88 |
89 |
90 |
91 | 95 |
96 |
97 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /docs/Classes/RandomUser.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | RandomUser Class Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

RandomUserSwift Docs (100% documented)

18 |

View on GitHub

19 |
20 |
21 |
22 | 27 |
28 |
29 | 49 |
50 |
51 |
52 |

RandomUser

53 |
54 |
55 |
public class RandomUser
56 | 57 |
58 |
59 |

Class that interacts with the RandomUser API to generate random users

60 | 61 |
62 |
63 |
64 |
    65 |
  • 66 |
    67 | 68 | 69 | 70 | shared 71 | 72 |
    73 |
    74 |
    75 |
    76 |
    77 |
    78 |

    Singleton

    79 | 80 |
    81 |
    82 |

    Declaration

    83 |
    84 |

    Swift

    85 |
    public static let shared: RandomUser
    86 | 87 |
    88 |
    89 |
    90 |
    91 |
  • 92 |
  • 93 |
    94 | 95 | 96 | 97 | getUsers(results:gender:nationality:_:) 98 | 99 |
    100 |
    101 |
    102 |
    103 |
    104 |
    105 |

    Get one or more users from RandomUser API (https://www.randomuser.me/documentation)

    106 | 107 |
    108 |
    109 |

    Declaration

    110 |
    111 |

    Swift

    112 |
    public func getUsers(results: Int = 1,
    113 |                      gender: String = "both",
    114 |                      nationality: String = "",
    115 |                      _ completionHandler: @escaping (_ data: Users?, _ error: Error?) -> Void)
    116 | 117 |
    118 |
    119 |
    120 |

    Parameters

    121 | 122 | 123 | 124 | 129 | 134 | 135 | 136 | 141 | 148 | 149 | 150 | 155 | 163 | 164 | 165 |
    125 | 126 | results 127 | 128 | 130 |
    131 |

    (optional) number of generated users to fetch in one request. Max is 5000. Default is 1.

    132 |
    133 |
    137 | 138 | gender 139 | 140 | 142 |
    143 |

    (optional) specify whether you would like to have only male/female users generated. 144 | Valid values for the gender parameter are “male” or “female”, or you may leave the parameter blank. 145 | Any other value will cause the service to return both male and female users. Default is both.

    146 |
    147 |
    151 | 152 | nationality 153 | 154 | 156 |
    157 |

    (optional) specify nationality of generator users via comma separated values. 158 | Pictures won’t be affected by this, but data such as location, cell/home phone, id, etc. will be more appropriate. 159 | Available nationalities for api v1.2 include: AU, BR, CA, CH, DE, DK, ES, FI, FR, GB, IE, IR, NO, NL, NZ, TR, US 160 | Default is random.

    161 |
    162 |
    166 |
    167 |
    168 |
    169 |
  • 170 |
171 |
172 |
173 |
174 | 178 |
179 |
180 | 181 | 182 | 183 | -------------------------------------------------------------------------------- /docs/Structs.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Structures Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

RandomUserSwift Docs (100% documented)

18 |

View on GitHub

19 |
20 |
21 |
22 | 27 |
28 |
29 | 49 |
50 |
51 |
52 |

Structures

53 |

The following structures are available globally.

54 | 55 |
56 |
57 |
58 |
    59 |
  • 60 |
    61 | 62 | 63 | 64 | Users 65 | 66 |
    67 |
    68 |
    69 |
    70 |
    71 |
    72 |

    Codable Struct conforming to return payload from RandomUser API call

    73 | 74 |
    75 |
    76 |

    Declaration

    77 |
    78 |

    Swift

    79 |
    public struct Users : Codable
    80 | 81 |
    82 |
    83 |
    84 |
    85 |
  • 86 |
87 |
88 |
89 |
90 | 94 |
95 |
96 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /docs/badge.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | documentation 17 | 18 | 19 | documentation 20 | 21 | 22 | 100% 23 | 24 | 25 | 100% 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/css/highlight.css: -------------------------------------------------------------------------------- 1 | /* Credit to https://gist.github.com/wataru420/2048287 */ 2 | .highlight { 3 | /* Comment */ 4 | /* Error */ 5 | /* Keyword */ 6 | /* Operator */ 7 | /* Comment.Multiline */ 8 | /* Comment.Preproc */ 9 | /* Comment.Single */ 10 | /* Comment.Special */ 11 | /* Generic.Deleted */ 12 | /* Generic.Deleted.Specific */ 13 | /* Generic.Emph */ 14 | /* Generic.Error */ 15 | /* Generic.Heading */ 16 | /* Generic.Inserted */ 17 | /* Generic.Inserted.Specific */ 18 | /* Generic.Output */ 19 | /* Generic.Prompt */ 20 | /* Generic.Strong */ 21 | /* Generic.Subheading */ 22 | /* Generic.Traceback */ 23 | /* Keyword.Constant */ 24 | /* Keyword.Declaration */ 25 | /* Keyword.Pseudo */ 26 | /* Keyword.Reserved */ 27 | /* Keyword.Type */ 28 | /* Literal.Number */ 29 | /* Literal.String */ 30 | /* Name.Attribute */ 31 | /* Name.Builtin */ 32 | /* Name.Class */ 33 | /* Name.Constant */ 34 | /* Name.Entity */ 35 | /* Name.Exception */ 36 | /* Name.Function */ 37 | /* Name.Namespace */ 38 | /* Name.Tag */ 39 | /* Name.Variable */ 40 | /* Operator.Word */ 41 | /* Text.Whitespace */ 42 | /* Literal.Number.Float */ 43 | /* Literal.Number.Hex */ 44 | /* Literal.Number.Integer */ 45 | /* Literal.Number.Oct */ 46 | /* Literal.String.Backtick */ 47 | /* Literal.String.Char */ 48 | /* Literal.String.Doc */ 49 | /* Literal.String.Double */ 50 | /* Literal.String.Escape */ 51 | /* Literal.String.Heredoc */ 52 | /* Literal.String.Interpol */ 53 | /* Literal.String.Other */ 54 | /* Literal.String.Regex */ 55 | /* Literal.String.Single */ 56 | /* Literal.String.Symbol */ 57 | /* Name.Builtin.Pseudo */ 58 | /* Name.Variable.Class */ 59 | /* Name.Variable.Global */ 60 | /* Name.Variable.Instance */ 61 | /* Literal.Number.Integer.Long */ } 62 | .highlight .c { 63 | color: #999988; 64 | font-style: italic; } 65 | .highlight .err { 66 | color: #a61717; 67 | background-color: #e3d2d2; } 68 | .highlight .k { 69 | color: #000000; 70 | font-weight: bold; } 71 | .highlight .o { 72 | color: #000000; 73 | font-weight: bold; } 74 | .highlight .cm { 75 | color: #999988; 76 | font-style: italic; } 77 | .highlight .cp { 78 | color: #999999; 79 | font-weight: bold; } 80 | .highlight .c1 { 81 | color: #999988; 82 | font-style: italic; } 83 | .highlight .cs { 84 | color: #999999; 85 | font-weight: bold; 86 | font-style: italic; } 87 | .highlight .gd { 88 | color: #000000; 89 | background-color: #ffdddd; } 90 | .highlight .gd .x { 91 | color: #000000; 92 | background-color: #ffaaaa; } 93 | .highlight .ge { 94 | color: #000000; 95 | font-style: italic; } 96 | .highlight .gr { 97 | color: #aa0000; } 98 | .highlight .gh { 99 | color: #999999; } 100 | .highlight .gi { 101 | color: #000000; 102 | background-color: #ddffdd; } 103 | .highlight .gi .x { 104 | color: #000000; 105 | background-color: #aaffaa; } 106 | .highlight .go { 107 | color: #888888; } 108 | .highlight .gp { 109 | color: #555555; } 110 | .highlight .gs { 111 | font-weight: bold; } 112 | .highlight .gu { 113 | color: #aaaaaa; } 114 | .highlight .gt { 115 | color: #aa0000; } 116 | .highlight .kc { 117 | color: #000000; 118 | font-weight: bold; } 119 | .highlight .kd { 120 | color: #000000; 121 | font-weight: bold; } 122 | .highlight .kp { 123 | color: #000000; 124 | font-weight: bold; } 125 | .highlight .kr { 126 | color: #000000; 127 | font-weight: bold; } 128 | .highlight .kt { 129 | color: #445588; } 130 | .highlight .m { 131 | color: #009999; } 132 | .highlight .s { 133 | color: #d14; } 134 | .highlight .na { 135 | color: #008080; } 136 | .highlight .nb { 137 | color: #0086B3; } 138 | .highlight .nc { 139 | color: #445588; 140 | font-weight: bold; } 141 | .highlight .no { 142 | color: #008080; } 143 | .highlight .ni { 144 | color: #800080; } 145 | .highlight .ne { 146 | color: #990000; 147 | font-weight: bold; } 148 | .highlight .nf { 149 | color: #990000; } 150 | .highlight .nn { 151 | color: #555555; } 152 | .highlight .nt { 153 | color: #000080; } 154 | .highlight .nv { 155 | color: #008080; } 156 | .highlight .ow { 157 | color: #000000; 158 | font-weight: bold; } 159 | .highlight .w { 160 | color: #bbbbbb; } 161 | .highlight .mf { 162 | color: #009999; } 163 | .highlight .mh { 164 | color: #009999; } 165 | .highlight .mi { 166 | color: #009999; } 167 | .highlight .mo { 168 | color: #009999; } 169 | .highlight .sb { 170 | color: #d14; } 171 | .highlight .sc { 172 | color: #d14; } 173 | .highlight .sd { 174 | color: #d14; } 175 | .highlight .s2 { 176 | color: #d14; } 177 | .highlight .se { 178 | color: #d14; } 179 | .highlight .sh { 180 | color: #d14; } 181 | .highlight .si { 182 | color: #d14; } 183 | .highlight .sx { 184 | color: #d14; } 185 | .highlight .sr { 186 | color: #009926; } 187 | .highlight .s1 { 188 | color: #d14; } 189 | .highlight .ss { 190 | color: #990073; } 191 | .highlight .bp { 192 | color: #999999; } 193 | .highlight .vc { 194 | color: #008080; } 195 | .highlight .vg { 196 | color: #008080; } 197 | .highlight .vi { 198 | color: #008080; } 199 | .highlight .il { 200 | color: #009999; } 201 | -------------------------------------------------------------------------------- /docs/css/jazzy.css: -------------------------------------------------------------------------------- 1 | html, body, div, span, h1, h3, h4, p, a, code, em, img, ul, li, table, tbody, tr, td { 2 | background: transparent; 3 | border: 0; 4 | margin: 0; 5 | outline: 0; 6 | padding: 0; 7 | vertical-align: baseline; } 8 | 9 | body { 10 | background-color: #f2f2f2; 11 | font-family: Helvetica, freesans, Arial, sans-serif; 12 | font-size: 14px; 13 | -webkit-font-smoothing: subpixel-antialiased; 14 | word-wrap: break-word; } 15 | 16 | h1, h2, h3 { 17 | margin-top: 0.8em; 18 | margin-bottom: 0.3em; 19 | font-weight: 100; 20 | color: black; } 21 | 22 | h1 { 23 | font-size: 2.5em; } 24 | 25 | h2 { 26 | font-size: 2em; 27 | border-bottom: 1px solid #e2e2e2; } 28 | 29 | h4 { 30 | font-size: 13px; 31 | line-height: 1.5; 32 | margin-top: 21px; } 33 | 34 | h5 { 35 | font-size: 1.1em; } 36 | 37 | h6 { 38 | font-size: 1.1em; 39 | color: #777; } 40 | 41 | .section-name { 42 | color: gray; 43 | display: block; 44 | font-family: Helvetica; 45 | font-size: 22px; 46 | font-weight: 100; 47 | margin-bottom: 15px; } 48 | 49 | pre, code { 50 | font: 0.95em Menlo, monospace; 51 | color: #777; 52 | word-wrap: normal; } 53 | 54 | p code, li code { 55 | background-color: #eee; 56 | padding: 2px 4px; 57 | border-radius: 4px; } 58 | 59 | a { 60 | color: #0088cc; 61 | text-decoration: none; } 62 | 63 | ul { 64 | padding-left: 15px; } 65 | 66 | li { 67 | line-height: 1.8em; } 68 | 69 | img { 70 | max-width: 100%; } 71 | 72 | blockquote { 73 | margin-left: 0; 74 | padding: 0 10px; 75 | border-left: 4px solid #ccc; } 76 | 77 | .content-wrapper { 78 | margin: 0 auto; 79 | width: 980px; } 80 | 81 | header { 82 | font-size: 0.85em; 83 | line-height: 26px; 84 | background-color: #414141; 85 | position: fixed; 86 | width: 100%; 87 | z-index: 2; } 88 | header img { 89 | padding-right: 6px; 90 | vertical-align: -4px; 91 | height: 16px; } 92 | header a { 93 | color: #fff; } 94 | header p { 95 | float: left; 96 | color: #999; } 97 | header .header-right { 98 | float: right; 99 | margin-left: 16px; } 100 | 101 | #breadcrumbs { 102 | background-color: #f2f2f2; 103 | height: 27px; 104 | padding-top: 17px; 105 | position: fixed; 106 | width: 100%; 107 | z-index: 2; 108 | margin-top: 26px; } 109 | #breadcrumbs #carat { 110 | height: 10px; 111 | margin: 0 5px; } 112 | 113 | .sidebar { 114 | background-color: #f9f9f9; 115 | border: 1px solid #e2e2e2; 116 | overflow-y: auto; 117 | overflow-x: hidden; 118 | position: fixed; 119 | top: 70px; 120 | bottom: 0; 121 | width: 230px; 122 | word-wrap: normal; } 123 | 124 | .nav-groups { 125 | list-style-type: none; 126 | background: #fff; 127 | padding-left: 0; } 128 | 129 | .nav-group-name { 130 | border-bottom: 1px solid #e2e2e2; 131 | font-size: 1.1em; 132 | font-weight: 100; 133 | padding: 15px 0 15px 20px; } 134 | .nav-group-name > a { 135 | color: #333; } 136 | 137 | .nav-group-tasks { 138 | margin-top: 5px; } 139 | 140 | .nav-group-task { 141 | font-size: 0.9em; 142 | list-style-type: none; 143 | white-space: nowrap; } 144 | .nav-group-task a { 145 | color: #888; } 146 | 147 | .main-content { 148 | background-color: #fff; 149 | border: 1px solid #e2e2e2; 150 | margin-left: 246px; 151 | position: absolute; 152 | overflow: hidden; 153 | padding-bottom: 20px; 154 | top: 70px; 155 | width: 734px; } 156 | .main-content p, .main-content a, .main-content code, .main-content em, .main-content ul, .main-content table, .main-content blockquote { 157 | margin-bottom: 1em; } 158 | .main-content p { 159 | line-height: 1.8em; } 160 | .main-content section .section:first-child { 161 | margin-top: 0; 162 | padding-top: 0; } 163 | .main-content section .task-group-section .task-group:first-of-type { 164 | padding-top: 10px; } 165 | .main-content section .task-group-section .task-group:first-of-type .section-name { 166 | padding-top: 15px; } 167 | .main-content section .heading:before { 168 | content: ""; 169 | display: block; 170 | padding-top: 70px; 171 | margin: -70px 0 0; } 172 | .main-content .section-name p { 173 | margin-bottom: inherit; 174 | line-height: inherit; } 175 | .main-content .section-name code { 176 | background-color: inherit; 177 | padding: inherit; 178 | color: inherit; } 179 | 180 | .section { 181 | padding: 0 25px; } 182 | 183 | .highlight { 184 | background-color: #eee; 185 | padding: 10px 12px; 186 | border: 1px solid #e2e2e2; 187 | border-radius: 4px; 188 | overflow-x: auto; } 189 | 190 | .declaration .highlight { 191 | overflow-x: initial; 192 | padding: 0 40px 40px 0; 193 | margin-bottom: -25px; 194 | background-color: transparent; 195 | border: none; } 196 | 197 | .section-name { 198 | margin: 0; 199 | margin-left: 18px; } 200 | 201 | .task-group-section { 202 | padding-left: 6px; 203 | border-top: 1px solid #e2e2e2; } 204 | 205 | .task-group { 206 | padding-top: 0px; } 207 | 208 | .task-name-container a[name]:before { 209 | content: ""; 210 | display: block; 211 | padding-top: 70px; 212 | margin: -70px 0 0; } 213 | 214 | .section-name-container { 215 | position: relative; 216 | display: inline-block; } 217 | .section-name-container .section-name-link { 218 | position: absolute; 219 | top: 0; 220 | left: 0; 221 | bottom: 0; 222 | right: 0; 223 | margin-bottom: 0; } 224 | .section-name-container .section-name { 225 | position: relative; 226 | pointer-events: none; 227 | z-index: 1; } 228 | .section-name-container .section-name a { 229 | pointer-events: auto; } 230 | 231 | .item { 232 | padding-top: 8px; 233 | width: 100%; 234 | list-style-type: none; } 235 | .item a[name]:before { 236 | content: ""; 237 | display: block; 238 | padding-top: 70px; 239 | margin: -70px 0 0; } 240 | .item code { 241 | background-color: transparent; 242 | padding: 0; } 243 | .item .token, .item .direct-link { 244 | padding-left: 3px; 245 | margin-left: 15px; 246 | font-size: 11.9px; 247 | transition: all 300ms; } 248 | .item .token-open { 249 | margin-left: 0px; } 250 | .item .discouraged { 251 | text-decoration: line-through; } 252 | .item .declaration-note { 253 | font-size: .85em; 254 | color: gray; 255 | font-style: italic; } 256 | 257 | .pointer-container { 258 | border-bottom: 1px solid #e2e2e2; 259 | left: -23px; 260 | padding-bottom: 13px; 261 | position: relative; 262 | width: 110%; } 263 | 264 | .pointer { 265 | background: #f9f9f9; 266 | border-left: 1px solid #e2e2e2; 267 | border-top: 1px solid #e2e2e2; 268 | height: 12px; 269 | left: 21px; 270 | top: -7px; 271 | -webkit-transform: rotate(45deg); 272 | -moz-transform: rotate(45deg); 273 | -o-transform: rotate(45deg); 274 | transform: rotate(45deg); 275 | position: absolute; 276 | width: 12px; } 277 | 278 | .height-container { 279 | display: none; 280 | left: -25px; 281 | padding: 0 25px; 282 | position: relative; 283 | width: 100%; 284 | overflow: hidden; } 285 | .height-container .section { 286 | background: #f9f9f9; 287 | border-bottom: 1px solid #e2e2e2; 288 | left: -25px; 289 | position: relative; 290 | width: 100%; 291 | padding-top: 10px; 292 | padding-bottom: 5px; } 293 | 294 | .aside, .language { 295 | padding: 6px 12px; 296 | margin: 12px 0; 297 | border-left: 5px solid #dddddd; 298 | overflow-y: hidden; } 299 | .aside .aside-title, .language .aside-title { 300 | font-size: 9px; 301 | letter-spacing: 2px; 302 | text-transform: uppercase; 303 | padding-bottom: 0; 304 | margin: 0; 305 | color: #aaa; 306 | -webkit-user-select: none; } 307 | .aside p:last-child, .language p:last-child { 308 | margin-bottom: 0; } 309 | 310 | .language { 311 | border-left: 5px solid #cde9f4; } 312 | .language .aside-title { 313 | color: #4b8afb; } 314 | 315 | .aside-warning, .aside-deprecated, .aside-unavailable { 316 | border-left: 5px solid #ff6666; } 317 | .aside-warning .aside-title, .aside-deprecated .aside-title, .aside-unavailable .aside-title { 318 | color: #ff0000; } 319 | 320 | .graybox { 321 | border-collapse: collapse; 322 | width: 100%; } 323 | .graybox p { 324 | margin: 0; 325 | word-break: break-word; 326 | min-width: 50px; } 327 | .graybox td { 328 | border: 1px solid #e2e2e2; 329 | padding: 5px 25px 5px 10px; 330 | vertical-align: middle; } 331 | .graybox tr td:first-of-type { 332 | text-align: right; 333 | padding: 7px; 334 | vertical-align: top; 335 | word-break: normal; 336 | width: 40px; } 337 | 338 | .slightly-smaller { 339 | font-size: 0.9em; } 340 | 341 | #footer { 342 | position: relative; 343 | top: 10px; 344 | bottom: 0px; 345 | margin-left: 25px; } 346 | #footer p { 347 | margin: 0; 348 | color: #aaa; 349 | font-size: 0.8em; } 350 | 351 | html.dash header, html.dash #breadcrumbs, html.dash .sidebar { 352 | display: none; } 353 | 354 | html.dash .main-content { 355 | width: 980px; 356 | margin-left: 0; 357 | border: none; 358 | width: 100%; 359 | top: 0; 360 | padding-bottom: 0; } 361 | 362 | html.dash .height-container { 363 | display: block; } 364 | 365 | html.dash .item .token { 366 | margin-left: 0; } 367 | 368 | html.dash .content-wrapper { 369 | width: auto; } 370 | 371 | html.dash #footer { 372 | position: static; } 373 | -------------------------------------------------------------------------------- /docs/docsets/RandomUserSwift.docset/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleIdentifier 6 | com.jazzy.randomuserswift 7 | CFBundleName 8 | RandomUserSwift 9 | DocSetPlatformFamily 10 | randomuserswift 11 | isDashDocset 12 | 13 | dashIndexFilePath 14 | index.html 15 | isJavaScriptEnabled 16 | 17 | DashDocSetFamily 18 | dashtoc 19 | 20 | 21 | -------------------------------------------------------------------------------- /docs/docsets/RandomUserSwift.docset/Contents/Resources/Documents/Classes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Classes Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

RandomUserSwift Docs (100% documented)

18 |

View on GitHub

19 |
20 |
21 |
22 | 27 |
28 |
29 | 49 |
50 |
51 |
52 |

Classes

53 |

The following classes are available globally.

54 | 55 |
56 |
57 |
58 |
    59 |
  • 60 |
    61 | 62 | 63 | 64 | RandomUser 65 | 66 |
    67 |
    68 |
    69 |
    70 |
    71 |
    72 |

    Class that interacts with the RandomUser API to generate random users

    73 | 74 | See more 75 |
    76 |
    77 |

    Declaration

    78 |
    79 |

    Swift

    80 |
    public class RandomUser
    81 | 82 |
    83 |
    84 |
    85 |
    86 |
  • 87 |
88 |
89 |
90 |
91 | 95 |
96 |
97 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /docs/docsets/RandomUserSwift.docset/Contents/Resources/Documents/Classes/RandomUser.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | RandomUser Class Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

RandomUserSwift Docs (100% documented)

18 |

View on GitHub

19 |
20 |
21 |
22 | 27 |
28 |
29 | 49 |
50 |
51 |
52 |

RandomUser

53 |
54 |
55 |
public class RandomUser
56 | 57 |
58 |
59 |

Class that interacts with the RandomUser API to generate random users

60 | 61 |
62 |
63 |
64 |
    65 |
  • 66 |
    67 | 68 | 69 | 70 | shared 71 | 72 |
    73 |
    74 |
    75 |
    76 |
    77 |
    78 |

    Singleton

    79 | 80 |
    81 |
    82 |

    Declaration

    83 |
    84 |

    Swift

    85 |
    public static let shared: RandomUser
    86 | 87 |
    88 |
    89 |
    90 |
    91 |
  • 92 |
  • 93 |
    94 | 95 | 96 | 97 | getUsers(results:gender:nationality:_:) 98 | 99 |
    100 |
    101 |
    102 |
    103 |
    104 |
    105 |

    Get one or more users from RandomUser API (https://www.randomuser.me/documentation)

    106 | 107 |
    108 |
    109 |

    Declaration

    110 |
    111 |

    Swift

    112 |
    public func getUsers(results: Int = 1,
    113 |                      gender: String = "both",
    114 |                      nationality: String = "",
    115 |                      _ completionHandler: @escaping (_ data: Users?, _ error: Error?) -> Void)
    116 | 117 |
    118 |
    119 |
    120 |

    Parameters

    121 | 122 | 123 | 124 | 129 | 134 | 135 | 136 | 141 | 148 | 149 | 150 | 155 | 163 | 164 | 165 |
    125 | 126 | results 127 | 128 | 130 |
    131 |

    (optional) number of generated users to fetch in one request. Max is 5000. Default is 1.

    132 |
    133 |
    137 | 138 | gender 139 | 140 | 142 |
    143 |

    (optional) specify whether you would like to have only male/female users generated. 144 | Valid values for the gender parameter are “male” or “female”, or you may leave the parameter blank. 145 | Any other value will cause the service to return both male and female users. Default is both.

    146 |
    147 |
    151 | 152 | nationality 153 | 154 | 156 |
    157 |

    (optional) specify nationality of generator users via comma separated values. 158 | Pictures won’t be affected by this, but data such as location, cell/home phone, id, etc. will be more appropriate. 159 | Available nationalities for api v1.2 include: AU, BR, CA, CH, DE, DK, ES, FI, FR, GB, IE, IR, NO, NL, NZ, TR, US 160 | Default is random.

    161 |
    162 |
    166 |
    167 |
    168 |
    169 |
  • 170 |
171 |
172 |
173 |
174 | 178 |
179 |
180 | 181 | 182 | 183 | -------------------------------------------------------------------------------- /docs/docsets/RandomUserSwift.docset/Contents/Resources/Documents/Structs.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Structures Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

RandomUserSwift Docs (100% documented)

18 |

View on GitHub

19 |
20 |
21 |
22 | 27 |
28 |
29 | 49 |
50 |
51 |
52 |

Structures

53 |

The following structures are available globally.

54 | 55 |
56 |
57 |
58 |
    59 |
  • 60 |
    61 | 62 | 63 | 64 | Users 65 | 66 |
    67 |
    68 |
    69 |
    70 |
    71 |
    72 |

    Codable Struct conforming to return payload from RandomUser API call

    73 | 74 |
    75 |
    76 |

    Declaration

    77 |
    78 |

    Swift

    79 |
    public struct Users : Codable
    80 | 81 |
    82 |
    83 |
    84 |
    85 |
  • 86 |
87 |
88 |
89 |
90 | 94 |
95 |
96 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /docs/docsets/RandomUserSwift.docset/Contents/Resources/Documents/css/highlight.css: -------------------------------------------------------------------------------- 1 | /* Credit to https://gist.github.com/wataru420/2048287 */ 2 | .highlight { 3 | /* Comment */ 4 | /* Error */ 5 | /* Keyword */ 6 | /* Operator */ 7 | /* Comment.Multiline */ 8 | /* Comment.Preproc */ 9 | /* Comment.Single */ 10 | /* Comment.Special */ 11 | /* Generic.Deleted */ 12 | /* Generic.Deleted.Specific */ 13 | /* Generic.Emph */ 14 | /* Generic.Error */ 15 | /* Generic.Heading */ 16 | /* Generic.Inserted */ 17 | /* Generic.Inserted.Specific */ 18 | /* Generic.Output */ 19 | /* Generic.Prompt */ 20 | /* Generic.Strong */ 21 | /* Generic.Subheading */ 22 | /* Generic.Traceback */ 23 | /* Keyword.Constant */ 24 | /* Keyword.Declaration */ 25 | /* Keyword.Pseudo */ 26 | /* Keyword.Reserved */ 27 | /* Keyword.Type */ 28 | /* Literal.Number */ 29 | /* Literal.String */ 30 | /* Name.Attribute */ 31 | /* Name.Builtin */ 32 | /* Name.Class */ 33 | /* Name.Constant */ 34 | /* Name.Entity */ 35 | /* Name.Exception */ 36 | /* Name.Function */ 37 | /* Name.Namespace */ 38 | /* Name.Tag */ 39 | /* Name.Variable */ 40 | /* Operator.Word */ 41 | /* Text.Whitespace */ 42 | /* Literal.Number.Float */ 43 | /* Literal.Number.Hex */ 44 | /* Literal.Number.Integer */ 45 | /* Literal.Number.Oct */ 46 | /* Literal.String.Backtick */ 47 | /* Literal.String.Char */ 48 | /* Literal.String.Doc */ 49 | /* Literal.String.Double */ 50 | /* Literal.String.Escape */ 51 | /* Literal.String.Heredoc */ 52 | /* Literal.String.Interpol */ 53 | /* Literal.String.Other */ 54 | /* Literal.String.Regex */ 55 | /* Literal.String.Single */ 56 | /* Literal.String.Symbol */ 57 | /* Name.Builtin.Pseudo */ 58 | /* Name.Variable.Class */ 59 | /* Name.Variable.Global */ 60 | /* Name.Variable.Instance */ 61 | /* Literal.Number.Integer.Long */ } 62 | .highlight .c { 63 | color: #999988; 64 | font-style: italic; } 65 | .highlight .err { 66 | color: #a61717; 67 | background-color: #e3d2d2; } 68 | .highlight .k { 69 | color: #000000; 70 | font-weight: bold; } 71 | .highlight .o { 72 | color: #000000; 73 | font-weight: bold; } 74 | .highlight .cm { 75 | color: #999988; 76 | font-style: italic; } 77 | .highlight .cp { 78 | color: #999999; 79 | font-weight: bold; } 80 | .highlight .c1 { 81 | color: #999988; 82 | font-style: italic; } 83 | .highlight .cs { 84 | color: #999999; 85 | font-weight: bold; 86 | font-style: italic; } 87 | .highlight .gd { 88 | color: #000000; 89 | background-color: #ffdddd; } 90 | .highlight .gd .x { 91 | color: #000000; 92 | background-color: #ffaaaa; } 93 | .highlight .ge { 94 | color: #000000; 95 | font-style: italic; } 96 | .highlight .gr { 97 | color: #aa0000; } 98 | .highlight .gh { 99 | color: #999999; } 100 | .highlight .gi { 101 | color: #000000; 102 | background-color: #ddffdd; } 103 | .highlight .gi .x { 104 | color: #000000; 105 | background-color: #aaffaa; } 106 | .highlight .go { 107 | color: #888888; } 108 | .highlight .gp { 109 | color: #555555; } 110 | .highlight .gs { 111 | font-weight: bold; } 112 | .highlight .gu { 113 | color: #aaaaaa; } 114 | .highlight .gt { 115 | color: #aa0000; } 116 | .highlight .kc { 117 | color: #000000; 118 | font-weight: bold; } 119 | .highlight .kd { 120 | color: #000000; 121 | font-weight: bold; } 122 | .highlight .kp { 123 | color: #000000; 124 | font-weight: bold; } 125 | .highlight .kr { 126 | color: #000000; 127 | font-weight: bold; } 128 | .highlight .kt { 129 | color: #445588; } 130 | .highlight .m { 131 | color: #009999; } 132 | .highlight .s { 133 | color: #d14; } 134 | .highlight .na { 135 | color: #008080; } 136 | .highlight .nb { 137 | color: #0086B3; } 138 | .highlight .nc { 139 | color: #445588; 140 | font-weight: bold; } 141 | .highlight .no { 142 | color: #008080; } 143 | .highlight .ni { 144 | color: #800080; } 145 | .highlight .ne { 146 | color: #990000; 147 | font-weight: bold; } 148 | .highlight .nf { 149 | color: #990000; } 150 | .highlight .nn { 151 | color: #555555; } 152 | .highlight .nt { 153 | color: #000080; } 154 | .highlight .nv { 155 | color: #008080; } 156 | .highlight .ow { 157 | color: #000000; 158 | font-weight: bold; } 159 | .highlight .w { 160 | color: #bbbbbb; } 161 | .highlight .mf { 162 | color: #009999; } 163 | .highlight .mh { 164 | color: #009999; } 165 | .highlight .mi { 166 | color: #009999; } 167 | .highlight .mo { 168 | color: #009999; } 169 | .highlight .sb { 170 | color: #d14; } 171 | .highlight .sc { 172 | color: #d14; } 173 | .highlight .sd { 174 | color: #d14; } 175 | .highlight .s2 { 176 | color: #d14; } 177 | .highlight .se { 178 | color: #d14; } 179 | .highlight .sh { 180 | color: #d14; } 181 | .highlight .si { 182 | color: #d14; } 183 | .highlight .sx { 184 | color: #d14; } 185 | .highlight .sr { 186 | color: #009926; } 187 | .highlight .s1 { 188 | color: #d14; } 189 | .highlight .ss { 190 | color: #990073; } 191 | .highlight .bp { 192 | color: #999999; } 193 | .highlight .vc { 194 | color: #008080; } 195 | .highlight .vg { 196 | color: #008080; } 197 | .highlight .vi { 198 | color: #008080; } 199 | .highlight .il { 200 | color: #009999; } 201 | -------------------------------------------------------------------------------- /docs/docsets/RandomUserSwift.docset/Contents/Resources/Documents/css/jazzy.css: -------------------------------------------------------------------------------- 1 | html, body, div, span, h1, h3, h4, p, a, code, em, img, ul, li, table, tbody, tr, td { 2 | background: transparent; 3 | border: 0; 4 | margin: 0; 5 | outline: 0; 6 | padding: 0; 7 | vertical-align: baseline; } 8 | 9 | body { 10 | background-color: #f2f2f2; 11 | font-family: Helvetica, freesans, Arial, sans-serif; 12 | font-size: 14px; 13 | -webkit-font-smoothing: subpixel-antialiased; 14 | word-wrap: break-word; } 15 | 16 | h1, h2, h3 { 17 | margin-top: 0.8em; 18 | margin-bottom: 0.3em; 19 | font-weight: 100; 20 | color: black; } 21 | 22 | h1 { 23 | font-size: 2.5em; } 24 | 25 | h2 { 26 | font-size: 2em; 27 | border-bottom: 1px solid #e2e2e2; } 28 | 29 | h4 { 30 | font-size: 13px; 31 | line-height: 1.5; 32 | margin-top: 21px; } 33 | 34 | h5 { 35 | font-size: 1.1em; } 36 | 37 | h6 { 38 | font-size: 1.1em; 39 | color: #777; } 40 | 41 | .section-name { 42 | color: gray; 43 | display: block; 44 | font-family: Helvetica; 45 | font-size: 22px; 46 | font-weight: 100; 47 | margin-bottom: 15px; } 48 | 49 | pre, code { 50 | font: 0.95em Menlo, monospace; 51 | color: #777; 52 | word-wrap: normal; } 53 | 54 | p code, li code { 55 | background-color: #eee; 56 | padding: 2px 4px; 57 | border-radius: 4px; } 58 | 59 | a { 60 | color: #0088cc; 61 | text-decoration: none; } 62 | 63 | ul { 64 | padding-left: 15px; } 65 | 66 | li { 67 | line-height: 1.8em; } 68 | 69 | img { 70 | max-width: 100%; } 71 | 72 | blockquote { 73 | margin-left: 0; 74 | padding: 0 10px; 75 | border-left: 4px solid #ccc; } 76 | 77 | .content-wrapper { 78 | margin: 0 auto; 79 | width: 980px; } 80 | 81 | header { 82 | font-size: 0.85em; 83 | line-height: 26px; 84 | background-color: #414141; 85 | position: fixed; 86 | width: 100%; 87 | z-index: 2; } 88 | header img { 89 | padding-right: 6px; 90 | vertical-align: -4px; 91 | height: 16px; } 92 | header a { 93 | color: #fff; } 94 | header p { 95 | float: left; 96 | color: #999; } 97 | header .header-right { 98 | float: right; 99 | margin-left: 16px; } 100 | 101 | #breadcrumbs { 102 | background-color: #f2f2f2; 103 | height: 27px; 104 | padding-top: 17px; 105 | position: fixed; 106 | width: 100%; 107 | z-index: 2; 108 | margin-top: 26px; } 109 | #breadcrumbs #carat { 110 | height: 10px; 111 | margin: 0 5px; } 112 | 113 | .sidebar { 114 | background-color: #f9f9f9; 115 | border: 1px solid #e2e2e2; 116 | overflow-y: auto; 117 | overflow-x: hidden; 118 | position: fixed; 119 | top: 70px; 120 | bottom: 0; 121 | width: 230px; 122 | word-wrap: normal; } 123 | 124 | .nav-groups { 125 | list-style-type: none; 126 | background: #fff; 127 | padding-left: 0; } 128 | 129 | .nav-group-name { 130 | border-bottom: 1px solid #e2e2e2; 131 | font-size: 1.1em; 132 | font-weight: 100; 133 | padding: 15px 0 15px 20px; } 134 | .nav-group-name > a { 135 | color: #333; } 136 | 137 | .nav-group-tasks { 138 | margin-top: 5px; } 139 | 140 | .nav-group-task { 141 | font-size: 0.9em; 142 | list-style-type: none; 143 | white-space: nowrap; } 144 | .nav-group-task a { 145 | color: #888; } 146 | 147 | .main-content { 148 | background-color: #fff; 149 | border: 1px solid #e2e2e2; 150 | margin-left: 246px; 151 | position: absolute; 152 | overflow: hidden; 153 | padding-bottom: 20px; 154 | top: 70px; 155 | width: 734px; } 156 | .main-content p, .main-content a, .main-content code, .main-content em, .main-content ul, .main-content table, .main-content blockquote { 157 | margin-bottom: 1em; } 158 | .main-content p { 159 | line-height: 1.8em; } 160 | .main-content section .section:first-child { 161 | margin-top: 0; 162 | padding-top: 0; } 163 | .main-content section .task-group-section .task-group:first-of-type { 164 | padding-top: 10px; } 165 | .main-content section .task-group-section .task-group:first-of-type .section-name { 166 | padding-top: 15px; } 167 | .main-content section .heading:before { 168 | content: ""; 169 | display: block; 170 | padding-top: 70px; 171 | margin: -70px 0 0; } 172 | .main-content .section-name p { 173 | margin-bottom: inherit; 174 | line-height: inherit; } 175 | .main-content .section-name code { 176 | background-color: inherit; 177 | padding: inherit; 178 | color: inherit; } 179 | 180 | .section { 181 | padding: 0 25px; } 182 | 183 | .highlight { 184 | background-color: #eee; 185 | padding: 10px 12px; 186 | border: 1px solid #e2e2e2; 187 | border-radius: 4px; 188 | overflow-x: auto; } 189 | 190 | .declaration .highlight { 191 | overflow-x: initial; 192 | padding: 0 40px 40px 0; 193 | margin-bottom: -25px; 194 | background-color: transparent; 195 | border: none; } 196 | 197 | .section-name { 198 | margin: 0; 199 | margin-left: 18px; } 200 | 201 | .task-group-section { 202 | padding-left: 6px; 203 | border-top: 1px solid #e2e2e2; } 204 | 205 | .task-group { 206 | padding-top: 0px; } 207 | 208 | .task-name-container a[name]:before { 209 | content: ""; 210 | display: block; 211 | padding-top: 70px; 212 | margin: -70px 0 0; } 213 | 214 | .section-name-container { 215 | position: relative; 216 | display: inline-block; } 217 | .section-name-container .section-name-link { 218 | position: absolute; 219 | top: 0; 220 | left: 0; 221 | bottom: 0; 222 | right: 0; 223 | margin-bottom: 0; } 224 | .section-name-container .section-name { 225 | position: relative; 226 | pointer-events: none; 227 | z-index: 1; } 228 | .section-name-container .section-name a { 229 | pointer-events: auto; } 230 | 231 | .item { 232 | padding-top: 8px; 233 | width: 100%; 234 | list-style-type: none; } 235 | .item a[name]:before { 236 | content: ""; 237 | display: block; 238 | padding-top: 70px; 239 | margin: -70px 0 0; } 240 | .item code { 241 | background-color: transparent; 242 | padding: 0; } 243 | .item .token, .item .direct-link { 244 | padding-left: 3px; 245 | margin-left: 15px; 246 | font-size: 11.9px; 247 | transition: all 300ms; } 248 | .item .token-open { 249 | margin-left: 0px; } 250 | .item .discouraged { 251 | text-decoration: line-through; } 252 | .item .declaration-note { 253 | font-size: .85em; 254 | color: gray; 255 | font-style: italic; } 256 | 257 | .pointer-container { 258 | border-bottom: 1px solid #e2e2e2; 259 | left: -23px; 260 | padding-bottom: 13px; 261 | position: relative; 262 | width: 110%; } 263 | 264 | .pointer { 265 | background: #f9f9f9; 266 | border-left: 1px solid #e2e2e2; 267 | border-top: 1px solid #e2e2e2; 268 | height: 12px; 269 | left: 21px; 270 | top: -7px; 271 | -webkit-transform: rotate(45deg); 272 | -moz-transform: rotate(45deg); 273 | -o-transform: rotate(45deg); 274 | transform: rotate(45deg); 275 | position: absolute; 276 | width: 12px; } 277 | 278 | .height-container { 279 | display: none; 280 | left: -25px; 281 | padding: 0 25px; 282 | position: relative; 283 | width: 100%; 284 | overflow: hidden; } 285 | .height-container .section { 286 | background: #f9f9f9; 287 | border-bottom: 1px solid #e2e2e2; 288 | left: -25px; 289 | position: relative; 290 | width: 100%; 291 | padding-top: 10px; 292 | padding-bottom: 5px; } 293 | 294 | .aside, .language { 295 | padding: 6px 12px; 296 | margin: 12px 0; 297 | border-left: 5px solid #dddddd; 298 | overflow-y: hidden; } 299 | .aside .aside-title, .language .aside-title { 300 | font-size: 9px; 301 | letter-spacing: 2px; 302 | text-transform: uppercase; 303 | padding-bottom: 0; 304 | margin: 0; 305 | color: #aaa; 306 | -webkit-user-select: none; } 307 | .aside p:last-child, .language p:last-child { 308 | margin-bottom: 0; } 309 | 310 | .language { 311 | border-left: 5px solid #cde9f4; } 312 | .language .aside-title { 313 | color: #4b8afb; } 314 | 315 | .aside-warning, .aside-deprecated, .aside-unavailable { 316 | border-left: 5px solid #ff6666; } 317 | .aside-warning .aside-title, .aside-deprecated .aside-title, .aside-unavailable .aside-title { 318 | color: #ff0000; } 319 | 320 | .graybox { 321 | border-collapse: collapse; 322 | width: 100%; } 323 | .graybox p { 324 | margin: 0; 325 | word-break: break-word; 326 | min-width: 50px; } 327 | .graybox td { 328 | border: 1px solid #e2e2e2; 329 | padding: 5px 25px 5px 10px; 330 | vertical-align: middle; } 331 | .graybox tr td:first-of-type { 332 | text-align: right; 333 | padding: 7px; 334 | vertical-align: top; 335 | word-break: normal; 336 | width: 40px; } 337 | 338 | .slightly-smaller { 339 | font-size: 0.9em; } 340 | 341 | #footer { 342 | position: relative; 343 | top: 10px; 344 | bottom: 0px; 345 | margin-left: 25px; } 346 | #footer p { 347 | margin: 0; 348 | color: #aaa; 349 | font-size: 0.8em; } 350 | 351 | html.dash header, html.dash #breadcrumbs, html.dash .sidebar { 352 | display: none; } 353 | 354 | html.dash .main-content { 355 | width: 980px; 356 | margin-left: 0; 357 | border: none; 358 | width: 100%; 359 | top: 0; 360 | padding-bottom: 0; } 361 | 362 | html.dash .height-container { 363 | display: block; } 364 | 365 | html.dash .item .token { 366 | margin-left: 0; } 367 | 368 | html.dash .content-wrapper { 369 | width: auto; } 370 | 371 | html.dash #footer { 372 | position: static; } 373 | -------------------------------------------------------------------------------- /docs/docsets/RandomUserSwift.docset/Contents/Resources/Documents/img/carat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dingwilson/RandomUserSwift/a7899c7799e6bf1a669c274b8d8af71c47ac5a5d/docs/docsets/RandomUserSwift.docset/Contents/Resources/Documents/img/carat.png -------------------------------------------------------------------------------- /docs/docsets/RandomUserSwift.docset/Contents/Resources/Documents/img/dash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dingwilson/RandomUserSwift/a7899c7799e6bf1a669c274b8d8af71c47ac5a5d/docs/docsets/RandomUserSwift.docset/Contents/Resources/Documents/img/dash.png -------------------------------------------------------------------------------- /docs/docsets/RandomUserSwift.docset/Contents/Resources/Documents/img/gh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dingwilson/RandomUserSwift/a7899c7799e6bf1a669c274b8d8af71c47ac5a5d/docs/docsets/RandomUserSwift.docset/Contents/Resources/Documents/img/gh.png -------------------------------------------------------------------------------- /docs/docsets/RandomUserSwift.docset/Contents/Resources/Documents/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | RandomUserSwift Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

RandomUserSwift Docs (100% documented)

17 |

View on GitHub

18 |
19 |
20 |
21 | 26 |
27 |
28 | 48 |
49 |
50 |
51 | 52 |

53 | 54 |

55 | 56 |

Build Status 57 | codecov 58 | doccov 59 | CocoaPods Version Status 60 | Carthage compatible 61 | Platform 62 | Swift 63 | MIT License

64 | 65 |

66 | 67 |

68 | 69 |

RandomUserSwift is an easy to use Swift framework that provides the ability to generate random users and their accompanying data for your Swift applications. It utilizes randomuser.me API to generate the data.

70 | 71 |
    72 |
  1. Integration 73 | 74 |
  2. 78 |
  3. Usage
  4. 79 |
  5. License
  6. 80 |
81 |

Integration

82 |

CocoaPods

83 | 84 |

You can use CocoaPods to install RandomUserSwift by adding it to your Podfile:

85 |
target 'MyApp' do
 86 |     pod 'RandomUserSwift'
 87 | end
 88 | 
89 |

Carthage

90 | 91 |

You can use Carthage to install RandomUserSwift by adding it to your Cartfile:

92 |
github "dingwilson/RandomUserSwift"
 93 | 
94 |

Usage

95 | 96 |

Import the framework

97 |
import RandomUserSwift
 98 | 
99 | 100 |

Then, use the getUsers function via the shared singleton with a completion handler.

101 |
RandomUser.shared.getUsers { data, error in
102 |     guard let data = data else { return }
103 | 
104 |     print(data)
105 | }
106 | 
107 | 108 |

For more information on the configuration and returned values, check out the RandomUserSwift documentation or RandomUser official documentation

109 |

License

110 | 111 |

RandomUserSwift is released under an MIT License. See LICENSE for details.

112 | 113 |

Copyright © 2016-present Wilson Ding.

114 | 115 |

Please provide attribution, it is greatly appreciated.

116 | 117 |
118 |
119 | 123 |
124 |
125 | 126 | 127 | 128 | -------------------------------------------------------------------------------- /docs/docsets/RandomUserSwift.docset/Contents/Resources/Documents/js/jazzy.js: -------------------------------------------------------------------------------- 1 | window.jazzy = {'docset': false} 2 | if (typeof window.dash != 'undefined') { 3 | document.documentElement.className += ' dash' 4 | window.jazzy.docset = true 5 | } 6 | if (navigator.userAgent.match(/xcode/i)) { 7 | document.documentElement.className += ' xcode' 8 | window.jazzy.docset = true 9 | } 10 | 11 | function toggleItem($link, $content) { 12 | var animationDuration = 300; 13 | $link.toggleClass('token-open'); 14 | $content.slideToggle(animationDuration); 15 | } 16 | 17 | function itemLinkToContent($link) { 18 | return $link.parent().parent().next(); 19 | } 20 | 21 | // On doc load + hash-change, open any targetted item 22 | function openCurrentItemIfClosed() { 23 | if (window.jazzy.docset) { 24 | return; 25 | } 26 | var $link = $(`.token[href="${location.hash}"]`); 27 | $content = itemLinkToContent($link); 28 | if ($content.is(':hidden')) { 29 | toggleItem($link, $content); 30 | } 31 | } 32 | 33 | $(openCurrentItemIfClosed); 34 | $(window).on('hashchange', openCurrentItemIfClosed); 35 | 36 | // On item link ('token') click, toggle its discussion 37 | $('.token').on('click', function(event) { 38 | if (window.jazzy.docset) { 39 | return; 40 | } 41 | var $link = $(this); 42 | toggleItem($link, itemLinkToContent($link)); 43 | 44 | // Keeps the document from jumping to the hash. 45 | var href = $link.attr('href'); 46 | if (history.pushState) { 47 | history.pushState({}, '', href); 48 | } else { 49 | location.hash = href; 50 | } 51 | event.preventDefault(); 52 | }); 53 | 54 | // Clicks on links to the current, closed, item need to open the item 55 | $("a:not('.token')").on('click', function() { 56 | if (location == this.href) { 57 | openCurrentItemIfClosed(); 58 | } 59 | }); 60 | -------------------------------------------------------------------------------- /docs/docsets/RandomUserSwift.docset/Contents/Resources/Documents/search.json: -------------------------------------------------------------------------------- 1 | {"Structs.html#/s:15RandomUserSwift5UsersV":{"name":"Users","abstract":"

Codable Struct conforming to return payload from RandomUser API call

"},"Classes/RandomUser.html#/s:15RandomUserSwift0aB0C6sharedACvpZ":{"name":"shared","abstract":"

Singleton

","parent_name":"RandomUser"},"Classes/RandomUser.html#/s:15RandomUserSwift0aB0C8getUsers7results6gender11nationality_ySi_S2SyAA0E0VSg_s5Error_pSgtctF":{"name":"getUsers(results:gender:nationality:_:)","abstract":"

Get one or more users from RandomUser API (https://www.randomuser.me/documentation)

","parent_name":"RandomUser"},"Classes/RandomUser.html":{"name":"RandomUser","abstract":"

Class that interacts with the RandomUser API to generate random users

"},"Classes.html":{"name":"Classes","abstract":"

The following classes are available globally.

"},"Structs.html":{"name":"Structures","abstract":"

The following structures are available globally.

"}} -------------------------------------------------------------------------------- /docs/docsets/RandomUserSwift.docset/Contents/Resources/docSet.dsidx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dingwilson/RandomUserSwift/a7899c7799e6bf1a669c274b8d8af71c47ac5a5d/docs/docsets/RandomUserSwift.docset/Contents/Resources/docSet.dsidx -------------------------------------------------------------------------------- /docs/docsets/RandomUserSwift.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dingwilson/RandomUserSwift/a7899c7799e6bf1a669c274b8d8af71c47ac5a5d/docs/docsets/RandomUserSwift.tgz -------------------------------------------------------------------------------- /docs/img/carat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dingwilson/RandomUserSwift/a7899c7799e6bf1a669c274b8d8af71c47ac5a5d/docs/img/carat.png -------------------------------------------------------------------------------- /docs/img/dash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dingwilson/RandomUserSwift/a7899c7799e6bf1a669c274b8d8af71c47ac5a5d/docs/img/dash.png -------------------------------------------------------------------------------- /docs/img/gh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dingwilson/RandomUserSwift/a7899c7799e6bf1a669c274b8d8af71c47ac5a5d/docs/img/gh.png -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | RandomUserSwift Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

RandomUserSwift Docs (100% documented)

17 |

View on GitHub

18 |
19 |
20 |
21 | 26 |
27 |
28 | 48 |
49 |
50 |
51 | 52 |

53 | 54 |

55 | 56 |

Build Status 57 | codecov 58 | doccov 59 | CocoaPods Version Status 60 | Carthage compatible 61 | Platform 62 | Swift 63 | MIT License

64 | 65 |

66 | 67 |

68 | 69 |

RandomUserSwift is an easy to use Swift framework that provides the ability to generate random users and their accompanying data for your Swift applications. It utilizes randomuser.me API to generate the data.

70 | 71 |
    72 |
  1. Integration 73 | 74 |
  2. 78 |
  3. Usage
  4. 79 |
  5. License
  6. 80 |
81 |

Integration

82 |

CocoaPods

83 | 84 |

You can use CocoaPods to install RandomUserSwift by adding it to your Podfile:

85 |
target 'MyApp' do
 86 |     pod 'RandomUserSwift'
 87 | end
 88 | 
89 |

Carthage

90 | 91 |

You can use Carthage to install RandomUserSwift by adding it to your Cartfile:

92 |
github "dingwilson/RandomUserSwift"
 93 | 
94 |

Usage

95 | 96 |

Import the framework

97 |
import RandomUserSwift
 98 | 
99 | 100 |

Then, use the getUsers function via the shared singleton with a completion handler.

101 |
RandomUser.shared.getUsers { data, error in
102 |     guard let data = data else { return }
103 | 
104 |     print(data)
105 | }
106 | 
107 | 108 |

For more information on the configuration and returned values, check out the RandomUserSwift documentation or RandomUser official documentation

109 |

License

110 | 111 |

RandomUserSwift is released under an MIT License. See LICENSE for details.

112 | 113 |

Copyright © 2016-present Wilson Ding.

114 | 115 |

Please provide attribution, it is greatly appreciated.

116 | 117 |
118 |
119 | 123 |
124 |
125 | 126 | 127 | 128 | -------------------------------------------------------------------------------- /docs/js/jazzy.js: -------------------------------------------------------------------------------- 1 | window.jazzy = {'docset': false} 2 | if (typeof window.dash != 'undefined') { 3 | document.documentElement.className += ' dash' 4 | window.jazzy.docset = true 5 | } 6 | if (navigator.userAgent.match(/xcode/i)) { 7 | document.documentElement.className += ' xcode' 8 | window.jazzy.docset = true 9 | } 10 | 11 | function toggleItem($link, $content) { 12 | var animationDuration = 300; 13 | $link.toggleClass('token-open'); 14 | $content.slideToggle(animationDuration); 15 | } 16 | 17 | function itemLinkToContent($link) { 18 | return $link.parent().parent().next(); 19 | } 20 | 21 | // On doc load + hash-change, open any targetted item 22 | function openCurrentItemIfClosed() { 23 | if (window.jazzy.docset) { 24 | return; 25 | } 26 | var $link = $(`.token[href="${location.hash}"]`); 27 | $content = itemLinkToContent($link); 28 | if ($content.is(':hidden')) { 29 | toggleItem($link, $content); 30 | } 31 | } 32 | 33 | $(openCurrentItemIfClosed); 34 | $(window).on('hashchange', openCurrentItemIfClosed); 35 | 36 | // On item link ('token') click, toggle its discussion 37 | $('.token').on('click', function(event) { 38 | if (window.jazzy.docset) { 39 | return; 40 | } 41 | var $link = $(this); 42 | toggleItem($link, itemLinkToContent($link)); 43 | 44 | // Keeps the document from jumping to the hash. 45 | var href = $link.attr('href'); 46 | if (history.pushState) { 47 | history.pushState({}, '', href); 48 | } else { 49 | location.hash = href; 50 | } 51 | event.preventDefault(); 52 | }); 53 | 54 | // Clicks on links to the current, closed, item need to open the item 55 | $("a:not('.token')").on('click', function() { 56 | if (location == this.href) { 57 | openCurrentItemIfClosed(); 58 | } 59 | }); 60 | -------------------------------------------------------------------------------- /docs/js/jquery.min.js: -------------------------------------------------------------------------------- 1 | /*! jQuery v3.4.1 | (c) JS Foundation and other contributors | jquery.org/license */ 2 | !function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],E=C.document,r=Object.getPrototypeOf,s=t.slice,g=t.concat,u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.4.1",k=function(e,t){return new k.fn.init(e,t)},p=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function d(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp($),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+$),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ne=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(m.childNodes),m.childNodes),t[m.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&((e?e.ownerDocument||e:m)!==C&&T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!A[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&U.test(t)){(s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=k),o=(l=h(t)).length;while(o--)l[o]="#"+s+" "+xe(l[o]);c=l.join(","),f=ee.test(t)&&ye(e.parentNode)||e}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){A(t,!0)}finally{s===k&&e.removeAttribute("id")}}}return g(t.replace(B,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[k]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:m;return r!==C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),m!==C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=k,!C.getElementsByName||!C.getElementsByName(k).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+k+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+k+"+*").length||v.push(".#.+[+~]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",$)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e===C||e.ownerDocument===m&&y(m,e)?-1:t===C||t.ownerDocument===m&&y(m,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===C?-1:t===C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]===m?-1:s[r]===m?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if((e.ownerDocument||e)!==C&&T(e),d.matchesSelector&&E&&!A[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){A(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=p[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&p(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?k.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?k.grep(e,function(e){return e===n!==r}):"string"!=typeof n?k.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(k.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:L.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof k?t[0]:t,k.merge(this,k.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),D.test(r[1])&&k.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(k):k.makeArray(e,this)}).prototype=k.fn,q=k(E);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}k.fn.extend({has:function(e){var t=k(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?k.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;nx",y.noCloneChecked=!!me.cloneNode(!0).lastChild.defaultValue;var Te=/^key/,Ce=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ee=/^([^.]*)(?:\.(.+)|)/;function ke(){return!0}function Se(){return!1}function Ne(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function Ae(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ae(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Se;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return k().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=k.guid++)),e.each(function(){k.event.add(this,t,i,r,n)})}function De(e,i,o){o?(Q.set(e,i,!1),k.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Q.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(k.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Q.set(this,i,r),t=o(this,i),this[i](),r!==(n=Q.get(this,i))||t?Q.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n.value}else r.length&&(Q.set(this,i,{value:k.event.trigger(k.extend(r[0],k.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Q.get(e,i)&&k.event.add(e,i,ke)}k.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.get(t);if(v){n.handler&&(n=(o=n).handler,i=o.selector),i&&k.find.matchesSelector(ie,i),n.guid||(n.guid=k.guid++),(u=v.events)||(u=v.events={}),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof k&&k.event.triggered!==e.type?k.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(R)||[""]).length;while(l--)d=g=(s=Ee.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=k.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=k.event.special[d]||{},c=k.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&k.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),k.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.hasData(e)&&Q.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(R)||[""]).length;while(l--)if(d=g=(s=Ee.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=k.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||k.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)k.event.remove(e,d+t[l],n,r,!0);k.isEmptyObject(u)&&Q.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=k.event.fix(e),u=new Array(arguments.length),l=(Q.get(this,"events")||{})[s.type]||[],c=k.event.special[s.type]||{};for(u[0]=s,t=1;t\x20\t\r\n\f]*)[^>]*)\/>/gi,qe=/\s*$/g;function Oe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&k(e).children("tbody")[0]||e}function Pe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Re(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Me(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(Q.hasData(e)&&(o=Q.access(e),a=Q.set(t,o),l=o.events))for(i in delete a.handle,a.events={},l)for(n=0,r=l[i].length;n")},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=oe(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||k.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Vt,Gt=[],Yt=/(=)\?(?=&|$)|\?\?/;k.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Gt.pop()||k.expando+"_"+kt++;return this[e]=!0,e}}),k.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Yt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Yt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Yt,"$1"+r):!1!==e.jsonp&&(e.url+=(St.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||k.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?k(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Gt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Vt=E.implementation.createHTMLDocument("").body).innerHTML="
",2===Vt.childNodes.length),k.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=D.exec(e))?[t.createElement(i[1])]:(i=we([e],t,o),o&&o.length&&k(o).remove(),k.merge([],i.childNodes)));var r,i,o},k.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(k.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},k.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){k.fn[t]=function(e){return this.on(t,e)}}),k.expr.pseudos.animated=function(t){return k.grep(k.timers,function(e){return t===e.elem}).length},k.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=k.css(e,"position"),c=k(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=k.css(e,"top"),u=k.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,k.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},k.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){k.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===k.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===k.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=k(e).offset()).top+=k.css(e,"borderTopWidth",!0),i.left+=k.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-k.css(r,"marginTop",!0),left:t.left-i.left-k.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===k.css(e,"position"))e=e.offsetParent;return e||ie})}}),k.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;k.fn[t]=function(e){return _(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),k.each(["top","left"],function(e,n){k.cssHooks[n]=ze(y.pixelPosition,function(e,t){if(t)return t=_e(e,n),$e.test(t)?k(e).position()[n]+"px":t})}),k.each({Height:"height",Width:"width"},function(a,s){k.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){k.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return _(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?k.css(e,t,i):k.style(e,t,n,i)},s,n?e:void 0,n)}})}),k.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){k.fn[n]=function(e,t){return 0Codable Struct conforming to return payload from RandomUser API call

"},"Classes/RandomUser.html#/s:15RandomUserSwift0aB0C6sharedACvpZ":{"name":"shared","abstract":"

Singleton

","parent_name":"RandomUser"},"Classes/RandomUser.html#/s:15RandomUserSwift0aB0C8getUsers7results6gender11nationality_ySi_S2SyAA0E0VSg_s5Error_pSgtctF":{"name":"getUsers(results:gender:nationality:_:)","abstract":"

Get one or more users from RandomUser API (https://www.randomuser.me/documentation)

","parent_name":"RandomUser"},"Classes/RandomUser.html":{"name":"RandomUser","abstract":"

Class that interacts with the RandomUser API to generate random users

"},"Classes.html":{"name":"Classes","abstract":"

The following classes are available globally.

"},"Structs.html":{"name":"Structures","abstract":"

The following structures are available globally.

"}} -------------------------------------------------------------------------------- /docs/undocumented.json: -------------------------------------------------------------------------------- 1 | { 2 | "warnings": [ 3 | 4 | ], 5 | "source_directory": "/Users/travis/build/dingwilson/RandomUserSwift" 6 | } --------------------------------------------------------------------------------