blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 2
625
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
47
| license_type
stringclasses 2
values | repo_name
stringlengths 5
116
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringclasses 643
values | visit_date
timestamp[ns] | revision_date
timestamp[ns] | committer_date
timestamp[ns] | github_id
int64 80.4k
689M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 16
values | gha_event_created_at
timestamp[ns] | gha_created_at
timestamp[ns] | gha_language
stringclasses 85
values | src_encoding
stringclasses 7
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 1
class | length_bytes
int64 4
6.44M
| extension
stringclasses 17
values | content
stringlengths 4
6.44M
| duplicates
listlengths 1
9.02k
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
899ac9d283ea3b218a447a31ea96361d06622ac9
|
341b20e0c1cc1b1ade235be3665eb6a264dad662
|
/News Challenge/News Challenge/AppDelegate.swift
|
04fd45853433349d8a98dbe11c59e61dfaad0273
|
[] |
no_license
|
eherzer/news-challenge-ios
|
280b0369d389fe0c39c2c884787ceeda5c19acd8
|
fd621a5d4e95b332678c4daa5bab2bcd2ff17131
|
refs/heads/master
| 2023-02-11T05:21:38.214624 | 2021-01-13T23:32:16 | 2021-01-13T23:32:16 | 328,821,371 | 0 | 0 | null | 2021-01-13T23:32:18 | 2021-01-11T23:50:40 |
Swift
|
UTF-8
|
Swift
| false | false | 604 |
swift
|
//
// AppDelegate.swift
// News Challenge
//
// Created by Eduardo Herzer on 11/01/21.
//
import UIKit
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
self.window = UIWindow(frame: UIScreen.main.bounds)
let initialViewController = SplashVC()
window!.rootViewController = initialViewController
window!.makeKeyAndVisible()
return true
}
}
|
[
172568,
330809,
351585
] |
3dcd380948f9781d396af55024d2aa594603470b
|
6c92a8eac9b1f42c3f65294a062cc0877c64709f
|
/RestTest/Sources/Screens/PostDetails/Router/PostDetailsRouterInput.swift
|
444782c52d41288510646d6fc306692c07f8e295
|
[] |
no_license
|
dhrebeniuk/RestTest
|
6c56d7225b13856c4d18596151e6df71cd194cc0
|
a70be884a3ba4e55489bb14e000b19263b3c2e31
|
refs/heads/master
| 2020-03-08T20:07:15.388780 | 2018-04-06T19:16:27 | 2018-04-06T19:16:27 | 128,373,832 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 234 |
swift
|
//
// PostDetailsRouterInput.swift
// RestTest
//
// Created by Dmytro Hrebeniuk on 4/6/18.
// Copyright © 2018 Dmytro. All rights reserved.
//
import Foundation
protocol PostDetailsRouterInput {
func show(error: Error?)
}
|
[
-1
] |
20c9a3e8f9baecd56215e37764977a4ad2fa0a39
|
3db34cecba57e2b5ae5775dcd93697e854c9002f
|
/TvShows/Show API/RemoteShowLoader.swift
|
6d08a7c3dd700787c636f23b3081187095aa26c9
|
[] |
no_license
|
shadyk/TvShow
|
e362093e951e9ad036605a285f2ed2dcd937c9bb
|
c9d9b30c9652b8b8e93a5478525683c516634990
|
refs/heads/master
| 2023-01-13T23:34:13.664103 | 2020-09-12T15:46:13 | 2020-09-12T15:46:13 | 293,947,647 | 0 | 1 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,063 |
swift
|
//
// RemoteShowLoader.swift
// TvShows
//
// Created by Shady Kahaleh on 7/31/20.
//
import Foundation
public final class RemoteShowLoader : ShowLoader {
private let url : URL
private let headers : [String:String]?
private let client : HTTPClient
public enum Error : Swift.Error {
case connectivity
case invalidData
case notFound
}
public typealias Result = ShowLoaderResult
public init(url:URL, headers:[String:String]?, client:HTTPClient) {
self.url = url
self.client = client
self.headers = headers
}
public func load(completion:@escaping (Result) -> Void) {
client.get(url: url, headers: headers){ [weak self] result in
guard self != nil else { return}
switch result {
case let .success(data,response):
completion(RemoteShowMapper.map(data: data, response:response))
case .failure:
completion(.failure(RemoteShowLoader.Error.connectivity))
}
}
}
}
|
[
431429
] |
a588ee58ca3b199728ff88c488b8c6c0c0375609
|
c948193b5942e104513aa7e7df5dd9951eb08464
|
/Tests/PackageLoadingTests/PD_4_0_LoadingTests.swift
|
cfe359da90a7524321a7308f954faa534417bcb6
|
[
"Apache-2.0",
"BSD-3-Clause",
"MIT",
"LicenseRef-scancode-unknown-license-reference",
"Swift-exception"
] |
permissive
|
tonyarnold/swift-package-manager
|
57750b313c384d0d83020ffa81bdb749d412df4a
|
57004732380a97ee919635f4772855176761d051
|
refs/heads/master
| 2022-12-10T15:45:14.928176 | 2022-12-08T00:32:28 | 2022-12-08T00:32:28 | 275,718,611 | 0 | 0 |
Apache-2.0
| 2020-06-29T03:13:31 | 2020-06-29T03:13:30 | null |
UTF-8
|
Swift
| false | false | 17,935 |
swift
|
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift open source project
//
// Copyright (c) 2017-2020 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
import Basics
import PackageLoading
import PackageModel
import SPMTestSupport
import TSCBasic
import XCTest
extension AbsolutePath {
fileprivate func escapedPathString() -> String {
return self.pathString.replacingOccurrences(of: "\\", with: "\\\\")
}
}
class PackageDescription4_0LoadingTests: PackageDescriptionLoadingTests {
override var toolsVersion: ToolsVersion {
.v4
}
func testTrivial() throws {
let content = """
import PackageDescription
let package = Package(
name: "Trivial"
)
"""
let observability = ObservabilitySystem.makeForTesting()
let (manifest, validationDiagnostics) = try loadAndValidateManifest(content, observabilityScope: observability.topScope)
XCTAssertNoDiagnostics(observability.diagnostics)
XCTAssertNoDiagnostics(validationDiagnostics)
XCTAssertEqual(manifest.displayName, "Trivial")
XCTAssertEqual(manifest.toolsVersion, .v4)
XCTAssertEqual(manifest.targets, [])
XCTAssertEqual(manifest.dependencies, [])
}
func testTargetDependencies() throws {
let content = """
import PackageDescription
let package = Package(
name: "Trivial",
targets: [
.target(name: "foo", dependencies: [
"dep1",
.target(name: "dep2"),
.product(name: "dep3", package: "Pkg"),
.product(name: "dep4"),
]),
.testTarget(name: "bar", dependencies: [
"foo",
])
]
)
"""
let observability = ObservabilitySystem.makeForTesting()
let (manifest, validationDiagnostics) = try loadAndValidateManifest(content, observabilityScope: observability.topScope)
XCTAssertNoDiagnostics(observability.diagnostics)
XCTAssertNoDiagnostics(validationDiagnostics)
XCTAssertEqual(manifest.displayName, "Trivial")
let foo = manifest.targetMap["foo"]!
XCTAssertEqual(foo.name, "foo")
XCTAssertFalse(foo.isTest)
let expectedDependencies: [TargetDescription.Dependency]
expectedDependencies = [
"dep1",
.target(name: "dep2"),
.product(name: "dep3", package: "Pkg"),
.product(name: "dep4"),
]
XCTAssertEqual(foo.dependencies, expectedDependencies)
let bar = manifest.targetMap["bar"]!
XCTAssertEqual(bar.name, "bar")
XCTAssertTrue(bar.isTest)
XCTAssertEqual(bar.dependencies, ["foo"])
}
func testCompatibleSwiftVersions() throws {
do {
let content = """
import PackageDescription
let package = Package(
name: "Foo",
swiftLanguageVersions: [3, 4]
)
"""
let observability = ObservabilitySystem.makeForTesting()
let (manifest, validationDiagnostics) = try loadAndValidateManifest(content, observabilityScope: observability.topScope)
XCTAssertNoDiagnostics(observability.diagnostics)
XCTAssertNoDiagnostics(validationDiagnostics)
XCTAssertEqual(manifest.swiftLanguageVersions?.map({$0.rawValue}), ["3", "4"])
}
do {
let content = """
import PackageDescription
let package = Package(
name: "Foo",
swiftLanguageVersions: []
)
"""
let observability = ObservabilitySystem.makeForTesting()
let (manifest, validationDiagnostics) = try loadAndValidateManifest(content, observabilityScope: observability.topScope)
XCTAssertNoDiagnostics(observability.diagnostics)
XCTAssertNoDiagnostics(validationDiagnostics)
XCTAssertEqual(manifest.swiftLanguageVersions, [])
}
do {
let content = """
import PackageDescription
let package = Package(
name: "Foo")
"""
let observability = ObservabilitySystem.makeForTesting()
let (manifest, validationDiagnostics) = try loadAndValidateManifest(content, observabilityScope: observability.topScope)
XCTAssertNoDiagnostics(observability.diagnostics)
XCTAssertNoDiagnostics(validationDiagnostics)
XCTAssertEqual(manifest.swiftLanguageVersions, nil)
}
}
func testPackageDependencies() throws {
let content = """
import PackageDescription
let package = Package(
name: "Foo",
dependencies: [
.package(url: "\(AbsolutePath(path: "/foo1").escapedPathString())", from: "1.0.0"),
.package(url: "\(AbsolutePath(path: "/foo2").escapedPathString())", .upToNextMajor(from: "1.0.0")),
.package(url: "\(AbsolutePath(path: "/foo3").escapedPathString())", .upToNextMinor(from: "1.0.0")),
.package(url: "\(AbsolutePath(path: "/foo4").escapedPathString())", .exact("1.0.0")),
.package(url: "\(AbsolutePath(path: "/foo5").escapedPathString())", .branch("main")),
.package(url: "\(AbsolutePath(path: "/foo6").escapedPathString())", .revision("58e9de4e7b79e67c72a46e164158e3542e570ab6")),
]
)
"""
let observability = ObservabilitySystem.makeForTesting()
let (manifest, validationDiagnostics) = try loadAndValidateManifest(content, observabilityScope: observability.topScope)
XCTAssertNoDiagnostics(observability.diagnostics)
XCTAssertNoDiagnostics(validationDiagnostics)
let deps = Dictionary(uniqueKeysWithValues: manifest.dependencies.map{ ($0.identity.description, $0) })
XCTAssertEqual(deps["foo1"], .localSourceControl(path: .init(path: "/foo1"), requirement: .upToNextMajor(from: "1.0.0")))
XCTAssertEqual(deps["foo2"], .localSourceControl(path: .init(path: "/foo2"), requirement: .upToNextMajor(from: "1.0.0")))
XCTAssertEqual(deps["foo3"], .localSourceControl(path: .init(path: "/foo3"), requirement: .upToNextMinor(from: "1.0.0")))
XCTAssertEqual(deps["foo4"], .localSourceControl(path: .init(path: "/foo4"), requirement: .exact("1.0.0")))
XCTAssertEqual(deps["foo5"], .localSourceControl(path: .init(path: "/foo5"), requirement: .branch("main")))
XCTAssertEqual(deps["foo6"], .localSourceControl(path: .init(path: "/foo6"), requirement: .revision("58e9de4e7b79e67c72a46e164158e3542e570ab6")))
}
func testProducts() throws {
let content = """
import PackageDescription
let package = Package(
name: "Foo",
products: [
.executable(name: "tool", targets: ["tool"]),
.library(name: "Foo", targets: ["Foo"]),
.library(name: "FooDy", type: .dynamic, targets: ["Foo"]),
],
targets: [
.target(name: "Foo"),
.target(name: "tool"),
]
)
"""
let observability = ObservabilitySystem.makeForTesting()
let (manifest, validationDiagnostics) = try loadAndValidateManifest(content, observabilityScope: observability.topScope)
XCTAssertNoDiagnostics(observability.diagnostics)
XCTAssertNoDiagnostics(validationDiagnostics)
let products = Dictionary(uniqueKeysWithValues: manifest.products.map{ ($0.name, $0) })
// Check tool.
let tool = products["tool"]!
XCTAssertEqual(tool.name, "tool")
XCTAssertEqual(tool.targets, ["tool"])
XCTAssertEqual(tool.type, .executable)
// Check Foo.
let foo = products["Foo"]!
XCTAssertEqual(foo.name, "Foo")
XCTAssertEqual(foo.type, .library(.automatic))
XCTAssertEqual(foo.targets, ["Foo"])
// Check FooDy.
let fooDy = products["FooDy"]!
XCTAssertEqual(fooDy.name, "FooDy")
XCTAssertEqual(fooDy.type, .library(.dynamic))
XCTAssertEqual(fooDy.targets, ["Foo"])
}
func testSystemPackage() throws {
let content = """
import PackageDescription
let package = Package(
name: "Copenssl",
pkgConfig: "openssl",
providers: [
.brew(["openssl"]),
.apt(["openssl", "libssl-dev"]),
]
)
"""
let observability = ObservabilitySystem.makeForTesting()
let (manifest, validationDiagnostics) = try loadAndValidateManifest(content, observabilityScope: observability.topScope)
XCTAssertNoDiagnostics(observability.diagnostics)
XCTAssertNoDiagnostics(validationDiagnostics)
XCTAssertEqual(manifest.displayName, "Copenssl")
XCTAssertEqual(manifest.pkgConfig, "openssl")
XCTAssertEqual(manifest.providers, [
.brew(["openssl"]),
.apt(["openssl", "libssl-dev"]),
])
}
func testCTarget() throws {
let content = """
import PackageDescription
let package = Package(
name: "libyaml",
targets: [
.target(
name: "Foo",
publicHeadersPath: "inc"),
.target(
name: "Bar"),
]
)
"""
let observability = ObservabilitySystem.makeForTesting()
let (manifest, validationDiagnostics) = try loadAndValidateManifest(content, observabilityScope: observability.topScope)
XCTAssertNoDiagnostics(observability.diagnostics)
XCTAssertNoDiagnostics(validationDiagnostics)
let foo = manifest.targetMap["Foo"]!
XCTAssertEqual(foo.publicHeadersPath, "inc")
let bar = manifest.targetMap["Bar"]!
XCTAssertEqual(bar.publicHeadersPath, nil)
}
func testTargetProperties() throws {
let content = """
import PackageDescription
let package = Package(
name: "libyaml",
targets: [
.target(
name: "Foo",
path: "foo/z",
exclude: ["bar"],
sources: ["bar.swift"],
publicHeadersPath: "inc"),
.target(
name: "Bar"),
]
)
"""
let observability = ObservabilitySystem.makeForTesting()
let (manifest, validationDiagnostics) = try loadAndValidateManifest(content, observabilityScope: observability.topScope)
XCTAssertNoDiagnostics(observability.diagnostics)
XCTAssertNoDiagnostics(validationDiagnostics)
let foo = manifest.targetMap["Foo"]!
XCTAssertEqual(foo.publicHeadersPath, "inc")
XCTAssertEqual(foo.path, "foo/z")
XCTAssertEqual(foo.exclude, ["bar"])
XCTAssertEqual(foo.sources ?? [], ["bar.swift"])
let bar = manifest.targetMap["Bar"]!
XCTAssertEqual(bar.publicHeadersPath, nil)
XCTAssertEqual(bar.path, nil)
XCTAssertEqual(bar.exclude, [])
XCTAssert(bar.sources == nil)
}
func testUnavailableAPIs() throws {
let content = """
import PackageDescription
let package = Package(
name: "Foo",
dependencies: [
.package(url: "/foo1", version: "1.0.0"),
.package(url: "/foo2", branch: "master"),
.package(url: "/foo3", revision: "rev"),
.package(url: "/foo4", range: "1.0.0"..<"1.5.0"),
]
)
"""
let observability = ObservabilitySystem.makeForTesting()
XCTAssertThrowsError(try loadAndValidateManifest(content, observabilityScope: observability.topScope), "expected error") { error in
if case ManifestParseError.invalidManifestFormat(let error, _) = error {
XCTAssert(error.contains("error: 'package(url:version:)' is unavailable: use package(url:exact:) instead"), "\(error)")
XCTAssert(error.contains("error: 'package(url:range:)' is unavailable: use package(url:_:) instead"), "\(error)")
} else {
XCTFail("unexpected error: \(error)")
}
}
}
func testLanguageStandards() throws {
let content = """
import PackageDescription
let package = Package(
name: "testPackage",
targets: [
.target(name: "Foo"),
],
cLanguageStandard: .iso9899_199409,
cxxLanguageStandard: .gnucxx14
)
"""
let observability = ObservabilitySystem.makeForTesting()
let (manifest, validationDiagnostics) = try loadAndValidateManifest(content, observabilityScope: observability.topScope)
XCTAssertNoDiagnostics(observability.diagnostics)
XCTAssertNoDiagnostics(validationDiagnostics)
XCTAssertEqual(manifest.displayName, "testPackage")
XCTAssertEqual(manifest.cLanguageStandard, "iso9899:199409")
XCTAssertEqual(manifest.cxxLanguageStandard, "gnu++14")
}
func testManifestWithWarnings() throws {
let fs = InMemoryFileSystem()
let manifestPath = AbsolutePath.root.appending(component: Manifest.filename)
let content = """
import PackageDescription
func foo() {
let a = 5
}
let package = Package(
name: "Trivial"
)
"""
try fs.writeFileContents(manifestPath, string: content)
let observability = ObservabilitySystem.makeForTesting()
let manifest = try manifestLoader.load(
manifestPath: manifestPath,
packageKind: .root(.root),
toolsVersion: .v4,
fileSystem: fs,
observabilityScope: observability.topScope
)
XCTAssertEqual(manifest.displayName, "Trivial")
XCTAssertEqual(manifest.toolsVersion, .v4)
XCTAssertEqual(manifest.targets, [])
XCTAssertEqual(manifest.dependencies, [])
testDiagnostics(observability.diagnostics) { result in
result.check(diagnostic: .contains("initialization of immutable value 'a' was never used"), severity: .warning)
}
}
func testDuplicateTargets() throws {
let content = """
import PackageDescription
let package = Package(
name: "Foo",
targets: [
.target(name: "A"),
.target(name: "B"),
.target(name: "A"),
.target(name: "B"),
]
)
"""
let observability = ObservabilitySystem.makeForTesting()
let (_, validationDiagnostics) = try loadAndValidateManifest(content, observabilityScope: observability.topScope)
XCTAssertNoDiagnostics(observability.diagnostics)
testDiagnostics(validationDiagnostics) { result in
result.checkUnordered(diagnostic: "duplicate target named 'A'", severity: .error)
result.checkUnordered(diagnostic: "duplicate target named 'B'", severity: .error)
}
}
func testEmptyProductTargets() throws {
let content = """
import PackageDescription
let package = Package(
name: "Foo",
products: [
.library(name: "Product", targets: []),
],
targets: [
.target(name: "Target"),
]
)
"""
let observability = ObservabilitySystem.makeForTesting()
let (_, validationDiagnostics) = try loadAndValidateManifest(content, observabilityScope: observability.topScope)
XCTAssertNoDiagnostics(observability.diagnostics)
testDiagnostics(validationDiagnostics) { result in
result.check(diagnostic: "product 'Product' doesn't reference any targets", severity: .error)
}
}
func testProductTargetNotFound() throws {
let content = """
import PackageDescription
let package = Package(
name: "Foo",
products: [
.library(name: "Product", targets: ["A", "B"]),
],
targets: [
.target(name: "A"),
]
)
"""
let observability = ObservabilitySystem.makeForTesting()
let (_, validationDiagnostics) = try loadAndValidateManifest(content, observabilityScope: observability.topScope)
XCTAssertNoDiagnostics(observability.diagnostics)
testDiagnostics(validationDiagnostics) { result in
result.check(diagnostic: "target 'B' referenced in product 'Product' could not be found; valid targets are: 'A'", severity: .error)
}
}
}
|
[
-1
] |
e57f4d2560d223fe0ac25ad4420fce93010f9d1f
|
58cd89fbcced87404a6de704d539177594776145
|
/SampleProject/Services/CameraConnect/CamConnectService.swift
|
e5f09137a08ca8137d146940055715f5f694b65b
|
[] |
no_license
|
Jendby/SampleProject
|
6ec262a4cddab590d6aa223dd933b6940d72f844
|
d8c05f1cfe05f1bb64f387dd29c7953520636dd9
|
refs/heads/master
| 2021-02-05T01:18:38.801474 | 2020-06-11T10:53:02 | 2020-06-11T10:53:02 | 243,726,173 | 2 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 499 |
swift
|
//
// CamConnectService.swift
// SampleProject
//
// Created by Eugene Smolyakov on 02/03/2020.
// Copyright © 2020 ES. All rights reserved.
//
import Foundation
import AVFoundation
protocol CamConnectServiceListener: class {
var nameForImageFromCamera: String { get }
func changed(layer: AVCaptureVideoPreviewLayer?)
}
protocol CamConnectService {
func startCameraFor(delegate: CamConnectServiceListener) -> String?
func stopCameraFor(delegate: CamConnectServiceListener)
}
|
[
-1
] |
f846c44716281f289cbb1fbe37ae20472fb2e6b2
|
4031516c336388f81b707344e739f8a76904ce30
|
/demo/GroundSdkDemo/FacilityCells/FirmwareManagerCell.swift
|
4e5ed31aa3d7a7bcdbec2488e2cb73719faea5a4
|
[] |
permissive
|
Parrot-Developers/groundsdk-ios
|
588f941366f9195b99e1d749235d6b048fe58970
|
d85c798e9e3a7e19f5a0ad9f9ab8f7753d422d4a
|
refs/heads/master
| 2021-07-22T05:45:30.700080 | 2021-05-04T14:52:34 | 2021-05-04T14:52:34 | 184,032,755 | 18 | 11 |
BSD-3-Clause
| 2021-07-18T05:55:22 | 2019-04-29T08:38:19 |
Swift
|
UTF-8
|
Swift
| false | false | 2,107 |
swift
|
// Copyright (C) 2019 Parrot Drones SAS
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in
// the documentation and/or other materials provided with the
// distribution.
// * Neither the name of the Parrot Company nor the names
// of its contributors may be used to endorse or promote products
// derived from this software without specific prior written
// permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
// PARROT COMPANY BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
// OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
// SUCH DAMAGE.
import GroundSdk
import UIKit
class FirmwareManagerCell: FacilityCell {
private var firmwareManager: Ref<FirmwareManager>?
override func initContent(tableView: UITableView) {
super.initContent(tableView: tableView)
firmwareManager = groundSdk.getFacility(Facilities.firmwareManager) { [weak self] firmwareManager in
if firmwareManager != nil {
self?.show()
} else {
self?.hide()
}
}
}
}
|
[
-1
] |
e72793c18348d9afcf941b0dad9054773aacc61c
|
f503b1d89e5c0274d26a90fb5ec2ad1106b34acc
|
/Tests/RegressionProtectorTests/XCTestManifests.swift
|
67b6ad93766747e0f5c486ae1cd9639ed57253ca
|
[] |
no_license
|
mackoj/swift-bitrise-regression-protector
|
b5bd8a683b8bd072f99464a0dc690a9d30adc7d7
|
93bb7ff31dbd9d68d8915a737f2e5bd59580a8c6
|
refs/heads/master
| 2020-05-20T23:23:37.923155 | 2019-05-14T12:18:02 | 2019-05-14T12:18:02 | 185,798,778 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 169 |
swift
|
import XCTest
#if !canImport(ObjectiveC)
public func allTests() -> [XCTestCaseEntry] {
return [
testCase(RegressionProtectorTests.allTests),
]
}
#endif
|
[
324611,
254468,
45060,
222726,
35348,
35357,
323614,
342563,
333350,
30252,
118828,
35376,
199217,
321586,
347127,
168502,
321593,
162364,
162369,
35394,
242243,
339018,
332369,
187475,
332372,
332374,
184407,
341079,
327257,
343657,
343148,
333426,
343159,
339575,
253048,
346747,
347260,
323712,
245379,
245390,
258711,
315550,
343207,
248490,
352943,
351418,
326337,
323780,
357065,
351437,
339670,
333529,
223964,
354013,
254175,
352994,
329454,
211188,
353015,
65273,
194811,
353020,
126214,
162567,
319238,
374026,
148238,
136464,
338195,
365844,
353562,
347419,
150815,
321824,
198431,
343333,
342309,
325415,
342832,
347445,
354105,
368447,
244558,
345424,
251217,
353621,
253784,
339803,
253788,
253792,
240480,
246118,
253799,
211816,
253804,
253807,
106864,
253811,
243572,
337273,
359290,
151933,
325523,
200088,
327064,
141736,
178089,
222125,
344505,
150971,
343998,
343489,
326593,
329153,
344516,
373201,
340947,
355283,
343521,
343524,
319463,
351208,
340971,
6124,
343028,
200183,
219130,
10239
] |
dcce9df2c7bcdc988d96a7bb665e2f958c3ca1ed
|
d529c3fc0ee2e859bf9742aed318d49d6f1909f6
|
/StreamsEx/StreamsEx/PipelineStage.swift
|
dd375ae1e5fa3b2f7e8969641b3a148fc35ffe9a
|
[] |
no_license
|
SiarheiFedartsou/Streams
|
1cc6602ae8b90d60177ea687bb51f9f553392936
|
5a4f5f1a56047270c888abe2b9f70a564725fcf2
|
refs/heads/master
| 2020-06-27T21:44:37.588683 | 2017-03-10T22:39:33 | 2017-03-10T22:39:33 | 74,514,131 | 1 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 7,005 |
swift
|
//
// PipelineStage.swift
// StreamsEx
//
// Created by Sergey Fedortsov on 13.01.17.
// Copyright © 2017 Sergey Fedortsov. All rights reserved.
//
protocol PipelineStageProtocol {
associatedtype SourceSpliterator : SpliteratorProtocol
associatedtype PipelineStageIn
associatedtype PipelineStageOut
var sourceSpliterator: SourceSpliterator? { get }
func evaluateParallelLazy<Stage: PipelineStageProtocol, Spliterator: SpliteratorProtocol>(stage: Stage, spliterator: Spliterator) -> AnySpliterator<PipelineStageOut> where Spliterator.Element == PipelineStageIn
func wrap<Spliterator: SpliteratorProtocol>(spliterator: Spliterator) -> AnySpliterator<PipelineStageOut> where Spliterator.Element == PipelineStageIn
func wrap<Sink: SinkProtocol>(sink: Sink) -> AnySink<PipelineStageIn> where Sink.Consumable == PipelineStageOut
func makeSink<NextSink: SinkProtocol>(withNextSink nextSink: NextSink) -> AnySink<PipelineStageIn> where NextSink.Consumable == PipelineStageOut
}
class PipelineStage<In, Out, SourceSpliterator: SpliteratorProtocol, PreviousStage: PipelineStageProtocol> : Stream<Out>, PipelineStageProtocol where PreviousStage.PipelineStageOut == In {
typealias PipelineStageOut = Out
typealias PipelineStageIn = In
let sourceSpliterator: SourceSpliterator?
var prevStage: PreviousStage? = nil
init<UnsafePreviousStage: PipelineStageProtocol & UntypedPipelineStageProtocol>(previousStage: UnsafePreviousStage?, stageFlags: StreamFlagsModifiers) where UnsafePreviousStage.SourceSpliterator == SourceSpliterator {
self.sourceSpliterator = previousStage?.sourceSpliterator
super.init()
self.prevStage = previousStage as! PreviousStage?
previousStage?.nextStage = self
self.stageFlags = stageFlags
self.previousStage = previousStage
self.sourceStage = previousStage?.sourceStage
self.unsafeSourceSpliterator = previousStage?.unsafeSourceSpliterator
if let previousStage = previousStage {
self.isParallel = previousStage.isParallel
self.depth = previousStage.depth + 1
self.combinedFlags = previousStage.combinedFlags.applying(modifiers: stageFlags)
} else {
self.combinedFlags = StreamFlags(modifiers: stageFlags)
}
}
init(sourceSpliterator: SourceSpliterator, stageFlags: StreamFlagsModifiers) {
self.sourceSpliterator = sourceSpliterator
super.init()
self.prevStage = nil
self.stageFlags = stageFlags
self.previousStage = nil
self.sourceStage = self
self.combinedFlags = StreamFlags(modifiers: stageFlags)
}
override func unsafeWrap(sink: UntypedSinkProtocol) -> UntypedSinkProtocol {
var _sink = sink;
var stage: UntypedPipelineStageProtocol? = self
while let currentStage = stage, currentStage.depth > 0 {
_sink = currentStage.unsafeMakeSink(withNextSink: _sink)
stage = currentStage.previousStage
}
return _sink;
}
override func unsafeMakeSink(withNextSink: UntypedSinkProtocol) -> UntypedSinkProtocol {
_abstract()
}
override func unsafeEvaluateParallelLazy(stage: UntypedPipelineStageProtocol, spliterator: AnySpliterator<Any>) -> AnySpliterator<Any> {
return evaluateParallel(stage: stage, spliterator: spliterator).spliterator
}
override func evaluateParallel(stage: UntypedPipelineStageProtocol, spliterator: AnySpliterator<Any>) -> UntypedNodeProtocol {
_abstract()
}
override func unsafeWrap(spliterator: AnySpliterator<Any>) -> AnySpliterator<Any> {
return AnySpliterator(UnsafeWrappingSpliterator(stage: self, spliterator: spliterator, isParallel: isParallel))
}
override func evaluate<R, TerminalOperation: TerminalOperationProtocol>(terminalOperation: TerminalOperation) -> R where TerminalOperation.Result == R {
return isParallel ? terminalOperation.evaluateParallel(forPipelineStage: self, spliterator: spliterator()) : terminalOperation.evaluateSequential(forPipelineStage: self, spliterator: spliterator())
}
private func spliterator() -> AnySpliterator<Any> {
guard let sourceStage = sourceStage else { fatalError() }
var spliterator: AnySpliterator<Any>
if let unsafeSourceSpliterator = unsafeSourceSpliterator {
spliterator = unsafeSourceSpliterator
} else {
fatalError()
}
if isParallel {
var currentStage: UntypedPipelineStageProtocol = sourceStage
var nextStage: UntypedPipelineStageProtocol? = sourceStage.nextStage
var depth = 1
while currentStage !== self, let next = nextStage {
if next.isStateful {
depth = 0
spliterator = next.unsafeEvaluateParallelLazy(stage: currentStage, spliterator: spliterator)
}
nextStage?.depth = depth
depth += 1
currentStage = next
nextStage = next.nextStage
}
}
return spliterator
}
public override func map<R>(_ mapper: @escaping (Out) -> R) -> Stream<R> {
return MapPipelineStage<Out, R, SourceSpliterator, PipelineStage>(previousStage: self, stageFlags: [.notSorted, .notDistinct], mapper: mapper)
}
public override func slice(_ bounds: ClosedRange<IntMax>) -> Stream<Out> {
return SlicePipelineStage<Out, SourceSpliterator, PipelineStage>(previousStage: self, stageFlags: [], skip: bounds.lowerBound, limit: bounds.upperBound - bounds.lowerBound)
}
public override func unordered() -> Stream<Out> {
return FlagModifyingPipelineStage<Out, SourceSpliterator, PipelineStage>(previousStage: self, flags: [.notOrdered])
}
func evaluateParallelLazy<Stage: PipelineStageProtocol, Spliterator: SpliteratorProtocol>(stage: Stage, spliterator: Spliterator) -> AnySpliterator<PipelineStageOut> where Spliterator.Element == PipelineStageIn {
_abstract()
}
func wrap<Spliterator: SpliteratorProtocol>(spliterator: Spliterator) -> AnySpliterator<PipelineStageOut> where Spliterator.Element == PipelineStageIn {
return AnySpliterator(WrappingSpliterator(stage: self, spliterator: spliterator, isParallel: isParallel))
}
func wrap<Sink: SinkProtocol>(sink: Sink) -> AnySink<PipelineStageIn> where Sink.Consumable == PipelineStageOut {
_abstract()
}
func makeSink<NextSink: SinkProtocol>(withNextSink nextSink: NextSink) -> AnySink<PipelineStageIn> where NextSink.Consumable == PipelineStageOut {
_abstract()
}
}
extension PipelineStage {
}
|
[
-1
] |
59bbc94e2b6b95b569c498c663131b722c8369b4
|
db1fa2f90086f192c876bdf534c55c36f1d7fbc0
|
/Traccar/GroupPermission.swift
|
fe8802869a782d6839fcb5bfa36e770347ded962
|
[] |
no_license
|
zzheads/Traccar
|
d9b3709633d4e9a6eca8661187f4848d802f827b
|
bd4e0d41483b28786b3455bc0a27ea6b875466cb
|
refs/heads/master
| 2021-01-12T09:19:22.477729 | 2017-02-14T17:19:16 | 2017-02-14T17:19:16 | 81,315,835 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 593 |
swift
|
//
// GroupPermission.swift
// Traccar
//
// Created by Alexey Papin on 08.02.17.
// Copyright © 2017 zzheads. All rights reserved.
//
import Foundation
//GroupPermission
//
//Property Type
//groupId integer
//userId integer
class GroupPermission: JSONDecodable {
let groupId: Int
let userId: Int
required init?(with json: JSON) {
guard
let groupId = json["groupId"] as? Int,
let userId = json["userId"] as? Int
else {
return nil
}
self.groupId = groupId
self.userId = userId
}
}
|
[
-1
] |
9dfd50e74f35d44c56fed8f88aca6abd9d10cf69
|
f529c219a013ab919cf657a14075db5bb7c42fe8
|
/EwanoCash/TransferPage/CollectionViewCell.swift
|
6ae9a6f0d1674fcf5b7a685e38c59d19dff02253
|
[] |
no_license
|
rezakashkoul/EwanoCash
|
d53c6ef0e032aead5e27cf6daf51873d8562c593
|
a0f5dae6bd585486ac3ef0d9cc6d36267814ba4c
|
refs/heads/main
| 2023-08-23T12:13:03.051107 | 2021-10-12T11:15:47 | 2021-10-12T11:15:47 | 413,470,849 | 1 | 1 | null | 2021-10-05T12:35:26 | 2021-10-04T15:03:37 |
Swift
|
UTF-8
|
Swift
| false | false | 528 |
swift
|
//
// CollectionViewCell.swift
// EwanoCash
//
// Created by Roham on 7/7/1400 AP.
//
import UIKit
class CollectionViewCell: UICollectionViewCell {
@IBOutlet weak var numbersButton: UIButton!
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
numbersButton.layer.cornerRadius = 0
// numbersButton.layer.borderWidth = 0.5
numbersButton.layer.borderColor = UIColor.lightGray.cgColor
numbersButton.titleLabel?.textColor = .blue
}
}
|
[
-1
] |
1941ed695bcc4257590b2b2c18712f0dd4adece6
|
4185927ffdbaa39ee7c8f5bd2bccc61b66f7c0d1
|
/NavStuff/TableViewController.swift
|
d4be82512eb3c2d217eecafab85b30fdc1b905ae
|
[
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] |
permissive
|
jhantelleb/swift-tableViewNav-readme-ios-0916
|
685cac261cbde6c730d4d7d38abc44559bd0d471
|
abf55a96a2c9f9eb215dffec2d51a74631120b9f
|
refs/heads/master
| 2020-05-29T08:42:09.549983 | 2016-10-06T15:30:14 | 2016-10-06T15:30:14 | 70,089,945 | 0 | 0 | null | 2016-10-05T18:59:56 | 2016-10-05T18:59:55 | null |
UTF-8
|
Swift
| false | false | 1,090 |
swift
|
//
// TableViewController.swift
// NavStuff
//
// Created by James Campagno on 6/16/16.
// Copyright © 2016 Flatiron School. All rights reserved.
//
import UIKit
class TableViewController: UITableViewController {
var dirtyDancingSoundtrack = [ "(I've Had) The Time of My Life", "Be My Baby", "She's Like the Wind", "Hungry Eyes", "STAY", "Yes", "You Don't Own Me", "Hey Baby", "Overload", "Love is Strange", "Where Are You Tonight", "In the Still of the Night"]
override func numberOfSections(in tableView: UITableView) -> Int {
return 1
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return dirtyDancingSoundtrack.count
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "DirtyCell", for: indexPath)
let songTitle = dirtyDancingSoundtrack[indexPath.row]
cell.textLabel?.text = songTitle
return cell
}
}
|
[
-1
] |
de0850cd49f1005614acc4ff835bc51fac5a8817
|
a600b03266f492b7f065b293d724a72e5908448c
|
/stdlib/public/SDK/Foundation/IndexSet.swift
|
68782d989f728758b45f611f5d7c365c8326c89f
|
[
"Apache-2.0",
"Swift-exception"
] |
permissive
|
jingaprilzhang/swift
|
6e923c847e29bbfd4b07de404d0b9fa0ac967c3f
|
212ffadf5e652cbddb4bb39a203dafa632ed84d5
|
refs/heads/master
| 2020-05-29T11:54:10.940278 | 2016-08-02T17:21:01 | 2016-08-02T17:21:01 | 64,780,659 | 2 | 0 | null | 2016-08-02T18:09:29 | 2016-08-02T18:09:29 | null |
UTF-8
|
Swift
| false | false | 40,670 |
swift
|
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
@_exported import Foundation // Clang module
extension IndexSet.Index {
public static func ==(lhs: IndexSet.Index, rhs: IndexSet.Index) -> Bool {
return lhs.value == rhs.value && rhs.rangeIndex == rhs.rangeIndex
}
public static func <(lhs: IndexSet.Index, rhs: IndexSet.Index) -> Bool {
return lhs.value < rhs.value && rhs.rangeIndex <= rhs.rangeIndex
}
public static func <=(lhs: IndexSet.Index, rhs: IndexSet.Index) -> Bool {
return lhs.value <= rhs.value && rhs.rangeIndex <= rhs.rangeIndex
}
public static func >(lhs: IndexSet.Index, rhs: IndexSet.Index) -> Bool {
return lhs.value > rhs.value && rhs.rangeIndex >= rhs.rangeIndex
}
public static func >=(lhs: IndexSet.Index, rhs: IndexSet.Index) -> Bool {
return lhs.value >= rhs.value && rhs.rangeIndex >= rhs.rangeIndex
}
}
extension IndexSet.RangeView {
public static func ==(lhs: IndexSet.RangeView, rhs: IndexSet.RangeView) -> Bool {
return lhs.startIndex == rhs.startIndex && lhs.endIndex == rhs.endIndex && lhs.indexSet == rhs.indexSet
}
}
// We currently cannot use this mechanism because NSIndexSet is not abstract; it has its own ivars and therefore subclassing it using the same trick as NSData, etc. does not work.
/*
private final class _SwiftNSIndexSet : _SwiftNativeNSIndexSet, _SwiftNativeFoundationType {
public typealias ImmutableType = NSIndexSet
public typealias MutableType = NSMutableIndexSet
var __wrapped : _MutableUnmanagedWrapper<ImmutableType, MutableType>
init(immutableObject: AnyObject) {
// Take ownership.
__wrapped = .Immutable(
Unmanaged.passRetained(
_unsafeReferenceCast(immutableObject, to: ImmutableType.self)))
super.init()
}
init(mutableObject: AnyObject) {
// Take ownership.
__wrapped = .Mutable(
Unmanaged.passRetained(
_unsafeReferenceCast(mutableObject, to: MutableType.self)))
super.init()
}
public required init(unmanagedImmutableObject: Unmanaged<ImmutableType>) {
// Take ownership.
__wrapped = .Immutable(unmanagedImmutableObject)
super.init()
}
public required init(unmanagedMutableObject: Unmanaged<MutableType>) {
// Take ownership.
__wrapped = .Mutable(unmanagedMutableObject)
super.init()
}
deinit {
releaseWrappedObject()
}
}
*/
/// Manages a `Set` of integer values, which are commonly used as an index type in Cocoa API.
///
/// The range of valid integer values is 0..<INT_MAX-1. Anything outside this range is an error.
public struct IndexSet : ReferenceConvertible, Equatable, BidirectionalCollection, SetAlgebra {
/// An view of the contents of an IndexSet, organized by range.
///
/// For example, if an IndexSet is composed of:
/// `[1..<5]` and `[7..<10]` and `[13]`
/// then calling `next()` on this view's iterator will produce 3 ranges before returning nil.
public struct RangeView : Equatable, BidirectionalCollection {
public typealias Index = Int
public let startIndex : Index
public let endIndex : Index
fileprivate var indexSet : IndexSet
// Range of element values
private var intersectingRange : Range<IndexSet.Element>?
fileprivate init(indexSet : IndexSet, intersecting range : Range<IndexSet.Element>?) {
self.indexSet = indexSet
self.intersectingRange = range
if let r = range {
if r.lowerBound == r.upperBound {
startIndex = 0
endIndex = 0
} else {
let minIndex = indexSet._indexOfRange(containing: r.lowerBound)
let maxIndex = indexSet._indexOfRange(containing: r.upperBound)
switch (minIndex, maxIndex) {
case (nil, nil):
startIndex = 0
endIndex = 0
case (nil, .some(let max)):
// Start is before our first range
startIndex = 0
endIndex = max + 1
case (.some(let min), nil):
// End is after our last range
startIndex = min
endIndex = indexSet._rangeCount
case (.some(let min), .some(let max)):
startIndex = min
endIndex = max + 1
}
}
} else {
startIndex = 0
endIndex = indexSet._rangeCount
}
}
public func makeIterator() -> IndexingIterator<RangeView> {
return IndexingIterator(_elements: self)
}
public subscript(index : Index) -> CountableRange<IndexSet.Element> {
let indexSetRange = indexSet._range(at: index)
if let intersectingRange = intersectingRange {
return Swift.max(intersectingRange.lowerBound, indexSetRange.lowerBound)..<Swift.min(intersectingRange.upperBound, indexSetRange.upperBound)
} else {
return indexSetRange.lowerBound..<indexSetRange.upperBound
}
}
public subscript(bounds: Range<Index>) -> BidirectionalSlice<RangeView> {
return BidirectionalSlice(base: self, bounds: bounds)
}
public func index(after i: Index) -> Index {
return i + 1
}
public func index(before i: Index) -> Index {
return i - 1
}
}
/// The mechanism for accessing the integers stored in an IndexSet.
public struct Index : CustomStringConvertible, Comparable {
fileprivate var value : IndexSet.Element
fileprivate var extent : Range<IndexSet.Element>
fileprivate var rangeIndex : Int
fileprivate let rangeCount : Int
fileprivate init(value: Int, extent: Range<Int>, rangeIndex: Int, rangeCount: Int) {
self.value = value
self.extent = extent
self.rangeCount = rangeCount
self.rangeIndex = rangeIndex
}
public var description: String {
return "index \(value) in a range of \(extent) [range #\(rangeIndex + 1)/\(rangeCount)]"
}
}
public typealias ReferenceType = NSIndexSet
public typealias Element = Int
fileprivate var _handle: _MutablePairHandle<NSIndexSet, NSMutableIndexSet>
/// Initialize an `IndexSet` with a range of integers.
public init(integersIn range: Range<Element>) {
_handle = _MutablePairHandle(NSIndexSet(indexesIn: _toNSRange(range)), copying: false)
}
/// Initialize an `IndexSet` with a range of integers.
public init(integersIn range: ClosedRange<Element>) { self.init(integersIn: Range(range)) }
/// Initialize an `IndexSet` with a range of integers.
public init(integersIn range: CountableClosedRange<Element>) { self.init(integersIn: Range(range)) }
/// Initialize an `IndexSet` with a range of integers.
public init(integersIn range: CountableRange<Element>) { self.init(integersIn: Range(range)) }
/// Initialize an `IndexSet` with a single integer.
public init(integer: Element) {
_handle = _MutablePairHandle(NSIndexSet(index: integer), copying: false)
}
/// Initialize an empty `IndexSet`.
public init() {
_handle = _MutablePairHandle(NSIndexSet(), copying: false)
}
public var hashValue : Int {
return _handle.map { $0.hash }
}
/// Returns the number of integers in `self`.
public var count: Int {
return _handle.map { $0.count }
}
public func makeIterator() -> IndexingIterator<IndexSet> {
return IndexingIterator(_elements: self)
}
/// Returns a `Range`-based view of the entire contents of `self`.
///
/// - seealso: rangeView(of:)
public var rangeView : RangeView {
return RangeView(indexSet: self, intersecting: nil)
}
/// Returns a `Range`-based view of `self`.
///
/// - parameter range: A subrange of `self` to view.
public func rangeView(of range : Range<Element>) -> RangeView {
return RangeView(indexSet: self, intersecting: range)
}
/// Returns a `Range`-based view of `self`.
///
/// - parameter range: A subrange of `self` to view.
public func rangeView(of range : ClosedRange<Element>) -> RangeView { return self.rangeView(of: Range(range)) }
/// Returns a `Range`-based view of `self`.
///
/// - parameter range: A subrange of `self` to view.
public func rangeView(of range : CountableClosedRange<Element>) -> RangeView { return self.rangeView(of: Range(range)) }
/// Returns a `Range`-based view of `self`.
///
/// - parameter range: A subrange of `self` to view.
public func rangeView(of range : CountableRange<Element>) -> RangeView { return self.rangeView(of: Range(range)) }
private func _indexOfRange(containing integer : Element) -> RangeView.Index? {
let result = _handle.map {
__NSIndexSetIndexOfRangeContainingIndex($0, UInt(integer))
}
if result == UInt(NSNotFound) {
return nil
} else {
return Int(result)
}
}
private func _range(at index: RangeView.Index) -> Range<Element> {
return _handle.map {
var location : UInt = 0
var length : UInt = 0
__NSIndexSetRangeAtIndex($0, UInt(index), &location, &length)
return Int(location)..<Int(location)+Int(length)
}
}
private var _rangeCount : Int {
return _handle.map {
Int(__NSIndexSetRangeCount($0))
}
}
public var startIndex: Index {
// If this winds up being NSNotFound, that's ok because then endIndex is also NSNotFound, and empty collections have startIndex == endIndex
let extent = _range(at: 0)
return Index(value: extent.lowerBound, extent: extent, rangeIndex: 0, rangeCount: _rangeCount)
}
public var endIndex: Index {
let rangeCount = _rangeCount
let rangeIndex = rangeCount - 1
let extent : Range<Int>
let value : Int
if rangeCount > 0 {
extent = _range(at: rangeCount - 1)
value = extent.upperBound // "1 past the end" position is the last range, 1 + the end of that range's extent
} else {
extent = 0..<0
value = 0
}
return Index(value: value, extent: extent, rangeIndex: rangeIndex, rangeCount: rangeCount)
}
public subscript(index : Index) -> Element {
return index.value
}
public subscript(bounds: Range<Index>) -> BidirectionalSlice<IndexSet> {
return BidirectionalSlice(base: self, bounds: bounds)
}
// We adopt the default implementation of subscript(range: Range<Index>) from MutableCollection
private func _toOptional(_ x : Int) -> Int? {
if x == NSNotFound { return nil } else { return x }
}
/// Returns the first integer in `self`, or nil if `self` is empty.
public var first: Element? {
return _handle.map { _toOptional($0.firstIndex) }
}
/// Returns the last integer in `self`, or nil if `self` is empty.
public var last: Element? {
return _handle.map { _toOptional($0.lastIndex) }
}
/// Returns an integer contained in `self` which is greater than `integer`, or `nil` if a result could not be found.
public func integerGreaterThan(_ integer: Element) -> Element? {
return _handle.map { _toOptional($0.indexGreaterThanIndex(integer)) }
}
/// Returns an integer contained in `self` which is less than `integer`, or `nil` if a result could not be found.
public func integerLessThan(_ integer: Element) -> Element? {
return _handle.map { _toOptional($0.indexLessThanIndex(integer)) }
}
/// Returns an integer contained in `self` which is greater than or equal to `integer`, or `nil` if a result could not be found.
public func integerGreaterThanOrEqualTo(_ integer: Element) -> Element? {
return _handle.map { _toOptional($0.indexGreaterThanOrEqual(to: integer)) }
}
/// Returns an integer contained in `self` which is less than or equal to `integer`, or `nil` if a result could not be found.
public func integerLessThanOrEqualTo(_ integer: Element) -> Element? {
return _handle.map { _toOptional($0.indexLessThanOrEqual(to: integer)) }
}
/// Return a `Range<IndexSet.Index>` which can be used to subscript the index set.
///
/// The resulting range is the range of the intersection of the integers in `range` with the index set. The resulting range will be `isEmpty` if the intersection is empty.
///
/// - parameter range: The range of integers to include.
public func indexRange(in range: Range<Element>) -> Range<Index> {
guard !range.isEmpty, let first = first, let last = last else {
let i = _index(ofInteger: 0)
return i..<i
}
if range.lowerBound > last || (range.upperBound - 1) < first {
let i = _index(ofInteger: 0)
return i..<i
}
if let start = integerGreaterThanOrEqualTo(range.lowerBound), let end = integerLessThanOrEqualTo(range.upperBound - 1) {
let resultFirst = _index(ofInteger: start)
let resultLast = _index(ofInteger: end)
return resultFirst..<index(after: resultLast)
} else {
let i = _index(ofInteger: 0)
return i..<i
}
}
/// Return a `Range<IndexSet.Index>` which can be used to subscript the index set.
///
/// The resulting range is the range of the intersection of the integers in `range` with the index set.
///
/// - parameter range: The range of integers to include.
public func indexRange(in range: CountableRange<Element>) -> Range<Index> { return self.indexRange(in: Range(range)) }
/// Return a `Range<IndexSet.Index>` which can be used to subscript the index set.
///
/// The resulting range is the range of the intersection of the integers in `range` with the index set.
///
/// - parameter range: The range of integers to include.
public func indexRange(in range: ClosedRange<Element>) -> Range<Index> { return self.indexRange(in: Range(range)) }
/// Return a `Range<IndexSet.Index>` which can be used to subscript the index set.
///
/// The resulting range is the range of the intersection of the integers in `range` with the index set.
///
/// - parameter range: The range of integers to include.
public func indexRange(in range: CountableClosedRange<Element>) -> Range<Index> { return self.indexRange(in: Range(range)) }
/// Returns the count of integers in `self` that intersect `range`.
public func count(in range: Range<Element>) -> Int {
return _handle.map { $0.countOfIndexes(in: _toNSRange(range)) }
}
/// Returns the count of integers in `self` that intersect `range`.
public func count(in range: CountableRange<Element>) -> Int { return self.count(in: Range(range)) }
/// Returns the count of integers in `self` that intersect `range`.
public func count(in range: ClosedRange<Element>) -> Int { return self.count(in: Range(range)) }
/// Returns the count of integers in `self` that intersect `range`.
public func count(in range: CountableClosedRange<Element>) -> Int { return self.count(in: Range(range)) }
/// Returns `true` if `self` contains `integer`.
public func contains(_ integer: Element) -> Bool {
return _handle.map { $0.contains(integer) }
}
/// Returns `true` if `self` contains all of the integers in `range`.
public func contains(integersIn range: Range<Element>) -> Bool {
return _handle.map { $0.contains(in: _toNSRange(range)) }
}
/// Returns `true` if `self` contains all of the integers in `range`.
public func contains(integersIn range: CountableRange<Element>) -> Bool { return self.contains(integersIn: Range(range)) }
/// Returns `true` if `self` contains all of the integers in `range`.
public func contains(integersIn range: ClosedRange<Element>) -> Bool { return self.contains(integersIn: Range(range)) }
/// Returns `true` if `self` contains all of the integers in `range`.
public func contains(integersIn range: CountableClosedRange<Element>) -> Bool { return self.contains(integersIn: Range(range)) }
/// Returns `true` if `self` contains all of the integers in `indexSet`.
public func contains(integersIn indexSet: IndexSet) -> Bool {
return _handle.map { $0.contains(indexSet) }
}
/// Returns `true` if `self` intersects any of the integers in `range`.
public func intersects(integersIn range: Range<Element>) -> Bool {
return _handle.map { $0.intersects(in: _toNSRange(range)) }
}
/// Returns `true` if `self` intersects any of the integers in `range`.
public func intersects(integersIn range: CountableRange<Element>) -> Bool { return self.intersects(integersIn: Range(range)) }
/// Returns `true` if `self` intersects any of the integers in `range`.
public func intersects(integersIn range: ClosedRange<Element>) -> Bool { return self.intersects(integersIn: Range(range)) }
/// Returns `true` if `self` intersects any of the integers in `range`.
public func intersects(integersIn range: CountableClosedRange<Element>) -> Bool { return self.intersects(integersIn: Range(range)) }
// MARK: -
// Indexable
public func index(after i: Index) -> Index {
if i.value + 1 == i.extent.upperBound {
// Move to the next range
if i.rangeIndex + 1 == i.rangeCount {
// We have no more to go; return a 'past the end' index
return Index(value: i.value + 1, extent: i.extent, rangeIndex: i.rangeIndex, rangeCount: i.rangeCount)
} else {
let rangeIndex = i.rangeIndex + 1
let rangeCount = i.rangeCount
let extent = _range(at: rangeIndex)
let value = extent.lowerBound
return Index(value: value, extent: extent, rangeIndex: rangeIndex, rangeCount: rangeCount)
}
} else {
// Move to the next value in this range
return Index(value: i.value + 1, extent: i.extent, rangeIndex: i.rangeIndex, rangeCount: i.rangeCount)
}
}
public func formIndex(after i: inout Index) {
if i.value + 1 == i.extent.upperBound {
// Move to the next range
if i.rangeIndex + 1 == i.rangeCount {
// We have no more to go; return a 'past the end' index
i.value += 1
} else {
i.rangeIndex += 1
i.extent = _range(at: i.rangeIndex)
i.value = i.extent.lowerBound
}
} else {
// Move to the next value in this range
i.value += 1
}
}
public func index(before i: Index) -> Index {
if i.value == i.extent.lowerBound {
// Move to the next range
if i.rangeIndex == 0 {
// We have no more to go
return Index(value: i.value, extent: i.extent, rangeIndex: i.rangeIndex, rangeCount: i.rangeCount)
} else {
let rangeIndex = i.rangeIndex - 1
let rangeCount = i.rangeCount
let extent = _range(at: rangeIndex)
let value = extent.upperBound - 1
return Index(value: value, extent: extent, rangeIndex: rangeIndex, rangeCount: rangeCount)
}
} else {
// Move to the previous value in this range
return Index(value: i.value - 1, extent: i.extent, rangeIndex: i.rangeIndex, rangeCount: i.rangeCount)
}
}
public func formIndex(before i: inout Index) {
if i.value == i.extent.lowerBound {
// Move to the next range
if i.rangeIndex == 0 {
// We have no more to go
} else {
i.rangeIndex -= 1
i.extent = _range(at: i.rangeIndex)
i.value = i.extent.upperBound - 1
}
} else {
// Move to the previous value in this range
i.value -= 1
}
}
private func _index(ofInteger integer: Element) -> Index {
let rangeCount = _rangeCount
let value = integer
if let rangeIndex = _indexOfRange(containing: integer) {
let extent = _range(at: rangeIndex)
let rangeIndex = rangeIndex
return Index(value: value, extent: extent, rangeIndex: rangeIndex, rangeCount: rangeCount)
} else {
let extent = 0..<0
let rangeIndex = 0
return Index(value: value, extent: Range(extent), rangeIndex: rangeIndex, rangeCount: rangeCount)
}
}
// MARK: -
// MARK: SetAlgebra
/// Union the `IndexSet` with `other`.
public mutating func formUnion(_ other: IndexSet) {
self = self.union(other)
}
/// Union the `IndexSet` with `other`.
public func union(_ other: IndexSet) -> IndexSet {
// This algorithm is naïve but it works. We could avoid calling insert in some cases.
var result = IndexSet()
for r in self.rangeView {
result.insert(integersIn: Range(r))
}
for r in other.rangeView {
result.insert(integersIn: Range(r))
}
return result
}
/// Exclusive or the `IndexSet` with `other`.
public func symmetricDifference(_ other: IndexSet) -> IndexSet {
var result = IndexSet()
var boundaryIterator = IndexSetBoundaryIterator(self, other)
var flag = false
var start = 0
while let i = boundaryIterator.next() {
if !flag {
// Start a range if one set contains but not the other.
if self.contains(i) != other.contains(i) {
flag = true
start = i
}
} else {
// End a range if both sets contain or both sets do not contain.
if self.contains(i) == other.contains(i) {
flag = false
result.insert(integersIn: start..<i)
}
}
// We never have to worry about having flag set to false after exiting this loop because the last boundary is guaranteed to be past the end of ranges in both index sets
}
return result
}
/// Exclusive or the `IndexSet` with `other`.
public mutating func formSymmetricDifference(_ other: IndexSet) {
self = self.symmetricDifference(other)
}
/// Intersect the `IndexSet` with `other`.
public func intersection(_ other: IndexSet) -> IndexSet {
var result = IndexSet()
var boundaryIterator = IndexSetBoundaryIterator(self, other)
var flag = false
var start = 0
while let i = boundaryIterator.next() {
if !flag {
// If both sets contain then start a range.
if self.contains(i) && other.contains(i) {
flag = true
start = i
}
} else {
// If both sets do not contain then end a range.
if !self.contains(i) || !other.contains(i) {
flag = false
result.insert(integersIn: start..<i)
}
}
}
return result
}
/// Intersect the `IndexSet` with `other`.
public mutating func formIntersection(_ other: IndexSet) {
self = self.intersection(other)
}
/// Insert an integer into the `IndexSet`.
@discardableResult
public mutating func insert(_ integer: Element) -> (inserted: Bool, memberAfterInsert: Element) {
_applyMutation { $0.add(integer) }
// TODO: figure out how to return the truth here
return (true, integer)
}
/// Insert an integer into the `IndexSet`.
@discardableResult
public mutating func update(with integer: Element) -> Element? {
_applyMutation { $0.add(integer) }
// TODO: figure out how to return the truth here
return integer
}
/// Remove an integer from the `IndexSet`.
@discardableResult
public mutating func remove(_ integer: Element) -> Element? {
// TODO: Add method to NSIndexSet to do this in one call
let result : Element? = contains(integer) ? integer : nil
_applyMutation { $0.remove(integer) }
return result
}
// MARK: -
/// Remove all values from the `IndexSet`.
public mutating func removeAll() {
_applyMutation { $0.removeAllIndexes() }
}
/// Insert a range of integers into the `IndexSet`.
public mutating func insert(integersIn range: Range<Element>) {
_applyMutation { $0.add(in: _toNSRange(range)) }
}
/// Insert a range of integers into the `IndexSet`.
public mutating func insert(integersIn range: CountableRange<Element>) { self.insert(integersIn: Range(range)) }
/// Insert a range of integers into the `IndexSet`.
public mutating func insert(integersIn range: ClosedRange<Element>) { self.insert(integersIn: Range(range)) }
/// Insert a range of integers into the `IndexSet`.
public mutating func insert(integersIn range: CountableClosedRange<Element>) { self.insert(integersIn: Range(range)) }
/// Remove a range of integers from the `IndexSet`.
public mutating func remove(integersIn range: Range<Element>) {
_applyMutation { $0.remove(in: _toNSRange(range)) }
}
/// Remove a range of integers from the `IndexSet`.
public mutating func remove(integersIn range: CountableRange<Element>) { self.remove(integersIn: Range(range)) }
/// Remove a range of integers from the `IndexSet`.
public mutating func remove(integersIn range: ClosedRange<Element>) { self.remove(integersIn: Range(range)) }
/// Remove a range of integers from the `IndexSet`.
public mutating func remove(integersIn range: CountableClosedRange<Element>) { self.remove(integersIn: Range(range)) }
/// Returns `true` if self contains no values.
public var isEmpty : Bool {
return self.count == 0
}
/// Returns an IndexSet filtered according to the result of `includeInteger`.
///
/// - parameter range: A range of integers. For each integer in the range that intersects the integers in the IndexSet, then the `includeInteger` predicate will be invoked.
/// - parameter includeInteger: The predicate which decides if an integer will be included in the result or not.
public func filteredIndexSet(in range : Range<Element>, includeInteger: @noescape (Element) throws -> Bool) rethrows -> IndexSet {
let r : NSRange = _toNSRange(range)
return try _handle.map {
var error : Error? = nil
let result = $0.indexes(in: r, options: [], passingTest: { (i, stop) -> Bool in
do {
let include = try includeInteger(i)
return include
} catch let e {
error = e
stop.pointee = true
return false
}
}) as IndexSet
if let e = error {
throw e
} else {
return result
}
}
}
/// Returns an IndexSet filtered according to the result of `includeInteger`.
///
/// - parameter range: A range of integers. For each integer in the range that intersects the integers in the IndexSet, then the `includeInteger` predicate will be invoked.
/// - parameter includeInteger: The predicate which decides if an integer will be included in the result or not.
public func filteredIndexSet(in range : CountableRange<Element>, includeInteger: @noescape (Element) throws -> Bool) rethrows -> IndexSet { return try self.filteredIndexSet(in: Range(range), includeInteger: includeInteger) }
/// Returns an IndexSet filtered according to the result of `includeInteger`.
///
/// - parameter range: A range of integers. For each integer in the range that intersects the integers in the IndexSet, then the `includeInteger` predicate will be invoked.
/// - parameter includeInteger: The predicate which decides if an integer will be included in the result or not.
public func filteredIndexSet(in range : ClosedRange<Element>, includeInteger: @noescape (Element) throws -> Bool) rethrows -> IndexSet { return try self.filteredIndexSet(in: Range(range), includeInteger: includeInteger) }
/// Returns an IndexSet filtered according to the result of `includeInteger`.
///
/// - parameter range: A range of integers. For each integer in the range that intersects the integers in the IndexSet, then the `includeInteger` predicate will be invoked.
/// - parameter includeInteger: The predicate which decides if an integer will be included in the result or not.
public func filteredIndexSet(in range : CountableClosedRange<Element>, includeInteger: @noescape (Element) throws -> Bool) rethrows -> IndexSet { return try self.filteredIndexSet(in: Range(range), includeInteger: includeInteger) }
/// Returns an IndexSet filtered according to the result of `includeInteger`.
///
/// - parameter includeInteger: The predicate which decides if an integer will be included in the result or not.
public func filteredIndexSet(includeInteger: @noescape (Element) throws -> Bool) rethrows -> IndexSet {
return try self.filteredIndexSet(in: 0..<NSNotFound-1, includeInteger: includeInteger)
}
/// For a positive delta, shifts the indexes in [index, INT_MAX] to the right, thereby inserting an "empty space" [index, delta], for a negative delta, shifts the indexes in [index, INT_MAX] to the left, thereby deleting the indexes in the range [index - delta, delta].
public mutating func shift(startingAt integer: Element, by delta: IndexSet.IndexDistance) {
_applyMutation { $0.shiftIndexesStarting(at: integer, by: delta) }
}
// Temporary boxing function, until we can get a native Swift type for NSIndexSet
@inline(__always)
mutating func _applyMutation<ReturnType>(_ whatToDo : @noescape (NSMutableIndexSet) throws -> ReturnType) rethrows -> ReturnType {
// This check is done twice because: <rdar://problem/24939065> Value kept live for too long causing uniqueness check to fail
var unique = true
switch _handle._pointer {
case .Default(_):
break
case .Mutable(_):
unique = isKnownUniquelyReferenced(&_handle)
}
switch _handle._pointer {
case .Default(let i):
// We need to become mutable; by creating a new box we also become unique
let copy = i.mutableCopy() as! NSMutableIndexSet
// Be sure to set the _handle before calling out; otherwise references to the struct in the closure may be looking at the old _handle
_handle = _MutablePairHandle(copy, copying: false)
let result = try whatToDo(copy)
return result
case .Mutable(let m):
// Only create a new box if we are not uniquely referenced
if !unique {
let copy = m.mutableCopy() as! NSMutableIndexSet
_handle = _MutablePairHandle(copy, copying: false)
let result = try whatToDo(copy)
return result
} else {
return try whatToDo(m)
}
}
}
// MARK: - Bridging Support
fileprivate var reference: NSIndexSet {
return _handle.reference
}
fileprivate init(reference: NSIndexSet) {
_handle = _MutablePairHandle(reference)
}
}
extension IndexSet : CustomStringConvertible, CustomDebugStringConvertible, CustomReflectable {
public var description: String {
return "\(count) indexes"
}
public var debugDescription: String {
return "\(count) indexes"
}
public var customMirror: Mirror {
var c: [(label: String?, value: Any)] = []
c.append((label: "ranges", value: rangeView.map { $0 }))
return Mirror(self, children: c, displayStyle: Mirror.DisplayStyle.struct)
}
}
/// Iterate two index sets on the boundaries of their ranges. This is where all of the interesting stuff happens for exclusive or, intersect, etc.
private struct IndexSetBoundaryIterator : IteratorProtocol {
typealias Element = IndexSet.Element
private var i1 : IndexSet.RangeView.Iterator
private var i2 : IndexSet.RangeView.Iterator
private var i1Range : CountableRange<Element>?
private var i2Range : CountableRange<Element>?
private var i1UsedLower : Bool
private var i2UsedLower : Bool
fileprivate init(_ is1 : IndexSet, _ is2 : IndexSet) {
i1 = is1.rangeView.makeIterator()
i2 = is2.rangeView.makeIterator()
i1Range = i1.next()
i2Range = i2.next()
// A sort of cheap iterator on [i1Range.lowerBound, i1Range.upperBound]
i1UsedLower = false
i2UsedLower = false
}
fileprivate mutating func next() -> Element? {
if i1Range == nil && i2Range == nil {
return nil
}
let nextIn1 : Element
if let r = i1Range {
nextIn1 = i1UsedLower ? r.upperBound : r.lowerBound
} else {
nextIn1 = Int.max
}
let nextIn2 : Element
if let r = i2Range {
nextIn2 = i2UsedLower ? r.upperBound : r.lowerBound
} else {
nextIn2 = Int.max
}
var result : Element
if nextIn1 <= nextIn2 {
// 1 has the next element, or they are the same.
result = nextIn1
if i1UsedLower { i1Range = i1.next() }
// We need to iterate both the value from is1 and is2 in the == case.
if result == nextIn2 {
if i2UsedLower { i2Range = i2.next() }
i2UsedLower = !i2UsedLower
}
i1UsedLower = !i1UsedLower
} else {
// 2 has the next element
result = nextIn2
if i2UsedLower { i2Range = i2.next() }
i2UsedLower = !i2UsedLower
}
return result
}
}
extension IndexSet {
public static func ==(lhs: IndexSet, rhs: IndexSet) -> Bool {
return lhs._handle.map { $0.isEqual(to: rhs) }
}
}
private func _toNSRange(_ r : Range<IndexSet.Element>) -> NSRange {
return NSMakeRange(r.lowerBound, r.upperBound - r.lowerBound)
}
extension IndexSet : _ObjectiveCBridgeable {
public static func _getObjectiveCType() -> Any.Type {
return NSIndexSet.self
}
@_semantics("convertToObjectiveC")
public func _bridgeToObjectiveC() -> NSIndexSet {
return reference
}
public static func _forceBridgeFromObjectiveC(_ x: NSIndexSet, result: inout IndexSet?) {
result = IndexSet(reference: x)
}
public static func _conditionallyBridgeFromObjectiveC(_ x: NSIndexSet, result: inout IndexSet?) -> Bool {
result = IndexSet(reference: x)
return true
}
public static func _unconditionallyBridgeFromObjectiveC(_ source: NSIndexSet?) -> IndexSet {
return IndexSet(reference: source!)
}
}
extension NSIndexSet : _HasCustomAnyHashableRepresentation {
// Must be @nonobjc to avoid infinite recursion during bridging.
@nonobjc
public func _toCustomAnyHashable() -> AnyHashable? {
return AnyHashable(self as IndexSet)
}
}
@_silgen_name("__NSIndexSetRangeCount")
internal func __NSIndexSetRangeCount(_ indexSet: NSIndexSet) -> UInt
@_silgen_name("__NSIndexSetRangeAtIndex")
internal func __NSIndexSetRangeAtIndex(_ indexSet: NSIndexSet, _ index: UInt, _ location : UnsafeMutablePointer<UInt>, _ length : UnsafeMutablePointer<UInt>)
@_silgen_name("__NSIndexSetIndexOfRangeContainingIndex")
internal func __NSIndexSetIndexOfRangeContainingIndex(_ indexSet: NSIndexSet, _ index: UInt) -> UInt
// MARK: Protocol
// TODO: This protocol should be replaced with a native Swift object like the other Foundation bridged types. However, NSIndexSet does not have an abstract zero-storage base class like NSCharacterSet, NSData, and NSAttributedString. Therefore the same trick of laying it out with Swift ref counting does not work.and
/// Holds either the immutable or mutable version of a Foundation type.
///
/// In many cases, the immutable type has optimizations which make it preferred when we know we do not need mutation.
private enum _MutablePair<ImmutableType, MutableType> {
case Default(ImmutableType)
case Mutable(MutableType)
}
/// A class type which acts as a handle (pointer-to-pointer) to a Foundation reference type which has both an immutable and mutable class (e.g., NSData, NSMutableData).
///
/// a.k.a. Box
private final class _MutablePairHandle<ImmutableType : NSObject, MutableType : NSObject>
where ImmutableType : NSMutableCopying, MutableType : NSMutableCopying {
fileprivate var _pointer: _MutablePair<ImmutableType, MutableType>
/// Initialize with an immutable reference instance.
///
/// - parameter immutable: The thing to stash.
/// - parameter copying: Should be true unless you just created the instance (or called copy) and want to transfer ownership to this handle.
init(_ immutable : ImmutableType, copying : Bool = true) {
if copying {
self._pointer = _MutablePair.Default(immutable.copy() as! ImmutableType)
} else {
self._pointer = _MutablePair.Default(immutable)
}
}
/// Initialize with a mutable reference instance.
///
/// - parameter mutable: The thing to stash.
/// - parameter copying: Should be true unless you just created the instance (or called copy) and want to transfer ownership to this handle.
init(_ mutable : MutableType, copying : Bool = true) {
if copying {
self._pointer = _MutablePair.Mutable(mutable.mutableCopy() as! MutableType)
} else {
self._pointer = _MutablePair.Mutable(mutable)
}
}
/// Apply a closure to the reference type, regardless if it is mutable or immutable.
@inline(__always)
func map<ReturnType>(_ whatToDo : @noescape (ImmutableType) throws -> ReturnType) rethrows -> ReturnType {
switch _pointer {
case .Default(let i):
return try whatToDo(i)
case .Mutable(let m):
// TODO: It should be possible to reflect the constraint that MutableType is a subtype of ImmutableType in the generics for the class, but I haven't figured out how yet. For now, cheat and unsafe bit cast.
return try whatToDo(unsafeBitCast(m, to: ImmutableType.self))
}
}
var reference : ImmutableType {
switch _pointer {
case .Default(let i):
return i
case .Mutable(let m):
// TODO: It should be possible to reflect the constraint that MutableType is a subtype of ImmutableType in the generics for the class, but I haven't figured out how yet. For now, cheat and unsafe bit cast.
return unsafeBitCast(m, to: ImmutableType.self)
}
}
}
|
[
91396,
74317
] |
2fc0d7c0a5892b5245bf3c11ac89fd6a2dce64ac
|
1ed9a85d9d86ca7f93f07787e2d3fdeba51b09d7
|
/TodoTests/TodoTests.swift
|
7322073aa98677918bec3002a3c6b697799b907f
|
[] |
no_license
|
Oisann/Todo
|
6123867ccfa37e41fb9f236be0ad795df8af8176
|
f535e202e582889c6a21909ad06091b76a3e2278
|
refs/heads/master
| 2021-03-27T17:21:33.319653 | 2018-03-02T11:58:01 | 2018-03-02T11:58:01 | 122,484,399 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 952 |
swift
|
//
// TodoTests.swift
// TodoTests
//
// Created by Trainee on 16/02/2018.
// Copyright © 2018 Trainee. All rights reserved.
//
import XCTest
@testable import Todo
class TodoTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
func testExample() {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
func testPerformanceExample() {
// This is an example of a performance test case.
self.measure {
// Put the code you want to measure the time of here.
}
}
}
|
[
360462,
278558,
229413,
204840,
278570,
344107,
360491,
155694,
229424,
237620,
229430,
163896,
180280,
213052,
376894,
286788,
352326,
254027,
311372,
196691,
180311,
180312,
385116,
237663,
254048,
319591,
131178,
278634,
221290,
278638,
319598,
204916,
131189,
131191,
237689,
131198,
311435,
311438,
278677,
196760,
426138,
278685,
311458,
278691,
196773,
278699,
278704,
377009,
278708,
131256,
278714,
295098,
139479,
229597,
311519,
205035,
286958,
327929,
344313,
147717,
368905,
278797,
254226,
319763,
368916,
262421,
377114,
278810,
278816,
237856,
237857,
311597,
98610,
262450,
180535,
336183,
278842,
287043,
311621,
139589,
319813,
344401,
377169,
368981,
155990,
278869,
368984,
106847,
98657,
270701,
270706,
139640,
311681,
311685,
106888,
385417,
385422,
213403,
246178,
385454,
377264,
278961,
278965,
278970,
311738,
33211,
319930,
336320,
311745,
278978,
254406,
188871,
278989,
278993,
278999,
328152,
369116,
188894,
287198,
279008,
279013,
279018,
311786,
319981,
279022,
279029,
254456,
279032,
377338,
377343,
279039,
254465,
287241,
279050,
303631,
139792,
279057,
303636,
279062,
393751,
279065,
377376,
180771,
377386,
197167,
385588,
279094,
115270,
385615,
426576,
369235,
287318,
295519,
139872,
66150,
279146,
295536,
287346,
139892,
287352,
344696,
279164,
189057,
303746,
311941,
336518,
311945,
369289,
344715,
279177,
311949,
287374,
377489,
311954,
352917,
230040,
271000,
377497,
303771,
377500,
221852,
295576,
205471,
344738,
139939,
279210,
287404,
205487,
295599,
303793,
336564,
287417,
303803,
287422,
377539,
287433,
287439,
164560,
385747,
279252,
361176,
418520,
287452,
295652,
279269,
369385,
230125,
312047,
279280,
312052,
230134,
172792,
344827,
221948,
279294,
205568,
295682,
197386,
434957,
295697,
426774,
197399,
426775,
197411,
279336,
262954,
295724,
312108,
197422,
353070,
164656,
303920,
262962,
295729,
197431,
230199,
336702,
295744,
279362,
353109,
377686,
230234,
189275,
435039,
295776,
279392,
303972,
385893,
279397,
230248,
246641,
246643,
295798,
246648,
279417,
361337,
254850,
369538,
287622,
213894,
295824,
279456,
189348,
279464,
140204,
377772,
304051,
230332,
287677,
189374,
377790,
353215,
353216,
213957,
213960,
345033,
279498,
386006,
304087,
418776,
50143,
123881,
320493,
304110,
287731,
271350,
295927,
304122,
328700,
328706,
410627,
320516,
295942,
386056,
353290,
230410,
377869,
238610,
418837,
140310,
230423,
320536,
197657,
238623,
189474,
369701,
238639,
312373,
238651,
230463,
377926,
238664,
296019,
353367,
304222,
230499,
279660,
173166,
156785,
312434,
377972,
279672,
377983,
279685,
402565,
222343,
386189,
296086,
238743,
296092,
238765,
279728,
238769,
402613,
230588,
279747,
353479,
402634,
353482,
279760,
189652,
279765,
189653,
419029,
148696,
296153,
279774,
304351,
304356,
222440,
279785,
328940,
279792,
386294,
386301,
320770,
386306,
328971,
312587,
353551,
173334,
320796,
222494,
304421,
279854,
353584,
345396,
386359,
378172,
279875,
312648,
337225,
304456,
230729,
222541,
296270,
238927,
353616,
296273,
222559,
378209,
230756,
386412,
230765,
296303,
279920,
296307,
116084,
181625,
337281,
148867,
296329,
296335,
230799,
9619,
370071,
279974,
279984,
173491,
304564,
279989,
353719,
296375,
296387,
361927,
296392,
296391,
280010,
280013,
312782,
222675,
329173,
239068,
280032,
271843,
280041,
296425,
296433,
280055,
288249,
296448,
329225,
230921,
296461,
149007,
304656,
329232,
370197,
230943,
402985,
394794,
230959,
288309,
312889,
288318,
280130,
124485,
288327,
280147,
239198,
157281,
99938,
312940,
222832,
288378,
337534,
337535,
263809,
239237,
288392,
239250,
419478,
198324,
296628,
337591,
296632,
280257,
280267,
403148,
9936,
9937,
370388,
272085,
345814,
280278,
280280,
18138,
67292,
345821,
321247,
321249,
345833,
345834,
313065,
280300,
239341,
288491,
419569,
67315,
173814,
313081,
124669,
288512,
288516,
280327,
280329,
321302,
345879,
116505,
321310,
255776,
313120,
362283,
378668,
280366,
296755,
280372,
321337,
280380,
345919,
436031,
403267,
280390,
280392,
345929,
304977,
18262,
362327,
280410,
345951,
362337,
345955,
296806,
288619,
288620,
280430,
214895,
313199,
362352,
296814,
313203,
182144,
305026,
67463,
329622,
337815,
214937,
214938,
239514,
247712,
436131,
436137,
362417,
288697,
362431,
280514,
280519,
214984,
362443,
231375,
280541,
329695,
436191,
313319,
247785,
296941,
436205,
124911,
329712,
43014,
354316,
313357,
305179,
313375,
354343,
354345,
223274,
124975,
346162,
288828,
436285,
288833,
288834,
436292,
403525,
280649,
436301,
338001,
338003,
223316,
280661,
329814,
223318,
288857,
354393,
280675,
280677,
43110,
313447,
321637,
436329,
329829,
288879,
223350,
280694,
288889,
215164,
215166,
280712,
215178,
141450,
346271,
436383,
362659,
239793,
125109,
182456,
280762,
223419,
379071,
280768,
149703,
280778,
346314,
321745,
280795,
387296,
280802,
379106,
346346,
321772,
436470,
157944,
149760,
411906,
125188,
125198,
125199,
272658,
125203,
125208,
338218,
321840,
379186,
125235,
280887,
125240,
321860,
280902,
289110,
305495,
215385,
379225,
321894,
280939,
313713,
354676,
199029,
436608,
362881,
240002,
436611,
280961,
108944,
190871,
149916,
420253,
141728,
289189,
289194,
108972,
272813,
338356,
436661,
281040,
289232,
256477,
281072,
174593,
420369,
223767,
223769,
207393,
289332,
174648,
338489,
338490,
281166,
281171,
297560,
436832,
436834,
313966,
281199,
420463,
346737,
313971,
346740,
420471,
330379,
133774,
330387,
117396,
346772,
117397,
330388,
264856,
314009,
289434,
346779,
166582,
314040,
158394,
199366,
363211,
363230,
289502,
264928,
330474,
289518,
125684,
199414,
322313,
117517,
322319,
166676,
207640,
281377,
289576,
191283,
273207,
289598,
281408,
281427,
281433,
330609,
174963,
207732,
158593,
224145,
355217,
256922,
289690,
289698,
420773,
289703,
363438,
347055,
289727,
273344,
330689,
363458,
379844,
19399,
52172,
183248,
248796,
347103,
314342,
52200,
289774,
183279,
347123,
314355,
240630,
257024,
330754,
134150,
322570,
330763,
281625,
281626,
175132,
248872,
207938,
314436,
314448,
339030,
281697,
281700,
257125,
273515,
207979,
404593,
363641,
363644,
150657,
248961,
330888,
363669,
339100,
380061,
429214,
199839,
339102,
330913,
306338,
265379,
249002,
306346,
3246,
421048,
208058,
322749,
265412,
290000,
298208,
363744,
298212,
298213,
290022,
330984,
298221,
298228,
216315,
208124,
437505,
322824,
257305,
339234,
199971,
372009,
412971,
298291,
306494,
216386,
224586,
372043,
331090,
314709,
314710,
372054,
159066,
224606,
314720,
142689,
281957,
281962,
134506,
306542,
380271,
208244,
249204,
314741,
290173,
306559,
314751,
224640,
298374,
314758,
314760,
142729,
388487,
281992,
314766,
306579,
224661,
282007,
290207,
314783,
314789,
282022,
314791,
282024,
396711,
396712,
380337,
380338,
150965,
380357,
339398,
306631,
306639,
413137,
429542,
306673,
306677,
191990,
290300,
282114,
372227,
306692,
306693,
323080,
192010,
282129,
175639,
282136,
388632,
396827,
282141,
134686,
347694,
290358,
265798,
282183,
265804,
396882,
290390,
306776,
44635,
396895,
323172,
282213,
224883,
314998,
323196,
339584,
192131,
282245,
282246,
290443,
323217,
282259,
282271,
282273,
282276,
298661,
323236,
290471,
282280,
298667,
224946,
110268,
224958,
282303,
274115,
282312,
306890,
282318,
241361,
241365,
282327,
298712,
216795,
298720,
282339,
12010,
282348,
282355,
282358,
339715,
323331,
323332,
216839,
339720,
282378,
372496,
323346,
282391,
282400,
339745,
315171,
257830,
421672,
282409,
159533,
282417,
200498,
282427,
282434,
307011,
282438,
323406,
307025,
413521,
216918,
307031,
241495,
282474,
282480,
241528,
339841,
241540,
282504,
315273,
315274,
110480,
184208,
372626,
380821,
282518,
282519,
44952,
118685,
298909,
298920,
323507,
282549,
290745,
290746,
274371,
151497,
372701,
298980,
380908,
290811,
282633,
241692,
307231,
102437,
315432,
233517,
102445,
176175,
282672,
241716,
159807,
225351,
315465,
315476,
307289,
315487,
356447,
45153,
307299,
307301,
438377,
233589,
233590,
266357,
422019,
241808,
381073,
233636,
184484,
299174,
233642,
323762,
299187,
405687,
299198,
258239,
389313,
299203,
299209,
372941,
282831,
266449,
356576,
176362,
307435,
438511,
233715,
381172,
168188,
184575,
381208,
299293,
282909,
151839,
233762,
217380,
282919,
332083,
332085,
332089,
315706,
282939,
307517,
438596,
332101,
323913,
348492,
323920,
348500,
168281,
332123,
323935,
332127,
242023,
160110,
242033,
291192,
340357,
225670,
242058,
373134,
291224,
242078,
61857,
315810,
61859,
315811,
381347,
340398,
299441,
283064,
291267,
127427,
127428,
283075,
324039,
373197,
176601,
160225,
291311,
291333,
340490,
283153,
258581,
291358,
283182,
283184,
234036,
315960,
348732,
242237,
70209,
348742,
70215,
348749,
381517,
332378,
201308,
242277,
111208,
184940,
373358,
389745,
209530,
291454,
373375,
184962,
152195,
348806,
152203,
316049,
111253,
316053,
111258,
111259,
176808,
299699,
299700,
422596,
422599,
291530,
225995,
225997,
242386,
226004,
226007,
422617,
422626,
226019,
299746,
234217,
299759,
299770,
234234,
299776,
242433,
291585,
430849,
234241,
209670,
291592,
226058,
234250,
62220,
234253,
422673,
430865,
291604,
234263,
422680,
283419,
234268,
234277,
283430,
234283,
152365,
234286,
422703,
234289,
422709,
152374,
234294,
160571,
234301,
430910,
160575,
160580,
234311,
234312,
299849,
381773,
234317,
201551,
234323,
234326,
234331,
242529,
349026,
357218,
234340,
234343,
177001,
234346,
201577,
308076,
242541,
234355,
209783,
234360,
209785,
234361,
177019,
185211,
308092,
398206,
234366,
291712,
234367,
234372,
381829,
226181,
226184,
316298,
308107,
308112,
349072,
234386,
234387,
234392,
324506,
324507,
390045,
234400,
185250,
234404,
283558,
185254,
234409,
275371,
234419,
373687,
234425,
234427,
234430,
234436,
234438,
373706,
316364,
234444,
234445,
234451,
234454,
234457,
234463,
340961,
234466,
234472,
234473,
324586,
234477,
234482,
316405,
349175,
201720,
127992,
234498,
357379,
234500,
234506,
324625,
234514,
308243,
316437,
234531,
357414,
234534,
234542,
300084,
234548,
234555,
308287,
234560,
234565,
234569,
218186,
300111,
234577,
341073,
234583,
439384,
234584,
234587,
300135,
316520,
300136,
275565,
357486,
144496,
234609,
300146,
275571,
300150,
300151,
291959,
234616,
398457,
160891,
300158,
234622,
234625,
349316,
349318,
275591,
234632,
234638,
373903,
169104,
177296,
234642,
308372,
185493,
119962,
300187,
300188,
119963,
283802,
234656,
234659,
234663,
300201,
300202,
275625,
226481,
373945,
283840,
259268,
283847,
283852,
259280,
316627,
333011,
234733,
292085,
234742,
292091,
128251,
234755,
439562,
292107,
414990,
251153,
177428,
349462,
226608,
382258,
300343,
382269,
333117,
226624,
193859,
300359,
226632,
234827,
177484,
406861,
259406,
234831,
120148,
283991,
357719,
374109,
218462,
234850,
292195,
333160,
284014,
243056,
316787,
111993,
357762,
112017,
234898,
259475,
275859,
357786,
251298,
333220,
316842,
374191,
284089,
292283,
415171,
300487,
300489,
284107,
284116,
210390,
210391,
210393,
226781,
144867,
316902,
251378,
308723,
333300,
300535,
300536,
333303,
300542,
259599,
308756,
398869,
374296,
374299,
308764,
333343,
431649,
169518,
431663,
194110,
349763,
218696,
292425,
276040,
128587,
333388,
366154,
276045,
243274,
300630,
128599,
243292,
333408,
300644,
317032,
415338,
243307,
54893,
325231,
276085,
325245,
235135,
194180,
415375,
276120,
276126,
333470,
153251,
300714,
210603,
300728,
415420,
333503,
218819,
259781,
333517,
276173,
333520,
333521,
325346,
276195,
153319,
325352,
284401,
276210,
300794,
325371,
276219,
194303,
194304,
300811,
276238,
284431,
243472,
366360,
284442,
325404,
276253,
333610,
399147,
431916,
284459,
300848,
276282,
259899,
276283,
325439,
276287,
276294,
153415,
276298,
341836,
415567,
325457,
317269,
341847,
284507,
350044,
128862,
300894,
284512,
284514,
276327,
292712,
423789,
325492,
276341,
300918,
341879,
317304,
333688,
276344,
194429,
112509,
55167,
325503,
333701,
243591,
325515,
243597,
325518,
333722,
350109,
300963,
292771,
415655,
284587,
292782,
243637,
276408,
276421,
284619,
276430,
301008,
153554,
194515,
276444,
292836,
292837,
276454,
317415,
276459,
325619,
432116,
292858,
415741,
333828,
358410,
399373,
317467,
145435,
227370,
325674,
309295,
243759,
129076,
276534,
243767,
358456,
227417,
194656,
309345,
227428,
276582,
194666,
276589,
260207,
432240,
227439,
284788,
292992,
194691,
227460,
415881,
104587,
235662,
276627,
317587,
276632,
284825,
284826,
333991,
284842,
129203,
227513,
309444,
227524,
276682,
227548,
194782,
301279,
317664,
211193,
243962,
375039,
309503,
325905,
325912,
309529,
227616,
211235,
432421,
211238,
358703,
358709,
260418,
227654,
227658,
276813,
6481,
366930,
6482,
6489,
391520,
276835,
383332,
383336,
416104,
276847,
285040,
317820,
211326,
317831,
227725,
227726,
178578,
252308,
178582,
293274,
285084,
121245,
285090,
342450,
293303,
276920,
276925,
293310,
416197,
129483,
342476,
317901,
326100,
227809,
342498,
358882,
334309,
227813,
391655,
432618,
375276,
309744,
301571,
276998,
186893,
416286,
375333,
293419,
244269,
375343,
236081,
23092,
375351,
277048,
244281,
301638,
309830,
293448,
55881,
416341,
309846,
416351,
268899,
277094,
39530,
277101,
277111,
301689,
244347,
277133,
326287,
375440,
334481,
318106,
318107,
342682,
285353,
285361,
342706,
318130,
293556,
383667,
285371,
285373,
39614,
154316,
203477,
96984,
375526,
285415,
342762,
342763,
293612,
277227,
154359,
432893,
162561,
285444,
383754,
285458,
310036,
326429,
293664,
326433,
400166,
293672,
285487,
301871,
375609,
285497,
162621,
293693,
162626,
277316,
252741,
318278,
277325,
293711,
244568,
244570,
301918,
293730,
342887,
400239,
310131,
277366,
228215,
277370,
269178,
400252,
359298,
359299,
260996,
277381,
113542,
228233,
228234,
392074,
56208,
293781,
318364,
310176,
310178,
310182,
293800,
236461,
293806,
326581,
326587,
326601,
359381,
433115,
343005,
277479,
326635,
203757,
187374,
383983,
277492,
318461,
293886,
293893,
277509,
277510,
433165,
384016,
277523,
433174,
252958,
310317,
203830,
359478,
302139,
277563,
277597,
113760,
302177,
392290,
253029,
285798,
228458,
15471,
351344,
285814,
392318,
187521,
384131,
285828,
302213,
285830,
253063,
302216,
228491,
228493,
162961,
326804,
285851,
351390,
302240,
253099,
253100,
318639,
367799,
113850,
294074,
64700,
277690,
228540,
228542,
302274,
367810,
228563,
195808,
310497,
195811,
228588,
302325,
204022,
228600,
261377,
228609,
253216,
277792,
277800,
113966,
261425,
351537,
286013,
286018,
113987,
15686,
294218,
146762,
294219,
318805,
425304,
294243,
163175,
327024,
318848,
179587,
253317,
384393,
368011,
318864,
318868,
318875,
310692,
245161,
286129,
286132,
228795,
425405,
302531,
163269,
425418,
310732,
302540,
64975,
310736,
228827,
286172,
310757,
187878,
286202,
359930,
286205,
302590,
228861,
294400,
253451,
359950,
65041,
146964,
253463,
204313,
302623,
286244,
245287,
245292,
278060,
286254,
196164,
56902,
228943,
286288,
179801,
147036,
343647,
286306,
310889,
204397,
138863,
188016,
188031,
294529,
286343,
229001,
310923,
188048,
425626,
229020,
302754,
40613,
40614,
40615,
229029,
278191,
286388,
286391,
384695,
327358,
286399,
212685,
302797,
384720,
212688,
302802,
245457,
286423,
278233,
278234,
294622,
278240,
229088,
212716,
212717,
360177,
229113,
286459,
278272,
319233,
311042,
360195,
278291,
278293,
294678,
278299,
286494,
294700,
409394,
319292,
360252,
360264,
188251,
376669,
245599,
237408,
425825,
302946,
425833,
417654,
188292,
40853,
294807,
294809,
376732,
294814,
311199,
319392,
294823,
327596,
294843,
188348,
98239,
237504,
294850,
384964,
344013,
212942,
24532,
294886,
311281,
311282
] |
16b1796ef3535ee4353ca6062a4ab607ff918f12
|
6207408f4244fb321cf4141399b4a9662a435725
|
/DCColor/Sources/CanvasColorPickerView.swift
|
7947acc883b6c3fee11beb7a2dbf67af0bc80cf1
|
[
"MIT"
] |
permissive
|
quantumOrange/DCColor
|
9bbc8dbb3318f0eff1842098e5d57eb4e9cb6ef0
|
9bc0920ff6d0bd2b21f3d7a1d6bcc54c46f21e04
|
refs/heads/master
| 2020-04-26T14:23:25.754354 | 2019-03-03T11:51:17 | 2019-03-03T11:51:17 | 173,612,343 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 5,388 |
swift
|
//
// CanvasColorPickerView.swift
// PaintLab
//
// Created by David Crooks on 14/09/2015.
// Copyright (c) 2015 David Crooks. All rights reserved.
//
import UIKit
import DCCoreGraphics
@IBDesignable
class CanvasColorPickerView: UIView {
@IBInspectable var curveFactor:CGFloat = 33.0
@IBInspectable var swatchMargin:CGFloat = 5.0
var radius:CGFloat = 0.0
override init(frame: CGRect) {
super.init(frame: frame)
setup()
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
setup()
}
private var swatch = CALayer()
private func setup() {
layer.anchorPoint = CGPoint(x: 0.5, y: 1.0)
self.backgroundColor = UIColor.clear
layer.addSublayer(swatch)
self.layoutSubviews()
// swatch.position = CGPoint(x: layer.position.x,y: layer.position.y - 25 )
}
func showColor(_ color:Color)
{
swatch.backgroundColor = color.uiColor.cgColor
}
override func awakeFromNib() {
setup()
}
override func layoutSubviews() {
super.layoutSubviews()
radius = 0.5*frame.size.width
let swatchradius = radius - swatchMargin
swatch.frame = CGRect(x: 0, y: 0, width: 2*swatchradius, height: 2*swatchradius)
swatch.cornerRadius = swatchradius
swatch.position = CGPoint(x:0,y:0)
}
///animates the view transform such that if the swatch would be above the given rect (and perhaps not visable) it will rotate so that the swatch appears below the point that is pointed too
func animate(atPoint p:CGPoint, inRect rect:CGRect) {
layoutIfNeeded()
if (p.y - bounds.size.height < rect.origin.y) {
if transform.isIdentity {
UIView.animate(withDuration: 0.3, animations: {
self.transform = CGAffineTransform(rotationAngle: CGFloat.pi)
})
}
}
else if !transform.isIdentity {
UIView.animate(withDuration: 0.3, animations: {
self.transform = CGAffineTransform.identity
})
}
}
override func draw(_ rect: CGRect) {
guard let context = UIGraphicsGetCurrentContext() else { return }
// let radius = 0.5*rect.size.width
let leftCircleTangentPoint = rect.topLeft + CGPoint(x: 0.0, y:radius)
let rightCircleTangentPoint = rect.topRight + CGPoint(x: 0.0, y:radius)
let ratio = curveFactor/100.0
let controlPointY = radius + ratio*(rect.height - radius)
context.setFillColor(UIColor.gray.cgColor)
context.move(to:leftCircleTangentPoint )
context.addArc(tangent1End:rect.topLeft , tangent2End: rect.topCenter, radius: radius)
context.addArc(tangent1End: rect.topRight , tangent2End: rightCircleTangentPoint, radius: radius)
context.addQuadCurve(to: rect.bottomCenter, control: CGPoint(x:rect.topRight.x, y:controlPointY ))
context.addQuadCurve(to: leftCircleTangentPoint, control:CGPoint(x:rect.topLeft.x, y:controlPointY ))
context.drawPath(using: .fill)
}
}
class CanvasColorPickerController {
init(canvasView:UIView, containingView:UIView, layer:ColorLayer,pickColorAction:@escaping ((Color) -> ())) {
self.canvasView = canvasView
self.paintView = containingView
colorPickerView = CanvasColorPickerView(frame: CGRect(x: 0.0, y: 0.0, width: 50, height: 100))
self.layer = layer
pickColor = pickColorAction
//add gesture to container view
let gesture = UILongPressGestureRecognizer(target:self,action: #selector(handleLongPress))
containingView.addGestureRecognizer(gesture)
}
var canvasView:UIView
var paintView:UIView
var colorPickerView:CanvasColorPickerView
var layer:ColorLayer
var pickColor:(Color) -> ()
@objc func handleLongPress(_ gesture:UILongPressGestureRecognizer) {
let pointInCanvas = gesture.location(in: canvasView)
let pointInView = gesture.location(in: paintView)
let color = layer.color(atPoint: pointInCanvas.pixelPoint )
switch gesture.state {
case .began:
if canvasView.bounds.contains(pointInCanvas) {
paintView.addSubview(colorPickerView)
colorPickerView.showColor(color)
colorPickerView.center = pointInView
}
colorPickerView.animate(atPoint:pointInView, inRect:paintView.bounds)
break
case .changed:
colorPickerView.center = pointInView
colorPickerView.animate(atPoint:pointInView, inRect:paintView.bounds)
colorPickerView.showColor(color)
case .ended:
colorPickerView.showColor(color)
colorPickerView.removeFromSuperview()
case .failed:
colorPickerView.removeFromSuperview()
case .cancelled:
colorPickerView.removeFromSuperview()
case .possible:
break
}
}
}
|
[
-1
] |
9952a2baa80fb67678783c843bf2c54edf9a0b6b
|
09f64f5b9c8797c0746804802f21f2eeacabbb6b
|
/Project4/ViewController.swift
|
bf643b97aca5b31a44ae7f1ad8ae147730b2f3ab
|
[] |
no_license
|
seb-glanum/Project4-ios
|
5f28c60c82ec0f7ccecd48dd8b7109db1fce924c
|
f41832c72e8e7c09a46a9d42a551adb85fe61160
|
refs/heads/master
| 2023-06-01T15:42:21.270490 | 2021-06-18T13:57:03 | 2021-06-18T13:57:03 | 378,166,352 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 3,262 |
swift
|
//
// ViewController.swift
// Project4
//
// Created by iMac on 16/06/2021.
//
import UIKit
import WebKit
class ViewController: UIViewController, WKNavigationDelegate {
var webView: WKWebView!
var progressView: UIProgressView!
var webSites = ["apple.com", "glanum.com"]
override func loadView() {
webView = WKWebView()
webView.navigationDelegate = self
view = webView
}
override func viewDidLoad() {
super.viewDidLoad()
navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Ouvrir !", style: .plain, target: self, action: #selector(openTapped))
let spacer = UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil)
let refresh = UIBarButtonItem(barButtonSystemItem: .refresh, target: webView, action: #selector(webView.reload))
progressView = UIProgressView(progressViewStyle: .default)
progressView.sizeToFit()
let progressButton = UIBarButtonItem(customView: progressView)
toolbarItems = [progressButton, spacer, refresh]
navigationController?.isToolbarHidden = false
webView.addObserver(self, forKeyPath: #keyPath(WKWebView.estimatedProgress), options: .new, context: nil)
// Do any additional setup after loading the view.
let url = URL(string: "https://" + webSites[0])!
webView.load(URLRequest(url: url))
webView.allowsBackForwardNavigationGestures = true
}
@objc func openTapped() {
let ac = UIAlertController(title: "Choissez un lien", message: nil, preferredStyle: .actionSheet)
for webSite in webSites {
ac.addAction(UIAlertAction(title: webSite, style: .default, handler: openPage))
}
ac.addAction(UIAlertAction(title: "Annuler", style: .cancel))
ac.popoverPresentationController?.barButtonItem = navigationItem.rightBarButtonItem
present(ac, animated: true)
}
func openPage(action: UIAlertAction) {
//let url = URL(string: "https://www." + action.title!)!
// permet de vérifier et si on a un null alors retour automatique :)
guard let actionTitle = action.title else { return }
guard let url = URL(string: "https://" + actionTitle) else { return }
webView.load(URLRequest(url: url))
}
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
title = webView.title
}
override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
if(keyPath == "estimatedProgress"){
progressView.progress = Float(webView.estimatedProgress)
}
}
func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) {
let url = navigationAction.request.url
if let host = url?.host {
for website in webSites {
if(host.contains(website)){
decisionHandler(.allow)
return
}
}
}
decisionHandler(.cancel)
}
}
|
[
339426,
339427,
350340,
264651,
241597,
300285
] |
98614028b4679535ed013e90e1dd1cf58efa149c
|
0c5875a0330d43e2d7cb02f0cb880871c39b4c2a
|
/FKY/FKYSwift/App/RegisterInfo(注册信息)/View/RITopTipView.swift
|
9355aa30354de1149d18e533386b03d8b3179112
|
[] |
no_license
|
AlexFeng007/swiftDemo
|
eaf1f70311ac09beb351c51107e8f87e272bb5c5
|
f33424287a60d553847c31e19de40d3ba808db55
|
refs/heads/master
| 2023-01-21T09:11:17.593889 | 2020-11-26T04:25:18 | 2020-11-26T04:25:18 | 316,121,813 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,984 |
swift
|
//
// RITopTipView.swift
// FKY
//
// Created by 夏志勇 on 2019/8/6.
// Copyright © 2019 yiyaowang. All rights reserved.
// [资料管理]顶部文字提示视图
import UIKit
class RITopTipView: UIView {
// MARK: - Property
// 提示
fileprivate lazy var lblTip: UILabel = {
let lbl = UILabel()
lbl.backgroundColor = .clear
lbl.font = UIFont.systemFont(ofSize: WH(12))
lbl.textColor = RGBColor(0xE8772A)
lbl.textAlignment = .center
lbl.text = "企业名称请与营业执照保持一致,否则卖家会拒绝为您发货"
lbl.numberOfLines = 0
return lbl
}()
// MARK: - LifeCycle
override init(frame: CGRect) {
super.init(frame: frame)
setupView()
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
// MARK: - UI
func setupView() {
backgroundColor = RGBColor(0xFFFCF1)
addSubview(lblTip)
lblTip.snp.makeConstraints { (make) in
make.edges.equalTo(self).inset(UIEdgeInsets(top: WH(8), left: WH(10), bottom: WH(8), right: WH(10)))
}
}
// MARK: - Public
func configView(_ tip: String?) {
lblTip.text = tip
}
// 计算高度
func getContentHeight() -> CGFloat {
// 文本内容高度...<默认高度16>
var heightTxt = WH(16)
if let txt = lblTip.text, txt.isEmpty == false {
// 计算高度
let size = txt.boundingRect(with: CGSize.init(width: SCREEN_WIDTH - WH(20), height: CGFloat(MAXFLOAT)), options: .usesLineFragmentOrigin, attributes: [NSAttributedString.Key.font:UIFont.systemFont(ofSize: WH(12))], context: nil).size
heightTxt = size.height
// 最小高度
if heightTxt <= WH(16) {
heightTxt = WH(16)
}
}
return heightTxt + WH(16)
}
}
|
[
-1
] |
3bde33114594146b430138261830d98512b44051
|
b8d6aa16048d53e088f678faeb9a43ce6ffcd7bd
|
/webViewSample/webViewSample/AppDelegate.swift
|
9b545a9933977ae87dbbafbd3d5f54116514cc16
|
[
"MIT"
] |
permissive
|
lyra/webview-payment-ios-integration-sample
|
2afc5fc4041eb1a305bece034a2c20b242183e61
|
589fe3f158123a4b500a022f01c113085c13a573
|
refs/heads/master
| 2022-07-21T01:01:08.297851 | 2022-06-14T10:04:43 | 2022-06-14T10:04:43 | 148,804,850 | 6 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,183 |
swift
|
//
// AppDelegate.swift
// webViewSample
//
// Created by Lyra Network on 13/09/2018.
// Copyright © 2018 Lyra Network. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
}
|
[
229380,
229383,
229385,
294924,
229388,
229391,
327695,
229394,
229397,
229399,
229402,
229405,
229408,
278564,
294950,
229415,
229417,
327722,
237613,
229422,
360496,
229426,
237618,
229428,
311349,
286774,
286776,
319544,
286778,
204856,
229432,
352318,
286791,
237640,
286797,
278605,
311375,
163920,
237646,
196692,
319573,
311383,
319590,
311400,
278635,
303212,
278639,
131192,
278648,
237693,
303230,
327814,
303241,
131209,
303244,
311436,
319633,
286873,
286876,
311460,
311469,
32944,
327862,
286906,
327866,
180413,
286910,
131264,
286916,
286922,
286924,
286926,
319694,
131281,
278743,
278747,
295133,
155872,
319716,
237807,
303345,
286962,
303347,
131314,
229622,
327930,
278781,
278783,
278785,
237826,
319751,
278792,
286987,
319757,
311569,
286999,
319770,
287003,
287006,
287009,
287012,
287014,
287016,
287019,
311598,
287023,
262448,
311601,
295220,
287032,
155966,
319809,
319810,
278849,
319814,
311623,
319818,
311628,
229709,
319822,
287054,
278865,
229717,
196963,
196969,
139638,
213367,
106872,
319872,
311683,
319879,
311693,
65943,
319898,
311719,
278952,
139689,
278957,
311728,
278967,
180668,
311741,
278975,
319938,
278980,
98756,
278983,
319945,
278986,
319947,
278990,
278994,
279003,
279006,
188895,
172512,
287202,
279010,
279015,
172520,
319978,
279020,
172526,
311791,
279023,
172529,
279027,
319989,
172534,
180727,
164343,
311804,
287230,
279040,
303617,
287234,
279045,
172550,
303623,
172552,
320007,
287238,
279051,
172558,
279055,
303632,
279058,
303637,
279063,
279067,
172572,
279072,
172577,
295459,
172581,
295461,
279082,
311850,
279084,
172591,
172598,
279095,
172607,
172609,
172612,
377413,
172614,
213575,
172618,
303690,
33357,
287309,
303696,
279124,
172634,
262752,
172644,
311911,
189034,
295533,
172655,
172656,
352880,
295538,
189039,
172660,
287349,
189040,
189044,
287355,
287360,
295553,
172675,
295557,
311942,
303751,
287365,
352905,
311946,
279178,
287371,
311951,
287377,
172691,
287381,
311957,
221850,
287386,
230045,
172702,
287390,
303773,
172705,
287394,
172707,
303780,
164509,
287398,
205479,
279208,
287400,
172714,
295595,
279212,
189102,
172721,
287409,
66227,
303797,
189114,
287419,
303804,
328381,
287423,
328384,
172737,
279231,
287427,
312005,
312006,
172748,
287436,
107212,
172751,
287440,
295633,
172755,
303827,
279255,
172760,
287450,
303835,
279258,
189149,
303838,
213724,
312035,
279267,
295654,
279272,
230128,
312048,
312050,
230131,
205564,
303871,
230146,
328453,
295685,
230154,
33548,
312077,
295695,
295701,
230169,
369433,
295707,
328476,
295710,
230175,
295720,
303914,
279340,
205613,
279353,
230202,
312124,
328508,
222018,
295755,
377676,
148302,
287569,
303959,
230237,
279390,
230241,
279394,
303976,
336744,
303981,
303985,
303987,
328563,
279413,
303991,
303997,
295806,
295808,
295813,
304005,
320391,
304007,
213895,
304009,
304011,
230284,
304013,
295822,
279438,
189325,
189329,
295825,
304019,
189331,
58262,
304023,
304027,
279452,
234648,
410526,
279461,
279462,
304042,
213931,
230327,
304055,
287675,
197564,
230334,
304063,
304065,
213954,
189378,
156612,
295873,
213963,
197580,
312272,
304084,
304090,
320481,
304106,
320490,
312302,
328687,
320496,
304114,
295928,
320505,
312321,
295945,
230413,
295949,
197645,
320528,
140312,
295961,
238620,
197663,
304164,
304170,
304175,
238641,
312374,
238652,
238655,
230465,
238658,
336964,
132165,
296004,
205895,
320584,
238666,
296021,
402518,
336987,
230497,
296036,
296040,
361576,
205931,
279661,
205934,
164973,
312432,
279669,
337018,
279679,
304258,
279683,
222340,
205968,
296084,
238745,
304285,
238756,
205991,
222377,
165035,
337067,
238766,
165038,
230576,
238770,
304311,
230592,
312518,
279750,
230600,
230607,
148690,
320727,
279769,
304348,
279777,
304354,
296163,
320740,
279781,
304360,
320748,
279788,
279790,
304370,
296189,
320771,
312585,
296202,
296205,
230674,
320786,
230677,
296213,
296215,
320792,
230681,
230679,
214294,
230689,
173350,
312622,
296243,
312630,
222522,
296253,
222525,
296255,
312639,
230718,
296259,
378181,
296262,
230727,
238919,
296264,
320840,
296267,
296271,
222545,
230739,
312663,
222556,
337244,
230752,
312676,
230760,
173418,
148843,
410987,
230763,
230768,
296305,
312692,
230773,
304505,
304506,
181626,
181631,
148865,
312711,
312712,
296331,
288140,
288144,
230800,
304533,
337306,
288154,
288160,
288162,
288164,
279975,
304555,
370092,
279983,
173488,
288176,
312755,
296373,
312759,
337335,
288185,
279991,
222652,
312766,
173507,
296389,
222665,
230860,
312783,
288208,
230865,
288210,
370130,
288212,
222676,
148946,
280021,
239064,
329177,
288217,
280027,
288220,
288214,
239070,
288218,
288224,
280034,
288226,
280036,
288229,
280038,
288230,
288232,
370146,
320998,
288234,
288236,
288238,
288240,
288242,
296435,
288244,
288250,
296446,
321022,
402942,
148990,
296450,
206336,
230916,
230919,
214535,
230923,
304651,
304653,
370187,
402969,
230940,
222752,
108066,
296486,
296488,
157229,
230961,
157236,
288320,
288325,
124489,
280140,
280145,
288338,
280149,
288344,
280152,
239194,
280158,
403039,
181854,
370272,
239202,
370279,
312938,
280183,
280185,
280188,
280191,
116354,
280194,
280208,
280211,
288408,
280218,
280222,
419489,
190118,
198310,
321195,
296622,
321200,
337585,
296634,
296637,
419522,
313027,
280260,
419525,
206536,
280264,
206539,
206541,
206543,
313044,
280276,
321239,
280283,
313052,
18140,
288478,
313055,
321252,
313066,
288494,
280302,
280304,
313073,
321266,
419570,
288499,
288502,
280314,
288510,
124671,
67330,
280324,
198405,
288519,
280331,
198416,
280337,
296723,
116503,
321304,
329498,
296731,
321311,
313121,
313123,
304932,
321316,
280363,
141101,
165678,
280375,
321336,
296767,
288576,
345921,
280388,
337732,
304968,
280393,
280402,
173907,
313171,
313176,
280419,
321381,
296809,
296812,
313201,
1920,
255873,
305028,
280454,
247688,
280464,
124817,
280468,
239510,
280473,
124827,
214940,
247709,
214944,
280487,
313258,
321458,
296883,
124853,
214966,
296890,
10170,
288700,
296894,
190403,
296900,
280515,
337862,
165831,
280521,
231379,
296921,
354265,
354270,
239586,
313320,
354281,
231404,
124913,
165876,
321528,
239612,
313340,
288764,
239617,
313347,
288773,
313358,
305176,
321560,
313371,
354338,
305191,
223273,
313386,
354348,
124978,
215090,
124980,
288824,
288826,
321595,
313406,
288831,
288836,
67654,
280651,
354382,
288848,
280658,
215123,
354390,
288855,
288859,
280669,
313438,
149599,
280671,
149601,
321634,
149603,
223327,
329830,
280681,
313451,
223341,
280687,
149618,
215154,
313458,
280691,
313464,
329850,
321659,
280702,
288895,
321670,
215175,
141446,
288909,
141455,
141459,
280725,
313498,
100520,
288936,
280747,
288940,
288947,
280755,
321717,
280759,
280764,
280769,
280771,
280774,
280776,
313548,
321740,
280783,
280786,
280788,
313557,
280793,
280796,
280798,
338147,
280804,
280807,
157930,
280811,
280817,
125171,
157940,
280819,
280823,
280825,
280827,
280830,
280831,
125187,
280835,
125191,
125207,
125209,
321817,
125218,
321842,
223539,
125239,
280888,
280891,
289087,
280897,
280900,
305480,
239944,
280906,
239947,
305485,
305489,
379218,
280919,
248153,
215387,
354653,
354656,
313700,
313705,
280937,
190832,
280946,
223606,
313720,
280956,
239997,
280959,
313731,
199051,
240011,
289166,
240017,
297363,
190868,
240021,
297365,
297368,
297372,
141725,
297377,
289186,
297391,
289201,
240052,
289207,
289210,
305594,
281024,
289218,
289221,
289227,
436684,
281045,
281047,
215526,
166378,
305647,
281075,
174580,
240124,
281084,
305662,
305664,
240129,
305666,
305668,
223749,
330244,
281095,
223752,
150025,
338440,
240132,
223757,
281102,
223763,
223765,
281113,
322074,
281116,
281121,
182819,
281127,
150066,
158262,
158266,
289342,
281154,
322115,
281163,
281179,
338528,
338532,
281190,
199273,
281196,
19053,
158317,
313973,
297594,
281210,
158347,
264845,
182926,
133776,
182929,
314003,
117398,
314007,
289436,
174754,
330404,
289448,
133801,
174764,
314029,
314033,
240309,
133817,
314045,
314047,
314051,
199364,
297671,
158409,
289493,
363234,
289513,
289522,
289525,
289532,
322303,
289537,
322310,
264969,
322314,
322318,
281361,
281372,
322341,
215850,
281388,
289593,
281401,
289601,
281410,
281413,
281414,
240458,
281420,
240468,
281430,
322393,
297818,
281435,
281438,
281442,
174955,
224110,
207733,
207737,
158596,
183172,
338823,
322440,
314249,
240519,
183184,
289687,
240535,
224151,
297883,
289694,
289696,
289700,
289712,
281529,
289724,
52163,
183260,
420829,
281567,
289762,
322534,
297961,
183277,
281581,
322550,
134142,
322563,
314372,
330764,
175134,
322599,
322610,
314421,
281654,
314427,
314433,
207937,
314441,
207949,
322642,
314456,
281691,
314461,
281702,
281704,
314474,
281708,
281711,
289912,
248995,
306341,
306344,
306347,
322734,
306354,
142531,
199877,
289991,
306377,
289997,
249045,
363742,
363745,
298216,
330988,
126190,
216303,
322801,
388350,
257302,
363802,
199976,
199978,
314671,
298292,
298294,
257334,
216376,
380226,
298306,
224584,
224587,
224594,
216404,
306517,
150870,
314714,
224603,
159068,
314718,
265568,
314723,
281960,
150890,
306539,
314732,
314736,
290161,
216436,
306549,
298358,
314743,
306552,
290171,
314747,
306555,
298365,
290174,
224641,
281987,
298372,
314756,
281990,
224647,
265604,
298377,
314763,
142733,
298381,
314768,
224657,
306581,
314773,
314779,
314785,
314793,
282025,
282027,
241068,
241070,
241072,
282034,
241077,
150966,
298424,
306618,
282044,
323015,
306635,
306640,
290263,
290270,
290275,
339431,
282089,
191985,
282098,
290291,
282101,
241142,
191992,
290298,
151036,
290302,
282111,
290305,
175621,
306694,
192008,
323084,
257550,
290321,
282130,
323090,
290325,
282133,
241175,
290328,
282137,
290332,
241181,
282142,
282144,
290344,
306731,
290349,
290351,
290356,
28219,
282186,
224849,
282195,
282199,
282201,
306778,
159330,
314979,
298598,
323176,
224875,
241260,
323181,
257658,
315016,
282249,
290445,
282255,
282261,
175770,
298651,
282269,
323229,
298655,
323231,
61092,
282277,
306856,
282295,
323260,
282300,
323266,
282310,
323273,
282319,
306897,
241362,
306904,
282328,
298714,
52959,
216801,
282337,
241380,
216806,
323304,
282345,
12011,
282356,
323318,
282364,
282367,
306945,
323330,
241412,
323333,
282376,
216842,
323345,
282388,
323349,
282392,
184090,
315167,
315169,
282402,
315174,
323367,
241448,
315176,
241450,
282410,
306988,
306991,
315184,
323376,
315190,
241464,
159545,
282425,
298811,
118593,
307009,
413506,
307012,
241475,
298822,
315211,
282446,
307027,
315221,
323414,
315223,
241496,
241498,
307035,
307040,
110433,
241509,
110438,
298860,
110445,
282478,
315249,
110450,
315251,
282481,
315253,
315255,
339838,
315267,
282499,
315269,
241544,
282505,
241546,
241548,
298896,
298898,
282514,
241556,
298901,
44948,
241560,
282520,
241563,
241565,
241567,
241569,
282531,
241574,
282537,
298922,
36779,
241581,
282542,
241583,
323504,
241586,
282547,
241588,
290739,
241590,
241592,
241598,
290751,
241600,
241605,
151495,
241610,
298975,
241632,
298984,
241640,
241643,
298988,
241646,
241649,
241652,
323574,
290807,
299003,
241661,
299006,
282623,
315396,
241669,
315397,
282632,
282639,
290835,
282645,
241693,
282654,
241701,
102438,
217127,
282669,
323630,
282681,
290877,
282687,
159811,
315463,
315466,
192589,
307278,
192596,
176213,
307287,
307290,
217179,
315482,
192605,
315483,
233567,
299105,
200801,
217188,
299109,
307303,
315495,
356457,
45163,
307307,
315502,
192624,
307314,
323700,
299126,
233591,
299136,
307329,
315524,
307338,
233613,
241813,
307352,
299164,
299167,
315552,
184479,
184481,
315557,
184486,
307370,
307372,
184492,
307374,
307376,
323763,
184503,
176311,
299191,
307386,
258235,
307388,
307385,
307390,
176316,
299200,
184512,
307394,
299204,
307396,
184518,
307399,
323784,
233679,
307409,
307411,
176343,
299225,
233701,
307432,
184572,
184579,
282893,
323854,
291089,
282906,
291104,
233766,
176435,
307508,
315701,
332086,
307510,
307512,
168245,
307515,
307518,
282942,
282947,
323917,
110926,
282957,
233808,
323921,
315733,
323926,
233815,
315739,
323932,
299357,
242018,
242024,
299373,
315757,
250231,
242043,
315771,
299388,
299391,
291202,
299398,
242057,
291212,
299405,
291222,
315801,
283033,
242075,
291226,
61855,
291231,
283042,
291238,
291241,
127403,
127405,
291247,
299440,
127407,
299444,
127413,
283062,
291254,
127417,
291260,
283069,
127421,
127424,
299457,
127429,
127434,
315856,
176592,
127440,
315860,
176597,
283095,
127447,
299481,
127449,
176605,
242143,
127455,
127457,
291299,
340454,
127463,
242152,
291305,
127466,
176620,
127469,
127474,
291314,
291317,
127480,
135672,
291323,
233979,
127485,
291330,
283142,
127494,
127497,
233994,
135689,
127500,
291341,
233998,
127506,
234003,
234006,
127511,
152087,
242202,
234010,
135707,
135710,
242206,
242208,
291361,
242220,
291378,
152118,
234038,
234041,
315961,
70213,
242250,
111193,
242275,
299620,
242279,
168562,
184952,
135805,
135808,
291456,
373383,
299655,
135820,
316051,
225941,
316054,
299672,
135834,
373404,
299677,
225948,
135839,
299680,
225954,
299684,
135844,
242343,
209576,
242345,
373421,
135870,
135873,
135876,
135879,
299720,
299723,
299726,
225998,
226002,
226005,
226008,
299740,
242396,
201444,
299750,
283368,
234219,
283372,
185074,
226037,
283382,
316151,
234231,
234236,
242431,
234239,
209665,
234242,
299778,
242436,
226053,
234246,
226056,
234248,
291593,
242443,
234252,
242445,
234254,
291601,
234258,
242450,
242452,
234261,
201496,
234264,
234266,
234269,
283421,
234272,
234274,
152355,
299814,
234278,
283432,
234281,
234284,
234287,
283440,
185138,
242483,
234292,
234296,
234298,
160572,
283452,
234302,
234307,
242499,
234309,
316233,
234313,
316235,
234316,
283468,
234319,
242511,
234321,
234324,
185173,
201557,
234329,
234333,
308063,
234336,
242530,
349027,
234338,
234341,
234344,
234347,
177004,
234350,
324464,
234353,
152435,
177011,
234356,
234358,
234362,
234364,
291711,
234368,
291714,
234370,
291716,
234373,
316294,
201603,
226182,
308105,
234375,
324490,
226185,
234384,
234388,
234390,
324504,
234393,
209818,
308123,
324508,
234396,
291742,
226200,
234401,
291747,
291748,
234405,
291750,
234407,
324520,
324518,
324522,
234410,
291756,
291754,
226220,
324527,
291760,
234417,
201650,
324531,
234414,
234422,
226230,
324536,
275384,
234428,
291773,
242623,
324544,
234431,
234434,
324546,
324548,
234437,
226245,
234439,
226239,
234443,
291788,
234446,
275406,
193486,
234449,
316370,
193488,
234452,
234455,
234459,
234461,
234464,
234467,
234470,
168935,
5096,
324585,
234478,
316400,
234481,
316403,
234484,
234485,
234487,
324599,
234490,
234493,
316416,
234496,
308226,
234501,
308231,
234504,
234507,
234515,
300054,
316439,
234520,
234519,
234523,
234526,
234528,
300066,
234532,
300069,
234535,
234537,
234540,
144430,
234543,
234546,
275508,
300085,
234549,
300088,
234553,
234556,
234558,
316479,
234561,
316483,
160835,
234563,
308291,
234568,
234570,
316491,
234572,
300108,
234574,
300115,
234580,
234581,
242777,
234585,
275545,
234590,
234593,
234595,
234597,
300133,
234601,
300139,
234605,
160879,
234607,
275569,
234610,
316530,
300148,
234614,
398455,
144506,
234618,
234620,
275579,
234623,
226433,
234627,
275588,
234629,
242822,
234634,
234636,
177293,
234640,
275602,
234643,
308373,
226453,
234647,
275606,
275608,
234650,
308379,
324757,
300189,
324766,
119967,
234653,
324768,
283805,
234657,
242852,
300197,
234661,
283813,
234664,
275626,
234667,
316596,
308414,
234687,
300223,
300226,
308418,
234692,
300229,
308420,
308422,
283844,
226500,
300234,
283850,
300238,
300241,
316625,
300243,
300245,
316630,
300248,
300253,
300256,
300258,
300260,
234726,
300263,
300265,
300267,
161003,
300270,
300272,
120053,
300278,
275703,
316663,
300284,
275710,
300287,
292097,
300289,
161027,
300292,
300294,
275719,
234760,
177419,
300299,
242957,
300301,
283917,
177424,
349451,
275725,
349464,
415009,
283939,
259367,
292143,
283951,
300344,
226617,
243003,
226628,
300357,
283973,
177482,
283983,
316758,
357722,
316766,
316768,
292192,
218464,
292197,
316774,
243046,
218473,
284010,
136562,
324978,
275834,
333178,
275836,
275840,
316803,
316806,
226696,
316811,
226699,
316814,
226703,
300433,
234899,
300436,
226709,
357783,
316824,
316826,
144796,
300448,
144807,
144810,
144812,
144814,
227426,
144820,
374196,
284084,
292279,
284087,
144826,
144828,
144830,
144832,
144835,
144837,
38342,
144839,
144841,
144844,
144847,
144852,
144855,
103899,
300507,
333280,
218597,
292329,
300523,
259565,
300527,
308720,
259567,
292338,
226802,
316917,
292343,
308727,
300537,
316933,
316947,
308757,
308762,
284191,
284194,
284196,
235045,
284199,
284204,
284206,
284209,
284211,
194101,
284213,
316983,
194103,
284215,
308790,
284218,
226877,
292414,
284223,
284226,
284228,
292421,
226886,
284231,
128584,
243268,
284234,
366155,
317004,
276043,
284238,
226895,
284241,
194130,
284243,
300628,
284245,
292433,
284247,
317015,
235097,
243290,
276053,
284249,
284251,
300638,
284253,
284255,
243293,
284258,
292452,
292454,
284263,
177766,
284265,
292458,
284267,
292461,
284272,
284274,
284278,
292470,
276086,
292473,
284283,
276093,
284286,
292479,
284288,
292481,
284290,
325250,
284292,
292485,
325251,
276098,
284297,
317066,
284299,
317068,
284301,
276109,
284303,
284306,
276114,
284308,
284312,
284314,
284316,
276127,
284320,
284322,
284327,
284329,
317098,
284331,
276137,
284333,
284335,
284337,
284339,
300726,
284343,
284346,
284350,
358080,
276160,
284354,
358083,
284358,
276166,
358089,
284362,
276170,
284365,
276175,
284368,
276177,
284370,
358098,
284372,
317138,
284377,
276187,
284379,
284381,
284384,
358114,
284386,
358116,
276197,
317158,
358119,
284392,
325353,
358122,
284394,
358126,
276206,
358128,
358133,
358135,
276216,
358138,
300795,
358140,
284413,
358142,
358146,
317187,
284418,
317189,
317191,
284428,
300816,
300819,
317207,
284440,
300828,
300830,
276255,
300832,
325408,
300834,
317221,
227109,
358183,
186151,
276268,
300845,
243504,
300850,
284469,
276280,
325436,
358206,
276291,
366406,
276295,
300872,
292681,
153417,
358224,
284499,
276308,
178006,
317271,
284502,
276315,
292700,
317279,
284511,
227175,
292715,
292721,
284529,
300915,
284533,
292729,
317306,
284540,
292734,
325512,
169868,
276365,
317332,
358292,
284564,
399252,
350106,
284572,
276386,
284579,
276388,
358312,
317353,
284585,
292776,
276395,
292784,
276402,
358326,
161718,
358330,
276410,
276411,
276418,
276425,
301009,
301011,
301013,
292823,
358360,
301017,
301015,
292828,
276446,
153568,
276452,
292839,
276455,
350186,
292843,
276464,
178161,
227314,
325624,
350200,
317435,
276479,
276482,
350210,
276485,
317446,
178181,
276490,
350218,
292876,
350222,
317456,
276496,
317458,
178195,
243733,
243740,
317468,
317472,
325666,
243751,
292904,
276528,
178224,
243762,
309298,
325685,
325689,
235579,
325692,
235581,
178238,
276539,
276544,
243779,
325700,
292934,
243785,
350293,
350295,
309337,
194649,
227418,
350299,
350302,
227423,
350304,
178273,
309346,
194657,
194660,
350308,
309350,
309348,
292968,
309352,
309354,
301163,
350313,
350316,
227430,
301167,
276583,
350321,
276590,
284786,
276595,
350325,
252022,
227440,
350328,
292985,
301178,
350332,
292989,
301185,
292993,
350339,
317570,
317573,
350342,
350345,
350349,
301199,
317584,
325777,
350354,
350357,
350359,
350362,
350366,
276638,
284837,
153765,
350375,
350379,
350381,
350383,
350385,
350387,
350389,
350395,
350397,
350399,
227520,
350402,
227522,
301252,
350406,
227529,
301258,
309450,
276685,
309455,
276689,
309462,
301272,
276699,
194780,
309468,
309471,
301283,
317672,
317674,
325867,
243948,
194801,
309491,
309494,
243960,
276735,
227583,
227587,
276739,
211204,
276742,
227593,
227596,
325910,
309530,
342298,
211232,
317729,
276775,
211241,
325937,
325943,
211260,
260421,
285002,
276811,
235853,
276816,
235858,
276829,
276833,
391523,
276836,
293227,
276843,
293232,
276848,
186744,
211324,
285061,
366983,
317833,
178572,
285070,
178583,
227738,
317853,
276896,
317858,
342434,
285093,
317864,
285098,
276907,
235955,
276917,
293304,
293307,
293314,
309707,
293325,
129486,
317910,
293336,
235996,
317917,
293343,
358880,
276961,
227810,
293346,
276964,
293352,
236013,
293364,
301562,
293370,
317951,
309764,
301575,
121352,
293387,
236043,
342541,
317963,
113167,
55822,
309779,
317971,
309781,
55837,
227877,
227879,
293417,
227882,
309804,
293421,
105007,
236082,
285236,
23094,
277054,
244288,
219714,
129603,
301636,
318020,
301639,
301643,
277071,
285265,
309844,
277080,
309849,
285277,
285282,
326244,
318055,
277100,
309871,
121458,
277106,
170618,
170619,
309885,
309888,
277122,
227975,
277128,
285320,
301706,
318092,
326285,
334476,
318094,
277136,
277139,
227992,
318108,
285340,
318110,
227998,
137889,
383658,
285357,
318128,
277170,
293555,
318132,
342707,
154292,
277173,
277177,
277181,
318144,
277187,
277191,
277194,
277196,
277201,
342745,
137946,
342747,
113378,
203491,
228069,
277223,
342760,
56041,
285417,
56043,
56045,
277232,
228081,
56059,
310015,
285441,
310020,
285448,
310029,
228113,
285459,
277273,
293659,
326430,
285474,
293666,
228135,
318248,
277291,
318253,
293677,
285489,
301876,
293685,
285494,
301880,
285499,
301884,
310080,
293696,
277317,
277322,
293706,
277329,
162643,
310100,
301911,
277337,
301921,
400236,
236397,
162671,
326514,
310134,
236408,
15224,
277368,
416639,
416640,
113538,
310147,
416648,
39817,
187274,
277385,
301972,
424853,
277405,
277411,
310179,
293798,
293802,
236460,
277426,
276579,
293811,
293817,
293820,
203715,
326603,
342994,
276586,
293849,
293861,
228327,
228328,
318442,
228330,
228332,
326638,
277486,
351217,
318450,
293876,
293877,
285686,
302073,
121850,
293882,
302075,
285690,
244731,
293887,
277504,
277507,
277511,
293899,
277519,
293908,
302105,
293917,
293939,
318516,
277561,
277564,
310336,
7232,
293956,
277573,
228422,
293960,
310344,
277577,
277583,
203857,
293971,
310355,
310359,
236632,
277594,
138332,
277598,
203872,
277601,
285792,
310374,
203879,
310376,
228460,
318573,
203886,
187509,
285815,
367737,
285817,
302205,
285821,
392326,
285831,
294026,
302218,
285835,
162964,
384148,
187542,
302231,
285849,
302233,
285852,
302237,
285854,
285856,
302241,
285862,
277671,
302248,
64682,
277678,
294063,
294065,
302258,
277687,
294072,
318651,
294076,
277695,
318657,
244930,
302275,
130244,
302277,
228550,
302282,
310476,
302285,
302288,
310481,
302290,
203987,
302292,
302294,
310486,
302296,
384222,
310498,
285927,
318698,
302315,
195822,
228592,
294132,
138485,
204026,
228606,
204031,
64768,
310531,
285958,
138505,
228617,
318742,
204067,
130345,
277801,
113964,
277804,
384302,
285999,
285997,
277807,
113969,
277811,
318773,
318776,
277816,
286010,
277819,
294204,
417086,
277822,
286016,
302403,
294211,
384328,
277832,
277836,
294221,
146765,
294223,
326991,
277839,
277842,
277847,
277850,
179547,
277853,
277857,
302436,
277860,
294246,
327015,
310632,
327017,
351594,
277864,
277869,
277872,
351607,
310648,
277880,
310651,
277884,
277888,
310657,
351619,
294276,
310659,
327046,
277892,
253320,
310665,
318858,
277894,
277898,
277903,
310672,
351633,
277905,
277908,
277917,
310689,
277921,
130468,
277928,
277932,
310703,
277937,
310710,
130486,
310712,
277944,
310715,
277947,
302526,
228799,
277950,
277953,
302534,
310727,
245191,
64966,
163272,
277959,
277963,
302541,
277966,
302543,
310737,
277971,
228825,
277978,
310749,
277981,
277984,
310755,
277989,
277991,
187880,
277995,
310764,
286188,
278000,
228851,
310772,
278003,
278006,
40440,
212472,
278009,
40443,
286203,
310780,
40448,
228864,
286214,
302603,
65038,
302614,
302617,
286233,
302621,
286240,
146977,
187936,
187939,
40484,
294435,
40486,
286246,
294440,
40488,
294439,
294443,
40491,
294445,
278057,
310831,
245288,
286248,
40499,
40502,
212538,
40507,
40511,
40513,
228933,
327240,
40521,
286283,
40525,
40527,
212560,
400976,
228944,
40533,
147032,
40537,
40539,
40541,
278109,
40544,
40548,
40550,
40552,
286312,
40554,
286313,
310892,
40557,
40560,
188022,
122488,
294521,
343679,
294537,
310925,
286354,
278163,
302740,
278168,
179870,
327333,
229030,
212648,
278188,
302764,
278192,
319153,
278196,
302781,
319171,
302789,
294599,
278216,
294601,
302793,
343757,
212690,
319187,
286420,
278227,
229076,
286425,
319194,
278235,
278238,
229086,
286432,
294625,
294634,
302838,
319226,
286460,
278274,
302852,
278277,
302854,
294664,
311048,
319243,
311053,
302862,
319251,
294682,
278306,
188199,
294701,
319280,
278320,
319290,
229192,
302925,
188247,
188252,
237409,
294776,
360317,
294785,
327554,
360322,
40840,
40851,
294803,
188312,
294811,
237470,
319390,
40865,
319394,
294817,
294821,
311209,
180142,
343983,
188340,
40886,
319419,
294844,
294847,
237508,
393177,
294876,
294879,
294883,
393190,
294890,
311279,
278513,
237555,
311283,
278516,
237562
] |
07ed309827c2f5ca272771fc23b67b050943592d
|
64c32aa07c8d8a60fcd5161f042f795f9c971f66
|
/BeGoodToYourself/BeGoodTableViewController.swift
|
f6f842f06b335708815508e369e12e95d6b22f82
|
[] |
no_license
|
geopotosky/BGTY1
|
e613bc979d70988c2dc46e9e10e25d627ac4e081
|
180773aa3ec8a05ee8ab0c6cf16bb9c3268d1e16
|
refs/heads/master
| 2021-01-12T14:17:33.256440 | 2016-09-22T21:09:36 | 2016-09-22T21:09:36 | 68,962,307 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 13,822 |
swift
|
//
// BeGoodTableViewController.swift
// BeGoodToYourself
//
// Created by George Potosky October 2016.
// Copyright (c) 2016 GeoWorld. All rights reserved.
//
import UIKit
import CoreData
import EventKit
class BeGoodTableViewController: UIViewController, UITableViewDataSource, NSFetchedResultsControllerDelegate {
//-View Outlets
@IBOutlet weak var tableView: UITableView!
@IBOutlet weak var eventImageView: UIImageView!
//-Global objects, properties & variables
var events = [Events]()
var eventIndex: Int!
var eventIndexPath: IndexPath!
//-Flag passed to determine editing function (add or edit). This flag allows reuse of the AddEvent view
var editEventFlag: Bool!
override func viewDidLoad() {
super.viewDidLoad()
//-Create Navbar Buttons
self.navigationItem.leftBarButtonItem = self.editButtonItem
self.navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.add, target: self, action: #selector(BeGoodTableViewController.addEvent))
//-Manage Top and Bottom bar colors
//-Green Bars
self.navigationController!.navigationBar.barTintColor = UIColor(red:0.6,green:1.0,blue:0.6,alpha:1.0)
self.navigationController!.navigationBar.isTranslucent = false
self.tabBarController?.tabBar.barTintColor = UIColor(red:0.6,green:1.0,blue:0.6,alpha:1.0)
//-Add notification observer
NotificationCenter.default.addObserver(self, selector: #selector(BeGoodTableViewController.refreshList), name: NSNotification.Name(rawValue: "TodoListShouldRefresh"), object: nil)
do {
try fetchedResultsController.performFetch()
} catch _ {
}
//-Set the view controller as the delegate
fetchedResultsController.delegate = self
//-Unarchive the event when the list is first shown
self.events = NSKeyedUnarchiver.unarchiveObject(withFile: eventsFilePath) as? [Events] ?? [Events]()
//-Call the Welcome Alert
welcomeAlertMessage()
}
//-Only allow 64 events (push notification limitation)
func refreshList() {
//todoItems = TodoList.sharedInstance.allItems()
if (events.count >= 64) {
self.navigationItem.rightBarButtonItem!.isEnabled = false // disable 'add' button
}
tableView.reloadData()
}
//-Perform when view will appear
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.tabBarController?.tabBar.isHidden = false
//-Archive the graph any time this list of events is displayed.
NSKeyedArchiver.archiveRootObject(self.events, toFile: eventsFilePath)
//-Brute Force Reload the scene to view table updates
self.tableView.reloadData()
}
//-Reset the Table Edit view when the view disappears
override func viewWillDisappear(_ animated: Bool) {
resetEditing(false, animated: false)
}
//-Set Table Editing
override func setEditing(_ editing: Bool, animated: Bool) {
super.setEditing(editing, animated: animated)
self.tableView.setEditing(editing, animated: animated)
}
//-Reset the Table Edit view when the view disappears
func resetEditing(_ editing: Bool, animated: Bool) {
super.setEditing(editing, animated: animated)
self.tableView.setEditing(editing, animated: animated)
}
//-Add the "sharedContext" convenience property
lazy var sharedContext: NSManagedObjectContext = {
return CoreDataStackManager.sharedInstance().managedObjectContext!
}()
//-Fetched Results Controller
lazy var fetchedResultsController: NSFetchedResultsController<Events> = {
let fetchRequest = NSFetchRequest<Events>(entityName: "Events")
//fetchRequest.sortDescriptors = [NSSortDescriptor(key: "textEvent", ascending: true)]
fetchRequest.sortDescriptors = [NSSortDescriptor(key: "eventDate", ascending: true)]
let fetchedResultsController = NSFetchedResultsController(fetchRequest: fetchRequest,
managedObjectContext: self.sharedContext,
sectionNameKeyPath: nil,
cacheName: nil)
return fetchedResultsController
}()
//-Configure Cell
func configureCell(_ cell: UITableViewCell, withEvent event: Events) {
//-Format the Date for the cell
let dateFormatter = DateFormatter()
dateFormatter.timeStyle = DateFormatter.Style.short //Set time style
dateFormatter.dateStyle = DateFormatter.Style.medium //Set date style
//dateFormatter.timeZone = TimeZone()
//-Set the cell values for the event
let eventImage2 = event.eventImage
let finalImage = UIImage(data: eventImage2! as Data)
cell.textLabel!.text = event.textEvent
if (event.isOverdue) { // the current time is later than the to-do item's deadline
cell.detailTextLabel?.textColor = UIColor.red
} else {
cell.detailTextLabel?.textColor = UIColor.black // we need to reset this because a cell with red
}
cell.detailTextLabel!.text = dateFormatter.string(from: event.eventDate! as Date)
cell.imageView!.image = finalImage
cell.imageView!.layer.masksToBounds = true
cell.imageView!.layer.cornerRadius = 5.0
//-Lock the table image size to 45x45 with rounded corners
let itemSize: CGSize = CGSize(width: 45, height: 45)
UIGraphicsBeginImageContextWithOptions(itemSize, false, CGFloat())
let imageRect: CGRect = CGRect(x: 0.0, y: 0.0, width: itemSize.width, height: itemSize.height)
cell.imageView!.image!.draw(in: imageRect)
cell.imageView!.image = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
}
//-Table View Data Source
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
let sectionInfo = self.fetchedResultsController.sections![section]
return sectionInfo.numberOfObjects
}
//-Set the table view cell
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let CellIdentifier = "BeGoodTableCell"
let event = fetchedResultsController.object(at: indexPath)
let cell = tableView.dequeueReusableCell(withIdentifier: CellIdentifier)! as UITableViewCell
//-This is the new configureCell method
configureCell(cell, withEvent: event)
return cell
}
//-If a table entry is selected, pull up the Event Details page
func tableView(_ tableView: UITableView, didSelectRowAtIndexPath indexPath: IndexPath) {
//func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let controller =
storyboard!.instantiateViewController(withIdentifier: "BeGoodShowViewController") as! BeGoodShowViewController
controller.eventIndexPath = indexPath as IndexPath!
controller.eventIndex = (indexPath as NSIndexPath).row
self.navigationController!.pushViewController(controller, animated: true)
}
func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle,
forRowAt indexPath: IndexPath) {
switch (editingStyle) {
case .delete:
//-Get the event, then delete it from core data, delete related notifications, and remove any existing
//-Calendar Event
let event = fetchedResultsController.object(at: indexPath)
//-Delete the event notificaton
if String(describing: event.eventDate!) > String(describing: Date()) { //...if event date is greater than the current date, remove the upcoming notification. If not, skip this routine.
for notification in UIApplication.shared.scheduledLocalNotifications! as [UILocalNotification] { // loop through notifications...
if (notification.userInfo!["UUID"] as! String == String(describing: event.eventDate!)) { // ...and cancel the notification that corresponds to this TodoItem instance (matched by UUID)
UIApplication.shared.cancelLocalNotification(notification) // there should be a maximum of one match on title
break
}
}
}
//-Call Delete Calendar Event
if event.textCalendarID == nil {
print("No calendar event:", event.textCalendarID)
} else {
let eventStore = EKEventStore()
let eventID = event.textCalendarID!
let eventToRemove = eventStore.event(withIdentifier: eventID)
if (eventToRemove != nil) {
do {
try eventStore.remove(eventToRemove!, span: .thisEvent)
} catch {
print("Calender Event Removal Failed.")
}
}
}
//-Delete Main Event
sharedContext.delete(event)
CoreDataStackManager.sharedInstance().saveContext()
//-Update the Archive any time this list of events is displayed.
NSKeyedArchiver.archiveRootObject(self.events, toFile: eventsFilePath)
default:
break
}
}
func controllerWillChangeContent(_ controller: NSFetchedResultsController<NSFetchRequestResult>) {
self.tableView.beginUpdates()
}
func controller(_ controller: NSFetchedResultsController<NSFetchRequestResult>,
didChange sectionInfo: NSFetchedResultsSectionInfo,
atSectionIndex sectionIndex: Int,
for type: NSFetchedResultsChangeType) {
switch type {
case .insert:
self.tableView.insertSections(IndexSet(integer: sectionIndex), with: .fade)
case .delete:
self.tableView.deleteSections(IndexSet(integer: sectionIndex), with: .fade)
default:
return
}
}
func controller(_ controller: NSFetchedResultsController<NSFetchRequestResult>,
didChange anObject: Any,
at indexPath: IndexPath?,
for type: NSFetchedResultsChangeType,
newIndexPath: IndexPath?) {
switch type {
case .insert:
tableView.insertRows(at: [newIndexPath!], with: .fade)
case .delete:
tableView.deleteRows(at: [indexPath!], with: .fade)
case .update:
let cell = tableView.cellForRow(at: indexPath!) as UITableViewCell?
let event = controller.object(at: indexPath!) as! Events
self.configureCell(cell!, withEvent: event)
case .move:
tableView.deleteRows(at: [indexPath!], with: .fade)
tableView.insertRows(at: [newIndexPath!], with: .fade)
}
}
func controllerDidChangeContent(_ controller: NSFetchedResultsController<NSFetchRequestResult>) {
self.tableView.endUpdates()
}
//-Create a New EVent
func addEvent(){
//let storyboard = self.storyboard
let controller = self.storyboard?.instantiateViewController(withIdentifier: "BeGoodAddEventViewController") as! BeGoodAddEventViewController
controller.editEventFlag = false
self.navigationController!.pushViewController(controller, animated: true)
}
//-Saving the array Helper.
var eventsFilePath : String {
let manager = FileManager.default
let url = manager.urls(for: .documentDirectory, in: .userDomainMask).first! as URL
print(url.appendingPathComponent("events").path)
return url.appendingPathComponent("events").path
}
//-Alert Message function
func welcomeAlertMessage(){
DispatchQueue.main.async {
let actionSheetController: UIAlertController = UIAlertController(title: "Welcome!", message: "Tap the '+' symbol to create Events", preferredStyle: .alert)
//-Update alert colors and attributes
actionSheetController.view.tintColor = UIColor.blue
let subview = actionSheetController.view.subviews.first!
let alertContentView = subview.subviews.first!
//alertContentView.backgroundColor = UIColor(red:0.66,green:0.97,blue:0.59,alpha:1.0)
//alertContentView.backgroundColor = UIColor.green
alertContentView.layer.cornerRadius = 12
//-Present the AlertController
self.present(actionSheetController, animated: true, completion: nil)
}
//-After 3 second delay, close the Alert automatically
let delayTime = DispatchTime.now() + Double(Int64(2 * Double(NSEC_PER_SEC))) / Double(NSEC_PER_SEC)
DispatchQueue.main.asyncAfter(deadline: delayTime) {
self.presentedViewController!.dismiss(animated: true, completion: nil);
}
}
}
|
[
-1
] |
c382e08e9c840bc64d73bdb6707696ff81c59299
|
001f4655140ec923a532c79b9e9c9d5c2c7c221b
|
/Composer.playground/Sources/Views/MelodyCreatorView.swift
|
4c22eef83ca6c562e82e56896db5152e6723dc12
|
[] |
no_license
|
wrenliang/WWDC20-Composer
|
3eda8e3d23b3bb224434348e25f18928378ddbc8
|
b4b30aaee6704808049a99d69790c60a1cd66b0f
|
refs/heads/main
| 2022-12-31T21:30:12.124097 | 2020-10-23T07:17:23 | 2020-10-23T07:17:23 | 306,554,378 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 14,125 |
swift
|
import Foundation
import UIKit
public class MelodyCreatorView: UIView {
var titleLabel: UILabel = {
let label = UILabel()
label.translatesAutoresizingMaskIntoConstraints = false
label.text = "Tap a note to listen!"
label.font = UIFont.systemFont(ofSize: 28, weight: UIFont.Weight.heavy)
label.textColor = .white
label.textAlignment = .center
return label
}()
var noteButtons: [UIButton] = {
var buttons: [UIButton] = []
/// Note: this is the same array used for color passing in VC
let buttonColors: [UIColor] = [
UIColor(red: 1.00, green: 0.68, blue: 0.68, alpha: 1.00),
UIColor(red: 1.00, green: 0.84, blue: 0.65, alpha: 1.00),
UIColor(red: 0.99, green: 1.00, blue: 0.71, alpha: 1.00),
UIColor(red: 0.79, green: 1.00, blue: 0.75, alpha: 1.00),
UIColor(red: 0.70, green: 0.98, blue: 0.87, alpha: 1.00),
UIColor(red: 0.61, green: 0.96, blue: 1.00, alpha: 1.00),
UIColor(red: 0.63, green: 0.77, blue: 1.00, alpha: 1.00),
UIColor(red: 0.74, green: 0.70, blue: 1.00, alpha: 1.00)
]
/// Note: this is the same array used for button identification in VC
let buttonFreqs: [NoteFreq] = [
.C3, .D3, .E3, .F3, .G3, .A3, .B3, .C4
]
for i in 0..<8 {
let button = UIButton()
button.tag = i
button.setTitle(buttonFreqs[i].rawValue, for: .normal)
button.setTitleColor(UIColor(red: 0.21, green: 0.22, blue: 0.22, alpha: 1.00), for: .normal)
button.backgroundColor = buttonColors[i]
button.layer.borderColor = UIColor.white.cgColor
button.layer.borderWidth = 0
button.layer.cornerRadius = 15
buttons.append(button)
}
return buttons
}()
lazy var buttonRowOne: UIStackView = {
let stack = UIStackView()
stack.translatesAutoresizingMaskIntoConstraints = false
stack.axis = .horizontal
stack.distribution = .fillProportionally
for i in 0..<4 {
stack.addArrangedSubview(noteButtons[i])
}
return stack
}()
lazy var buttonRowTwo: UIStackView = {
let stack = UIStackView()
stack.translatesAutoresizingMaskIntoConstraints = false
stack.axis = .horizontal
stack.distribution = .fillProportionally
for i in 4..<8 {
stack.addArrangedSubview(noteButtons[i])
}
return stack
}()
var lengthSegmentControl: UISegmentedControl = {
let options = ["Quarter", "Eighth"]
let segment = UISegmentedControl(items: options)
segment.translatesAutoresizingMaskIntoConstraints = false
segment.selectedSegmentIndex = 1
return segment
}()
var addButton: UIButton = {
let button = UIButton()
button.translatesAutoresizingMaskIntoConstraints = false
button.setTitle("Add!", for: .normal)
button.setTitleColor(.white, for: .normal)
button.titleLabel?.font = UIFont.systemFont(ofSize: 20, weight: UIFont.Weight.bold)
button.backgroundColor = UIColor(red: 0.08, green: 0.46, blue: 0.68, alpha: 1.00)
button.layer.cornerRadius = 15
return button
}()
var barOneLabel: UILabel = {
let label = UILabel()
label.translatesAutoresizingMaskIntoConstraints = false
label.text = "Bar 1:"
label.font = UIFont.systemFont(ofSize: 20, weight: UIFont.Weight.bold)
label.textColor = .white
label.textAlignment = .left
return label
}()
var barOneStack: UIStackView = {
let stack = UIStackView()
stack.translatesAutoresizingMaskIntoConstraints = false
stack.axis = .horizontal
stack.distribution = .fillProportionally
return stack
}()
var barTwoLabel: UILabel = {
let label = UILabel()
label.translatesAutoresizingMaskIntoConstraints = false
label.text = "Bar 2:"
label.font = UIFont.systemFont(ofSize: 20, weight: UIFont.Weight.bold)
label.textColor = .white
label.textAlignment = .left
return label
}()
var barTwoStack: UIStackView = {
let stack = UIStackView()
stack.translatesAutoresizingMaskIntoConstraints = false
stack.axis = .horizontal
stack.distribution = .fillProportionally
return stack
}()
var barThreeLabel: UILabel = {
let label = UILabel()
label.translatesAutoresizingMaskIntoConstraints = false
label.text = "Bar 3:"
label.font = UIFont.systemFont(ofSize: 20, weight: UIFont.Weight.bold)
label.textColor = .white
label.textAlignment = .left
return label
}()
var barThreeStack: UIStackView = {
let stack = UIStackView()
stack.translatesAutoresizingMaskIntoConstraints = false
stack.axis = .horizontal
stack.distribution = .fillProportionally
return stack
}()
var saveButton: UIButton = {
let button = UIButton()
button.translatesAutoresizingMaskIntoConstraints = false
button.setTitle("Save!", for: .normal)
button.setTitleColor(.white, for: .normal)
button.titleLabel?.font = UIFont.systemFont(ofSize: 20, weight: UIFont.Weight.bold)
button.backgroundColor = UIColor(red: 0.08, green: 0.46, blue: 0.68, alpha: 1.00)
button.layer.cornerRadius = 15
return button
}()
override init(frame: CGRect) {
super.init(frame: frame)
setupView()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
private func setupView() {
self.backgroundColor = UIColor(red: 0.11, green: 0.25, blue: 0.37, alpha: 1.00)
addSubview(titleLabel)
addSubview(buttonRowOne)
addSubview(buttonRowTwo)
addSubview(lengthSegmentControl)
addSubview(addButton)
addSubview(barOneLabel)
addSubview(barOneStack)
addSubview(barTwoLabel)
addSubview(barTwoStack)
addSubview(barThreeLabel)
addSubview(barThreeStack)
addSubview(saveButton)
setupConstraints()
}
private func setupConstraints() {
// MARK: titleLabel Constraints
titleLabel.topAnchor.constraint(equalTo: safeAreaLayoutGuide.topAnchor, constant: 0).isActive = true
titleLabel.centerXAnchor.constraint(equalTo: centerXAnchor).isActive = true
titleLabel.heightAnchor.constraint(equalToConstant: 50).isActive = true
titleLabel.widthAnchor.constraint(equalTo: widthAnchor, multiplier: 1.0).isActive = true
// MARK: buttonRowOne Constraints
buttonRowOne.topAnchor.constraint(equalTo: titleLabel.bottomAnchor, constant: 10).isActive = true
buttonRowOne.centerXAnchor.constraint(equalToSystemSpacingAfter: centerXAnchor, multiplier: 1.0).isActive = true
buttonRowOne.heightAnchor.constraint(equalTo: heightAnchor, multiplier: 0.075).isActive = true
buttonRowOne.widthAnchor.constraint(equalTo: widthAnchor, multiplier: 1.0).isActive = true
// MARK: buttonRowTwo Constraints
buttonRowTwo.topAnchor.constraint(equalTo: buttonRowOne.bottomAnchor, constant: 10).isActive = true
buttonRowTwo.centerXAnchor.constraint(equalToSystemSpacingAfter: centerXAnchor, multiplier: 1.0).isActive = true
buttonRowTwo.heightAnchor.constraint(equalTo: heightAnchor, multiplier: 0.075).isActive = true
buttonRowTwo.widthAnchor.constraint(equalTo: widthAnchor, multiplier: 1.0).isActive = true
// MARK: lengthSegmentControl Constraints
lengthSegmentControl.topAnchor.constraint(equalTo: buttonRowTwo.bottomAnchor, constant: 10).isActive = true
lengthSegmentControl.centerXAnchor.constraint(equalToSystemSpacingAfter: centerXAnchor, multiplier: 1.0).isActive = true
lengthSegmentControl.heightAnchor.constraint(equalTo: heightAnchor, multiplier: 0.05).isActive = true
lengthSegmentControl.widthAnchor.constraint(equalTo: widthAnchor, multiplier: 1.0).isActive = true
// MARK: addButton Constraints
addButton.topAnchor.constraint(equalTo: lengthSegmentControl.bottomAnchor, constant: 20).isActive = true
addButton.centerXAnchor.constraint(equalToSystemSpacingAfter: centerXAnchor, multiplier: 1.0).isActive = true
addButton.heightAnchor.constraint(equalTo: heightAnchor, multiplier: 0.05).isActive = true
addButton.widthAnchor.constraint(equalTo: widthAnchor, multiplier: 0.5).isActive = true
// MARK: barOneLabel Constraints
barOneLabel.topAnchor.constraint(equalTo: addButton.bottomAnchor, constant: 10).isActive = true
barOneLabel.centerXAnchor.constraint(equalToSystemSpacingAfter: centerXAnchor, multiplier: 1.0).isActive = true
barOneLabel.heightAnchor.constraint(equalToConstant: 20).isActive = true
barOneLabel.widthAnchor.constraint(equalTo: widthAnchor, multiplier: 0.95).isActive = true
// MARK: barOneStack Constraints
barOneStack.topAnchor.constraint(equalTo: barOneLabel.bottomAnchor, constant: 0).isActive = true
barOneStack.centerXAnchor.constraint(equalToSystemSpacingAfter: centerXAnchor, multiplier: 1.0).isActive = true
barOneStack.heightAnchor.constraint(equalTo: heightAnchor, multiplier: 0.075).isActive = true
barOneStack.widthAnchor.constraint(equalTo: widthAnchor, multiplier: 1.0).isActive = true
// MARK: barTwoLabel Constraints
barTwoLabel.topAnchor.constraint(equalTo: barOneStack.bottomAnchor, constant: 10).isActive = true
barTwoLabel.centerXAnchor.constraint(equalToSystemSpacingAfter: centerXAnchor, multiplier: 1.0).isActive = true
barTwoLabel.heightAnchor.constraint(equalToConstant: 25).isActive = true
barTwoLabel.widthAnchor.constraint(equalTo: widthAnchor, multiplier: 0.95).isActive = true
// MARK: barTwoStack Constraints
barTwoStack.topAnchor.constraint(equalTo: barTwoLabel.bottomAnchor, constant: 0).isActive = true
barTwoStack.centerXAnchor.constraint(equalToSystemSpacingAfter: centerXAnchor, multiplier: 1.0).isActive = true
barTwoStack.heightAnchor.constraint(equalTo: heightAnchor, multiplier: 0.075).isActive = true
barTwoStack.widthAnchor.constraint(equalTo: widthAnchor, multiplier: 1.0).isActive = true
// MARK: barThreeLabel Constraints
barThreeLabel.topAnchor.constraint(equalTo: barTwoStack.bottomAnchor, constant: 10).isActive = true
barThreeLabel.centerXAnchor.constraint(equalToSystemSpacingAfter: centerXAnchor, multiplier: 1.0).isActive = true
barThreeLabel.heightAnchor.constraint(equalToConstant: 25).isActive = true
barThreeLabel.widthAnchor.constraint(equalTo: widthAnchor, multiplier: 0.95).isActive = true
// MARK: barThreeStack Constraints
barThreeStack.topAnchor.constraint(equalTo: barThreeLabel.bottomAnchor, constant: 0).isActive = true
barThreeStack.centerXAnchor.constraint(equalToSystemSpacingAfter: centerXAnchor, multiplier: 1.0).isActive = true
barThreeStack.heightAnchor.constraint(equalTo: heightAnchor, multiplier: 0.075).isActive = true
barThreeStack.widthAnchor.constraint(equalTo: widthAnchor, multiplier: 1.0).isActive = true
// MARK: saveButton Constraints
saveButton.bottomAnchor.constraint(equalTo: safeAreaLayoutGuide.bottomAnchor, constant: -20).isActive = true
saveButton.centerXAnchor.constraint(equalToSystemSpacingAfter: centerXAnchor, multiplier: 1.0).isActive = true
saveButton.heightAnchor.constraint(equalTo: heightAnchor, multiplier: 0.05).isActive = true
saveButton.widthAnchor.constraint(equalTo: widthAnchor, multiplier: 0.5).isActive = true
saveButton.isHidden = true
}
}
class MelodyCreatorNoteView: UIView {
public var intrinsicSize = 1.0
var titleLabel: UILabel = {
let label = UILabel()
label.translatesAutoresizingMaskIntoConstraints = false
label.textColor = .black
label.textAlignment = .center
return label
}()
var backgroundView: UIView = {
let view = UIView()
view.translatesAutoresizingMaskIntoConstraints = false
view.layer.cornerRadius = 10
view.backgroundColor = .blue
return view
}()
override init(frame: CGRect) {
super.init(frame: frame)
setupView()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
private func setupView() {
addSubview(titleLabel)
addSubview(backgroundView)
setupConstraints()
}
private func setupConstraints() {
// MARK: titleLabel Constraints
titleLabel.centerXAnchor.constraint(equalTo: centerXAnchor).isActive = true
titleLabel.centerYAnchor.constraint(equalTo: centerYAnchor).isActive = true
titleLabel.layer.zPosition = 1
// MARK: backgroundView Constraints
backgroundView.centerXAnchor.constraint(equalTo: centerXAnchor).isActive = true
backgroundView.centerYAnchor.constraint(equalTo: centerYAnchor).isActive = true
backgroundView.widthAnchor.constraint(equalTo: widthAnchor, multiplier: 0.95).isActive = true
backgroundView.heightAnchor.constraint(equalTo: heightAnchor, multiplier: 1.0).isActive = true
}
override var intrinsicContentSize: CGSize {
return CGSize(width: CGFloat(intrinsicSize), height: 1.0)
}
}
|
[
-1
] |
c961d2fbd8c04f5d0fd0d6960eb00034ab4ce402
|
9e6b278f612cc5a287d094461b5172dea2654e4e
|
/Constants.swift
|
9759f0bd729def7846178a5e097d30c99932e360
|
[] |
no_license
|
mehmetkoca/fests-of-world
|
e4725e01eb7bb7b054c4f9bec5efd3ced64c9c89
|
08758fcadf6819302bd46a47196290031cf6fbc3
|
refs/heads/master
| 2021-01-02T09:04:43.947777 | 2017-09-29T13:47:14 | 2017-09-29T13:47:14 | 99,136,200 | 1 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 213 |
swift
|
//
// Constants.swift
// SocialNotice
//
// Created by Mehmet Koca on 02/08/2017.
// Copyright © 2017 on3. All rights reserved.
//
import UIKit
let SHADOW_GRAY: CGFloat = 120.0 / 255.0
let KEY_UID = "uid"
|
[
-1
] |
7084ea91654706fd0ba2c57d80c33b5c7c9a7638
|
c6319e4ed39bc28020fb4b4f6681d77431b714e7
|
/Tumblr/Tumblr/PostTableViewCell.swift
|
537e30ac7b1e3785b8427878a6e57226633f3233
|
[
"Apache-2.0"
] |
permissive
|
hello57748/cst_495_iOS_developement
|
62529fb6d565756f5804bd0ca830c0635973bbfd
|
e62fc2f487b9cce786015d611773e66da5a3b6e4
|
refs/heads/master
| 2020-07-13T09:05:02.848308 | 2019-10-15T03:52:30 | 2019-10-15T03:52:30 | 205,052,303 | 0 | 1 | null | null | null | null |
UTF-8
|
Swift
| false | false | 542 |
swift
|
//
// PostTableViewCell.swift
// Tumblr
//
// Created by Samuel Peters on 9/15/19.
// Copyright © 2019 hello57748. All rights reserved.
//
import UIKit
class PostTableViewCell: UITableViewCell {
@IBOutlet weak var postImage: UIImageView!
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
}
|
[
317952,
431104,
384002,
337412,
328709,
206343,
241159,
241160,
333831,
227849,
196108,
203788,
34318,
34319,
34320,
372750,
372753,
372754,
227852,
196119,
328221,
305183,
345634,
345635,
243746,
356391,
199212,
305202,
292919,
310839,
289336,
310840,
123451,
314431,
327241,
254029,
327248,
215122,
215125,
339039,
281183,
340582,
302183,
213095,
348778,
340589,
115311,
302195,
340599,
230522,
410749,
403072,
100480,
300672,
135815,
131721,
100495,
373908,
373910,
155289,
139419,
131745,
131748,
148647,
228188,
327344,
313522,
313525,
166583,
313528,
313529,
313530,
313527,
379078,
279757,
273105,
295127,
388317,
131808,
131814,
131817,
249067,
375532,
249068,
249069,
271088,
271089,
167670,
49916,
379140,
271112,
271117,
298255,
225040,
298258,
276756,
312598,
320790,
302875,
67356,
336156,
261406,
336159,
336160,
336161,
336164,
245035,
287022,
337917,
110387,
380220,
399679,
300356,
157512,
302922,
430412,
283470,
283471,
283472,
283473,
380242,
418826,
287066,
287067,
287068,
287069,
336734,
287071,
37215,
265569,
350050,
317283,
270691,
350049,
355170,
336738,
330602,
317296,
308081,
112499,
113524,
317302,
177015,
262518,
216438,
244602,
233853,
226176,
233857,
211843,
225159,
302475,
227219,
334229,
334231,
155555,
337317,
276390,
311211,
258998,
276406,
282552,
155576,
299965,
306623,
299968,
306625,
306626,
317377,
349123,
317381,
317382,
323530,
323532,
323536,
430546,
430547,
358868,
384982,
180695,
180696,
358875,
358876,
384988,
346078,
155614,
384995,
196076,
302573,
167413,
167415,
310778,
305661,
201727
] |
73a9aa17e316cba4e5c1d5bb964a21d7e9e52665
|
54bd7b109d4b7b9da8b6e733fc6982a9861d827b
|
/GitRepoFind/GitRepoFind/Common/Protocol/BaseCellDelegate.swift
|
a4d126879fc68bf209b49c8958ac75bcd54caae6
|
[] |
no_license
|
1RGB1/GitRepoFind
|
f5733ddb775caea898e6f1f93166975884f18199
|
d168a081a1a5abb2199b3caca5e6c231e28ad66c
|
refs/heads/main
| 2023-08-14T15:37:04.134296 | 2021-09-22T20:21:23 | 2021-09-22T20:21:23 | 407,962,931 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 154 |
swift
|
//
// BaseCellDelegate.swift
// GitRepoFind
//
// Created by Ahmad Ragab on 20/09/2021.
//
import Foundation
protocol BaseCellDelegate: AnyObject {}
|
[
-1
] |
8ce20d93656bb25c43c605e7804f4a149b01c264
|
8ba60bed730bd3446040813296a6470fb0ddc5e5
|
/Pop/PopTableViewController.swift
|
ce5da3e5e93bced5672861eeef2e1e912aeaf62d
|
[] |
no_license
|
macjustin1/Pop
|
b3d3520c7323a00b59d4719a34abf7b8eea59419
|
a75b295b37ad68f0a48a225a5e1ab36aa5c23195
|
refs/heads/master
| 2021-01-01T03:45:09.113984 | 2016-06-01T02:07:49 | 2016-06-01T02:07:49 | 59,389,361 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 9,605 |
swift
|
//
// PopTableViewController.swift
// Pop
//
// Created by Justin Mac on 5/19/16.
// Copyright © 2016 Justin Mac. All rights reserved.
//
import UIKit
import CloudKit
class PopTableViewController: UITableViewController {
var messages = [CKRecord]()
var refresh : UIRefreshControl!
var timer : NSTimer!
var badgeCount = 0
override func viewDidLoad() {
super.viewDidLoad()
refresh = UIRefreshControl()
refresh.attributedTitle = NSAttributedString(string: "Pull to load pops")
refresh.addTarget(self, action: #selector(loadData), forControlEvents: .ValueChanged)
self.tableView.addSubview(refresh)
loadData()
timer = NSTimer.scheduledTimerWithTimeInterval(15.0, target: self, selector: #selector(loadData), userInfo: nil, repeats: true)
}
func loadData() {
messages = [CKRecord]()
let publicData = CKContainer.defaultContainer().publicCloudDatabase
let query = CKQuery(recordType: "Message", predicate: NSPredicate(format: "TRUEPREDICATE", argumentArray: nil)) //NSPredicate looks at every message type
query.sortDescriptors = [NSSortDescriptor(key: "creationDate", ascending: false)] //sort so most recent message will appear first
publicData.performQuery(query, inZoneWithID: nil, completionHandler: { (results:[CKRecord]?, error:NSError?) -> Void in
if let messages = results {
self.messages = messages
dispatch_async(dispatch_get_main_queue(), {
self.tableView.reloadData()
self.refresh.endRefreshing()
})
}
})
}
@IBAction func sendPop(sender: AnyObject) { //UIAlert to add a message
let alert = UIAlertController(title: "New Message", message: "Enter a message", preferredStyle: .Alert)
alert.addTextFieldWithConfigurationHandler {
(textField:UITextField) -> Void in
textField.placeholder = "Pop a message"
}
alert.addAction(UIAlertAction(title: "Send", style: .Default, handler: { (action:UIAlertAction) -> Void in
let textField = alert.textFields!.first!
if textField != "" {
let newMessage = CKRecord(recordType: "Message")
newMessage["content"] = textField.text
let publicData = CKContainer.defaultContainer().publicCloudDatabase
print("Created default container")
publicData.saveRecord(newMessage, completionHandler: {
(record:CKRecord?, error:NSError?) -> Void in
if error == nil {
print("Message saved")
dispatch_async(dispatch_get_main_queue(), {
self.tableView.beginUpdates() //add new message to tableView
self.messages.insert(newMessage,atIndex: 0)
let indexPath = NSIndexPath(forItem: 0, inSection: 0)
self.tableView.insertRowsAtIndexPaths([indexPath], withRowAnimation: .Top)
self.tableView.endUpdates()
})
}
else {
print(error)
print("Possibly not logged into iCloud")
}
})
}
}))
alert.addAction(UIAlertAction(title: "Cancel", style: .Cancel, handler: nil))
self.presentViewController(alert, animated: true, completion: nil)
loadData() //reload data after you add a new pop
//send out a notification to everyone alerting that there's a new pop
let publicData = CKContainer.defaultContainer().publicCloudDatabase
publicData.fetchAllSubscriptionsWithCompletionHandler() {
[unowned self] (subscriptions,error) -> Void in
if error == nil {
let subscription = CKSubscription(recordType: "Message", predicate: NSPredicate(format: "TRUEPREDICATE", argumentArray: nil), options: .FiresOnRecordCreation) //when there's a new record added to Message, send a push notification
let notification = CKNotificationInfo()
notification.alertBody = "There's a new pop!"
notification.soundName = UILocalNotificationDefaultSoundName
UIApplication.sharedApplication().applicationIconBadgeNumber + 1
notification.shouldBadge = true
subscription.notificationInfo = notification
publicData.saveSubscription(subscription, completionHandler: { (result,error) -> Void in
if error != nil {
print(error!.localizedDescription)
}
})
}
}
}
override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
return 1
}
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return messages.count
}
func getDayOfWeek(day:String)->String {
let formatter = NSDateFormatter()
formatter.dateFormat = "yyyy-MM-dd"
formatter.timeZone = NSTimeZone(abbreviation: "PT")
let today = NSDate()
let todayDate = formatter.stringFromDate(today)
if(day == todayDate) {
return "Today"
}
let dayDate = formatter.dateFromString(day)!
let myCalendar = NSCalendar(calendarIdentifier: NSCalendarIdentifierGregorian)!
let myComponents = myCalendar.components(.Weekday, fromDate: dayDate)
let weekDay = myComponents.weekday
if(weekDay == 1) {
return "Sun"
}
else if (weekDay == 2) {
return "Mon"
}
else if (weekDay == 3) {
return "Tues"
}
else if (weekDay == 4) {
return "Wed"
}
else if (weekDay == 5) {
return "Thurs"
}
else if (weekDay == 6) {
return "Fri"
}
else if (weekDay == 7) {
return "Sat"
}
else {
return "Day of week error"
}
}
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("tableViewCell", forIndexPath: indexPath) as! tableViewCell
if messages.count == 0 {
return cell
}
let message = messages[indexPath.row]
if let messageContent = message["content"] as? String { //outputs date of message creation
let dateFormat = NSDateFormatter()
dateFormat.dateFormat = "yyyy-MM-dd"
var dateString = dateFormat.stringFromDate(message.creationDate!)
dateString = getDayOfWeek(dateString) //output day of the week rather than date
let timeFormat = NSDateFormatter() //output time of creation date
timeFormat.dateFormat = "hh:mm a"
timeFormat.AMSymbol = "AM"
timeFormat.PMSymbol = "PM"
let timeString = timeFormat.stringFromDate(message.creationDate!)
cell.messageView?.text = messageContent
cell.timeLabel?.text = "\(dateString) \(timeString)"
}
return cell
}
override func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) {
if editingStyle == .Delete {
// Delete the row from the data source
let publicData = CKContainer.defaultContainer().publicCloudDatabase
let data = messages[indexPath.row]
if let message = data["content"] as? String {
let query = CKQuery(recordType: "Message", predicate: NSPredicate(format: "content == %@", message))
print("performed query")
messages.removeAtIndex(indexPath.row)
publicData.performQuery(query, inZoneWithID: nil, completionHandler: {
(results,error)-> Void in
if error == nil {
if results!.count > 0 {
let record: CKRecord! = results![0] as CKRecord
publicData.deleteRecordWithID(record.recordID, completionHandler: { (results,error) -> Void in
if error != nil {
let ac = UIAlertController(title: "Cannot Delete", message: "You can only delete your own pops", preferredStyle: .Alert)
ac.addAction(UIAlertAction(title: "OK", style: .Cancel, handler: nil))
self.presentViewController(ac, animated: true, completion: nil)
print(error)
}
})
}
}
})
}
print("deleted query")
tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation: .Fade)
} else if editingStyle == .Insert {
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
}
}
}
|
[
-1
] |
30fda6ec58141e908db759612205562bfa432643
|
e74f4cce78475b5818a1b1c718e09c843d58a36c
|
/VibrateExperiment/ViewController.swift
|
32f78e97648ebb076d3a3c3da1e390148499c97e
|
[] |
no_license
|
banane42/SwiftVibrateCreator
|
781740a27077798499455e161575fe235b18a799
|
d3cd2267260b60cdcd5d9372f6959494e1c43370
|
refs/heads/master
| 2023-01-04T07:21:33.916879 | 2020-11-03T20:25:17 | 2020-11-03T20:25:17 | 308,459,279 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 12,500 |
swift
|
//
// ViewController.swift
// VibrateExperiment
//
// Created by Griffen Morrison on 10/28/20.
// Copyright © 2020 Griffen Morrison. All rights reserved.
//
import UIKit
import CoreHaptics
class HapticViewController: UIViewController {
var engine: CHHapticEngine?
var duration: Float = 0.1
var intensity: Float = 0.0
var sharpness: Float = 0.0
var attack: Float = 0.0
var decay: Float = 0.0
var release: Float = 0.0
let viewModel = VibrationViewModel()
@IBOutlet weak var tableView: UITableView!
@IBOutlet weak var notSupportedView: UIView!
@IBOutlet weak var testButton: UIButton!
@IBOutlet weak var addButton: UIButton!
@IBOutlet weak var playButton: UIButton!
@IBOutlet weak var durationSlider: UISlider!
@IBOutlet weak var intensitySlider: UISlider!
@IBOutlet weak var sharpnessSlider: UISlider!
@IBOutlet weak var attackSlider: UISlider!
@IBOutlet weak var decaySlider: UISlider!
@IBOutlet weak var releaseSlider: UISlider!
@IBOutlet weak var durationValueLabel: UILabel!
@IBOutlet weak var intensityValueLabel: UILabel!
@IBOutlet weak var sharpnessValueLabel: UILabel!
@IBOutlet weak var attackValueLabel: UILabel!
@IBOutlet weak var decayValueLabel: UILabel!
@IBOutlet weak var releaseValueLabel: UILabel!
var i = 0
@IBAction func testButtonTapped(_ sender: Any) {
// print("intensity: \(intensity)")
// print("sharpness: \(sharpness)")
// print("attack: \(attack)")
// print("decay: \(decay)")
// print("release: \(release)")
//
// let intensityPar = CHHapticEventParameter(parameterID: .hapticIntensity, value: intensity)//0 to 1
// let sharpnessPar = CHHapticEventParameter(parameterID: .hapticSharpness, value: sharpness)//0 to 1
// let attackPar = CHHapticEventParameter(parameterID: .attackTime, value: attack) //-1 to 1
// let decayPar = CHHapticEventParameter(parameterID: .decayTime, value: decay)// -1 to 1
// let releasePar = CHHapticEventParameter(parameterID: .releaseTime, value: release)// 0 to 1
// // let sustainPar = CHHapticEventParameter(parameterID: .sustained, value: Float(true))
//
// let event = CHHapticEvent(eventType: .hapticTransient, parameters: [intensityPar, sharpnessPar, attackPar, decayPar, releasePar], relativeTime: 0)
//
// do {
// let pattern = try CHHapticPattern(events: [event], parameters: [])
// let player = try engine?.makePlayer(with: pattern)
// try player?.start(atTime: 0)
// } catch {
// print("Failed to play vibration: \(error).")
// }
switch i {
case 0:
print("Light")
let generator = UIImpactFeedbackGenerator(style: .light)
generator.impactOccurred()
case 1:
print("Medium")
let generator = UIImpactFeedbackGenerator(style: .medium)
generator.impactOccurred()
case 2:
print("Heavy")
let generator = UIImpactFeedbackGenerator(style: .heavy)
generator.impactOccurred()
case 3:
print("rigid")
let generator = UIImpactFeedbackGenerator(style: .rigid)
generator.impactOccurred()
case 4:
print("soft")
let generator = UIImpactFeedbackGenerator(style: .soft)
generator.impactOccurred()
default:
print("Out of bounds")
}
i += 1
if i > 4 {
i = 0
}
}
@IBAction func playButtonTapped(_ sender: Any) {
if let pattern = viewModel.createPattern() {
do {
let player = try engine?.makePlayer(with: pattern)
try player?.start(atTime: 0)
} catch {
print("Failed to play pattern: \(error).")
}
}
}
@IBAction func addButtonTapped(_ sender: Any) {
let newVibraiton = VibrationModel(duration: duration, intensity: intensity, sharpness: sharpness, attack: attack, decay: decay, release: release)
viewModel.add(vibration: newVibraiton)
tableView.reloadData()
}
@IBAction func durationValueChagned(_ sender: Any) {
let val = durationSlider.value
duration = val
updateValueLabel(value: val, label: durationValueLabel)
}
@IBAction func intensityValueChanged(_ sender: Any) {
let val = intensitySlider.value
intensity = val
updateValueLabel(value: val, label: intensityValueLabel)
}
@IBAction func sharpnessValueChanged(_ sender: Any) {
let val = sharpnessSlider.value
sharpness = val
updateValueLabel(value: val, label: sharpnessValueLabel)
}
@IBAction func attackValueChanged(_ sender: Any) {
let val = attackSlider.value
attack = val
updateValueLabel(value: val, label: attackValueLabel)
}
@IBAction func decayValueChanged(_ sender: Any) {
let val = decaySlider.value
decay = val
updateValueLabel(value: val, label: decayValueLabel)
}
@IBAction func releaseValueChanged(_ sender: Any) {
let val = releaseSlider.value
release = val
updateValueLabel(value: val, label: releaseValueLabel)
}
override func viewDidLoad() {
super.viewDidLoad()
tableView.backgroundColor = .white
testButton.layer.cornerRadius = 5
if configureHapticEngine() {
tableView.dataSource = self
tableView.delegate = self
} else {
notSupportedView.isHidden = false
}
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
updateValueLabel(value: durationSlider.value, label: durationValueLabel)
updateValueLabel(value: intensitySlider.value, label: intensityValueLabel)
updateValueLabel(value: sharpnessSlider.value, label: sharpnessValueLabel)
updateValueLabel(value: attackSlider.value, label: attackValueLabel)
updateValueLabel(value: decaySlider.value, label: decayValueLabel)
updateValueLabel(value: releaseSlider.value, label: releaseValueLabel)
duration = durationSlider.value
intensity = intensitySlider.value
sharpness = sharpnessSlider.value
attack = attackSlider.value
decay = decaySlider.value
release = releaseSlider.value
}
//MARK: Functions
func configureHapticEngine() -> Bool {
if CHHapticEngine.capabilitiesForHardware().supportsHaptics {
do {
engine = try CHHapticEngine()
} catch {
print("Error starting haptice engine. \(error)")
}
engine?.stoppedHandler = { reason in
print("Engine stopped for reason: \(reason.rawValue)")
}
engine?.resetHandler = { [weak self] in
print("Engine restarting...")
do {
try self?.engine?.start()
} catch {
print("Error starting haptice engine. \(error)")
}
}
engine?.notifyWhenPlayersFinished(finishedHandler: { error in
print("We done playing")
return .leaveEngineRunning
})
engine?.playsHapticsOnly = true
engine?.start(completionHandler: { error in
print("Engine started")
})
} else {
print("Cannot support haptics")
}
return CHHapticEngine.capabilitiesForHardware().supportsHaptics
}
func updateValueLabel(value: Float, label: UILabel) {
label.text = value.floatToString(digits: 2)
}
}
//MARK: TableView Delegate
extension HapticViewController: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return viewModel.vibrations.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
guard let cell = tableView.dequeueReusableCell(withIdentifier: "VibrationTableViewCell", for: indexPath) as? VibrationTableViewCell else {
fatalError()
}
cell.configure(model: viewModel.vibrations[indexPath.row])
return cell
}
func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {
let deleteAction = UIContextualAction(style: .destructive, title: nil, handler: { _, _, completionHandler in
self.viewModel.delete(index: indexPath.row)
self.tableView.reloadData()
completionHandler(true)
})
deleteAction.image = UIImage(systemName: "trash")
deleteAction.backgroundColor = .red
let configuration = UISwipeActionsConfiguration(actions: [deleteAction])
return configuration
}
}
//MARK: VibrationTableViewCell
class VibrationTableViewCell: UITableViewCell {
@IBOutlet weak var durationValueLabel: UILabel!
@IBOutlet weak var intensityValueLabel: UILabel!
@IBOutlet weak var sharpnessValueLabel: UILabel!
@IBOutlet weak var attackValueLabel: UILabel!
@IBOutlet weak var decayValueLabel: UILabel!
@IBOutlet weak var releaseValueLabel: UILabel!
func configure(model: VibrationModel) {
durationValueLabel.text = model.duration.floatToString(digits: 2)
intensityValueLabel.text = model.intensity.floatToString(digits: 2)
sharpnessValueLabel.text = model.sharpness.floatToString(digits: 2)
attackValueLabel.text = model.attack.floatToString(digits: 2)
decayValueLabel.text = model.decay.floatToString(digits: 2)
releaseValueLabel.text = model.release.floatToString(digits: 2)
}
}
//MARK: VibrationViewModel
class VibrationViewModel {
var vibrations: [VibrationModel] = []
func add(vibration: VibrationModel) {
vibrations.append(vibration)
}
func delete(index: Int) {
vibrations.remove(at: index)
}
func createPattern() -> CHHapticPattern? {
var events: [CHHapticEvent] = []
var time: Float = 0
for vibration in vibrations {
let intensityPar = CHHapticEventParameter(parameterID: .hapticIntensity, value: vibration.intensity)//0 to 1
let sharpnessPar = CHHapticEventParameter(parameterID: .hapticSharpness, value: vibration.sharpness)//0 to 1
let attackPar = CHHapticEventParameter(parameterID: .attackTime, value: vibration.attack) //-1 to 1
let decayPar = CHHapticEventParameter(parameterID: .decayTime, value: vibration.decay)// -1 to 1
let releasePar = CHHapticEventParameter(parameterID: .releaseTime, value: vibration.release)
let event = CHHapticEvent(eventType: .hapticTransient, parameters: [intensityPar, sharpnessPar, attackPar, decayPar, releasePar], relativeTime: TimeInterval(time))
time += vibration.duration
events.append(event)
}
return try? CHHapticPattern(events: events, parameters: [])
}
}
//MARK: Vibration Model
class VibrationModel {
var duration: Float = 0.1
var intensity: Float = 0.0
var sharpness: Float = 0.0
var attack: Float = 0.0
var decay: Float = 0.0
var release: Float = 0.0
init(duration: Float, intensity: Float, sharpness: Float, attack: Float, decay: Float, release: Float) {
self.duration = duration
self.intensity = intensity
self.sharpness = sharpness
self.attack = attack
self.decay = decay
self.release = release
}
}
extension Float {
func floatToString(digits: Int) -> String? {
let formatter = NumberFormatter()
formatter.maximumFractionDigits = digits
formatter.minimumFractionDigits = digits
formatter.numberStyle = .decimal
return formatter.string(for: self)
}
}
|
[
-1
] |
d2df81593da7dd62ae03543999d937135f0813c3
|
f3f29c86fc31146fa69cc29569c58b232a279375
|
/Sources/AccountTransactionApiV3p1p2Types/Models/OBStandingOrder5.swift
|
6ae38da59eb35a9f6194d51d5ace4a7e993e4f67
|
[
"Apache-2.0"
] |
permissive
|
oscarbano/open-banking-connector-swift
|
2568a3f43078efe799a3c0cebc6697e8329c9efa
|
c38b9a383fc3b6388aaa3d0fee9d546671c75ae2
|
refs/heads/master
| 2022-03-31T05:49:22.667747 | 2020-02-05T23:46:53 | 2020-02-05T23:46:53 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 3,088 |
swift
|
//
// OBStandingOrder5.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
//
import Foundation
public struct OBStandingOrder5: Codable {
public var accountId: AccountId
public var standingOrderId: StandingOrderId?
public var frequency: Frequency1
public var reference: Reference?
public var firstPaymentDateTime: FirstPaymentDateTime?
public var nextPaymentDateTime: NextPaymentDateTime?
public var finalPaymentDateTime: FinalPaymentDateTime?
public var standingOrderStatusCode: OBExternalStandingOrderStatus1Code?
public var firstPaymentAmount: OBActiveOrHistoricCurrencyAndAmount0?
public var nextPaymentAmount: OBActiveOrHistoricCurrencyAndAmount1?
public var finalPaymentAmount: OBActiveOrHistoricCurrencyAndAmount2?
public var creditorAgent: OBBranchAndFinancialInstitutionIdentification51?
public var creditorAccount: OBCashAccount50?
public var supplementaryData: OBSupplementaryData1?
public init(accountId: AccountId, standingOrderId: StandingOrderId?, frequency: Frequency1, reference: Reference?, firstPaymentDateTime: FirstPaymentDateTime?, nextPaymentDateTime: NextPaymentDateTime?, finalPaymentDateTime: FinalPaymentDateTime?, standingOrderStatusCode: OBExternalStandingOrderStatus1Code?, firstPaymentAmount: OBActiveOrHistoricCurrencyAndAmount0?, nextPaymentAmount: OBActiveOrHistoricCurrencyAndAmount1?, finalPaymentAmount: OBActiveOrHistoricCurrencyAndAmount2?, creditorAgent: OBBranchAndFinancialInstitutionIdentification51?, creditorAccount: OBCashAccount50?, supplementaryData: OBSupplementaryData1?) {
self.accountId = accountId
self.standingOrderId = standingOrderId
self.frequency = frequency
self.reference = reference
self.firstPaymentDateTime = firstPaymentDateTime
self.nextPaymentDateTime = nextPaymentDateTime
self.finalPaymentDateTime = finalPaymentDateTime
self.standingOrderStatusCode = standingOrderStatusCode
self.firstPaymentAmount = firstPaymentAmount
self.nextPaymentAmount = nextPaymentAmount
self.finalPaymentAmount = finalPaymentAmount
self.creditorAgent = creditorAgent
self.creditorAccount = creditorAccount
self.supplementaryData = supplementaryData
}
public enum CodingKeys: String, CodingKey {
case accountId = "AccountId"
case standingOrderId = "StandingOrderId"
case frequency = "Frequency"
case reference = "Reference"
case firstPaymentDateTime = "FirstPaymentDateTime"
case nextPaymentDateTime = "NextPaymentDateTime"
case finalPaymentDateTime = "FinalPaymentDateTime"
case standingOrderStatusCode = "StandingOrderStatusCode"
case firstPaymentAmount = "FirstPaymentAmount"
case nextPaymentAmount = "NextPaymentAmount"
case finalPaymentAmount = "FinalPaymentAmount"
case creditorAgent = "CreditorAgent"
case creditorAccount = "CreditorAccount"
case supplementaryData = "SupplementaryData"
}
}
|
[
-1
] |
934896c704fda527fe05a4858c069dad22eebaa3
|
26054035ce72b712c4683a7fb0678502abea87d6
|
/CoreDataAssignment/CoreDataAssignment/ViewController.swift
|
599ced92326c257ee9e5f4b9cc9e557c5ac44483
|
[] |
no_license
|
Daminiverma/Core-Data-Notes-Taking-App-
|
0334f21c8c044ac62f7355f956d336a11429c2ea
|
b8037639f5423b0d5bbc017be10994e24f1a6328
|
refs/heads/master
| 2021-01-19T10:38:45.480387 | 2017-04-11T03:44:00 | 2017-04-11T03:44:00 | 87,885,145 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,996 |
swift
|
//
// ViewController.swift
// CoreDataAssignment
//
// Created by Damini Verma on 2017-04-07.
// Copyright © 2017 Damini Verma. All rights reserved.
//
import UIKit
import CoreData
class ViewController: UIViewController {
@IBOutlet weak var noteTitle: UITextField!
@IBOutlet weak var noteDescription: UITextField!
var appDelegate:AppDelegate!
var context:NSManagedObjectContext!
// let context = (UIApplication.shared.delegate as! AppDelegate).persistentContainer.viewContext
var nNotes : List? = nil
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
appDelegate = (UIApplication.shared.delegate as! AppDelegate)
context = appDelegate.persistentContainer.viewContext
if nNotes != nil {
noteTitle.text = nNotes?.title
noteDescription.text = nNotes?.desc
}
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
@IBAction func cancelBtn(_ sender: UIBarButtonItem) {
back()
}
@IBAction func saveBtn(_ sender: UIBarButtonItem) {
if nNotes != nil{
editNote()
}
else{
newNote()
}
back()
}
func newNote()
{
let entity = NSEntityDescription.entity(forEntityName: "List", in: context)
let nNote = List(entity: entity!, insertInto: context)
nNote.title = noteTitle.text
nNote.desc = noteDescription.text
print(nNote.desc)
appDelegate.saveContext()
}
func editNote(){
nNotes?.title = noteTitle.text
nNotes?.desc = noteDescription.text
appDelegate.saveContext()
}
func back()
{
navigationController?.popViewController(animated: true)
}
}
|
[
-1
] |
16c1136c650dfc491dd4c6bb01ebad2ea3721b55
|
50a86b662a9539e884cba6cbfedc4b49a1290657
|
/eatUP/AppDelegate.swift
|
ea09fee31bc43f9a1585c30464262c982d4e27f1
|
[] |
no_license
|
marisela3205/eatUP
|
af7e974604d8dc617e5fb72a519f0b94ce16fb13
|
edc455b5eb2eb447f5c8c70e596fd74517d3e569
|
refs/heads/master
| 2020-06-21T12:18:53.204913 | 2019-07-19T20:59:13 | 2019-07-19T20:59:13 | 197,448,322 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 5,182 |
swift
|
//
// AppDelegate.swift
// eatUP
//
// Created by Apple on 7/17/19.
// Copyright © 2019 Apple. All rights reserved.
//
import UIKit
import CoreData
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
let questions = ["How much protein does your body get per day?", "How much fiber does your body get per day?", "How much calcium does your body get per day? Calcium is found in dairy, leafy greens, fish, and nuts.", "How much unsaturated fat does your body get per day?"]
let answers = [
["< 40g", "40-60g", "> 60g", "I'm not sure"],
["< 20g", "20-40g", "> 40g", "I'm not sure"],
["Low amount", "Just right", "High amount", "I'm not sure"],
["< 25g", "25-45g", "> 45g", "I'm not sure"]
]
var userAnswers = [String]()
var currentQuestion = 0
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
// Saves changes in the application's managed object context before the application terminates.
self.saveContext()
}
// MARK: - Core Data stack
lazy var persistentContainer: NSPersistentContainer = {
/*
The persistent container for the application. This implementation
creates and returns a container, having loaded the store for the
application to it. This property is optional since there are legitimate
error conditions that could cause the creation of the store to fail.
*/
let container = NSPersistentContainer(name: "eatUP")
container.loadPersistentStores(completionHandler: { (storeDescription, error) in
if let error = error as NSError? {
// Replace this implementation with code to handle the error appropriately.
// fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
/*
Typical reasons for an error here include:
* The parent directory does not exist, cannot be created, or disallows writing.
* The persistent store is not accessible, due to permissions or data protection when the device is locked.
* The device is out of space.
* The store could not be migrated to the current model version.
Check the error message to determine what the actual problem was.
*/
fatalError("Unresolved error \(error), \(error.userInfo)")
}
})
return container
}()
// MARK: - Core Data Saving support
func saveContext () {
let context = persistentContainer.viewContext
if context.hasChanges {
do {
try context.save()
} catch {
// Replace this implementation with code to handle the error appropriately.
// fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
let nserror = error as NSError
fatalError("Unresolved error \(nserror), \(nserror.userInfo)")
}
}
}
}
|
[
294405,
243717,
163848,
320008,
320014,
313360,
288275,
289300,
322580,
329747,
290326,
139803,
322080,
306721,
229411,
322083,
296483,
306726,
309287,
308266,
315435,
217132,
292907,
322092,
316465,
288306,
322102,
324663,
164408,
308281,
322109,
286783,
313409,
315457,
313413,
349765,
320582,
309832,
288329,
242250,
196177,
241746,
344661,
231000,
287323,
300124,
212571,
309342,
325220,
306790,
290409,
311914,
296043,
322666,
239726,
307310,
334446,
292466,
307315,
314995,
314487,
291450,
314491,
222846,
288383,
318599,
312970,
311444,
239252,
294038,
311449,
300194,
298662,
233638,
233644,
286896,
300208,
286389,
294070,
125111,
309439,
235200,
284352,
296641,
242371,
302787,
284360,
321228,
319181,
298709,
284374,
189654,
182486,
320730,
241371,
311516,
179420,
357083,
322272,
317665,
298210,
165091,
311525,
288489,
290025,
229098,
307436,
304365,
323310,
125167,
313073,
286455,
306424,
322299,
302332,
319228,
319231,
184576,
309505,
241410,
366339,
311043,
309509,
318728,
125194,
234763,
321806,
125201,
296218,
313116,
326434,
237858,
300836,
313125,
295716,
289577,
125226,
133421,
317233,
241971,
316726,
318264,
201530,
313660,
159549,
287038,
218943,
292159,
288578,
301893,
234828,
292172,
300882,
321364,
243032,
201051,
230748,
258397,
294238,
298844,
291169,
199020,
293741,
319342,
316788,
292212,
244598,
124796,
317821,
305022,
303999,
313215,
314241,
196988,
242050,
243072,
325509,
293767,
316300,
306576,
322448,
308114,
319900,
298910,
313250,
308132,
316327,
306605,
316334,
324015,
324017,
200625,
300979,
316339,
322998,
67000,
316345,
296888,
300987,
319932,
310718,
317888,
323520,
292288,
312772,
214980,
298950,
306632,
310733,
289744,
310740,
235994,
193498,
315359,
240098,
323555,
236008,
319465,
248299,
311789,
326640,
203761,
320498,
188913,
314357,
288246,
309243,
300540,
310782
] |
1c0b9c4cc7316f913f2027a9692f6395ae4bd79b
|
1abd8e0cbabbec7c428faee7bc436f881f478e8d
|
/WeatherCombine/SceneDelegate.swift
|
0752eb2b500f1263d4605f37f77c0158929413e2
|
[] |
no_license
|
wh1pch81n/WeatherCombine
|
369f70681f6d2f1a0ec09f4ade3ab1564e197d65
|
fba27ae0b3aaf077b415187a5073a1dd8f3b6436
|
refs/heads/master
| 2020-12-05T03:11:12.067581 | 2020-01-06T00:03:30 | 2020-01-06T00:03:30 | 231,993,423 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,349 |
swift
|
//
// SceneDelegate.swift
// WeatherCombine
//
// Created by Derrick Ho on 1/5/20.
// Copyright © 2020 Derrick Ho. All rights reserved.
//
import UIKit
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
guard let _ = (scene as? UIWindowScene) else { return }
}
func sceneDidDisconnect(_ scene: UIScene) {
// Called as the scene is being released by the system.
// This occurs shortly after the scene enters the background, or when its session is discarded.
// Release any resources associated with this scene that can be re-created the next time the scene connects.
// The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead).
}
func sceneDidBecomeActive(_ scene: UIScene) {
// Called when the scene has moved from an inactive state to an active state.
// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
}
func sceneWillResignActive(_ scene: UIScene) {
// Called when the scene will move from an active state to an inactive state.
// This may occur due to temporary interruptions (ex. an incoming phone call).
}
func sceneWillEnterForeground(_ scene: UIScene) {
// Called as the scene transitions from the background to the foreground.
// Use this method to undo the changes made on entering the background.
}
func sceneDidEnterBackground(_ scene: UIScene) {
// Called as the scene transitions from the foreground to the background.
// Use this method to save data, release shared resources, and store enough scene-specific state information
// to restore the scene back to its current state.
}
}
|
[
393221,
163849,
393228,
393231,
393251,
352294,
344103,
393260,
393269,
213049,
376890,
385082,
393277,
376906,
327757,
254032,
368728,
254045,
180322,
376932,
286845,
286851,
417925,
262284,
360598,
377003,
377013,
164029,
327872,
180418,
377030,
377037,
377047,
418008,
418012,
377063,
327915,
205037,
393457,
393461,
393466,
418044,
385281,
262405,
180491,
336140,
164107,
262417,
368913,
262423,
377118,
377121,
262437,
254253,
336181,
262455,
393539,
262473,
344404,
213333,
418135,
270687,
262497,
418145,
262501,
213354,
246124,
262508,
262512,
213374,
385420,
262551,
262553,
385441,
385444,
262567,
385452,
262574,
393649,
385460,
262587,
344512,
262593,
360917,
369119,
328180,
328183,
328190,
254463,
328193,
328207,
410129,
393748,
377372,
188959,
385571,
377384,
197160,
33322,
352822,
270905,
197178,
418364,
188990,
369224,
270922,
385610,
352844,
385617,
352865,
262761,
352875,
344694,
352888,
336513,
377473,
385671,
148106,
377485,
352919,
98969,
344745,
361130,
336556,
385714,
434868,
164535,
164539,
328379,
328387,
352969,
418508,
385743,
385749,
189154,
369382,
361196,
418555,
344832,
336644,
344837,
344843,
328462,
361231,
394002,
336660,
418581,
418586,
434971,
369436,
262943,
369439,
418591,
418594,
336676,
418600,
418606,
369464,
361274,
328516,
336709,
328520,
336712,
361289,
328523,
336715,
361300,
213848,
426842,
361307,
197469,
361310,
254813,
361318,
344936,
361323,
361335,
328574,
369544,
361361,
222129,
345036,
115661,
386004,
345046,
386012,
386019,
386023,
328690,
435188,
328703,
328710,
418822,
377867,
328715,
386070,
271382,
336922,
345119,
377888,
214060,
345134,
345139,
361525,
361537,
377931,
189525,
402523,
361568,
148580,
345200,
361591,
386168,
361594,
410746,
214150,
345224,
386187,
345247,
361645,
337072,
345268,
402615,
361657,
402636,
328925,
165086,
165092,
328933,
222438,
328942,
386286,
386292,
206084,
328967,
345377,
345380,
353572,
345383,
263464,
337207,
345400,
378170,
369979,
386366,
337230,
337235,
263509,
353634,
337252,
402792,
271731,
378232,
337278,
271746,
181639,
353674,
181644,
361869,
181650,
181655,
230810,
181671,
181674,
181679,
181682,
337330,
181687,
370105,
181691,
181697,
361922,
337350,
181704,
337366,
271841,
329192,
361961,
329195,
116211,
337399,
402943,
337416,
329227,
419341,
419345,
329234,
419351,
345626,
419357,
345631,
419360,
370208,
394787,
419363,
370214,
419369,
394796,
419377,
419386,
214594,
419401,
353868,
419404,
173648,
419408,
214611,
419412,
403040,
345702,
370298,
353920,
403076,
345737,
198282,
403085,
403092,
345750,
419484,
345758,
345763,
419492,
345766,
419498,
419502,
370351,
419507,
337588,
419510,
419513,
419518,
403139,
337607,
419528,
419531,
419536,
272083,
394967,
419543,
419545,
345819,
419548,
419551,
345829,
419560,
337643,
419564,
337647,
370416,
337671,
362249,
362252,
395022,
362256,
321300,
345888,
362274,
378664,
354107,
345916,
354112,
370504,
329545,
345932,
370510,
247639,
337751,
370520,
313181,
182110,
354143,
354157,
345965,
345968,
345971,
345975,
403321,
1914,
354173,
395148,
247692,
337809,
247701,
436127,
436133,
247720,
337834,
362414,
337845,
190393,
247760,
346064,
346069,
329699,
354275,
190440,
354314,
346140,
436290,
395340,
378956,
436307,
338005,
100454,
329833,
329853,
329857,
329868,
411806,
329886,
346273,
362661,
100525,
387250,
379067,
387261,
256193,
395467,
346317,
411862,
256214,
411865,
411869,
411874,
379108,
411877,
387303,
346344,
395496,
338154,
387307,
346350,
338161,
436474,
379135,
411905,
411917,
379154,
395539,
387350,
387353,
338201,
338212,
395567,
248112,
362823,
436556,
321880,
362844,
379234,
354674,
321911,
420237,
379279,
272787,
354728,
338353,
338382,
272849,
248279,
256474,
182755,
338404,
338411,
330225,
248309,
248332,
330254,
199189,
420377,
330268,
191012,
330320,
199250,
191069,
346722,
248427,
338544,
191093,
346743,
346769,
150184,
174775,
248505,
174778,
363198,
223936,
355025,
273109,
264919,
256735,
338665,
264942,
363252,
338680,
264965,
338701,
256787,
363294,
396067,
346917,
396070,
215854,
355123,
355141,
355144,
338764,
330581,
330585,
387929,
355167,
265056,
265059,
355176,
355180,
355185,
330612,
412600,
207809,
379849,
347082,
396246,
330711,
248794,
248799,
347106,
437219,
257009,
265208,
199681,
338951,
330761,
330769,
330775,
248863,
396329,
347178,
404526,
396337,
330803,
396340,
339002,
388155,
339010,
347208,
248905,
330827,
248915,
183384,
339037,
412765,
257121,
265321,
248952,
420985,
330890,
347288,
248986,
44199,
380071,
339118,
249018,
339133,
126148,
330959,
330966,
265433,
265438,
388320,
363757,
388348,
339199,
396552,
175376,
175397,
273709,
372016,
437553,
347442,
199989,
175416,
396601,
208189,
437567,
175425,
437571,
437576,
437584,
437588,
396634,
175451,
437596,
429408,
175458,
175461,
175464,
265581,
331124,
175478,
175487,
249215,
175491,
249219,
249225,
249228,
249235,
175514,
175517,
396703,
396706,
175523,
355749,
396723,
388543,
380353,
216518,
380364,
339406,
372177,
339414,
249303,
413143,
339418,
339421,
249310,
339425,
249313,
339429,
339435,
249329,
69114,
372229,
208399,
380433,
175637,
405017,
134689,
265779,
421442,
413251,
265796,
265806,
224854,
224858,
339553,
257636,
224871,
372328,
257647,
372338,
224885,
224888,
224891,
224895,
126597,
421509,
224905,
11919,
224911,
224914,
126611,
224917,
224920,
126618,
208539,
224923,
224927,
224930,
224933,
257705,
224939,
224943,
257713,
224949,
257717,
257721,
224954,
257725,
224960,
257733,
224966,
224970,
257740,
224976,
257745,
257748,
224982,
257752,
224987,
257762,
224996,
225000,
339696,
225013,
257788,
225021,
339711,
257791,
225027,
257796,
339722,
257802,
257805,
225039,
257808,
249617,
225044,
167701,
372500,
257815,
225049,
257820,
225054,
184096,
397089,
257825,
225059,
339748,
225068,
257837,
413485,
225071,
225074,
257843,
225077,
257846,
225080,
397113,
225083,
397116,
257853,
225088,
225094,
225097,
257869,
257872,
225105,
397140,
225109,
225113,
257881,
257884,
257887,
225120,
257891,
225128,
257897,
225138,
257909,
225142,
372598,
257914,
257917,
225150,
257922,
380803,
225156,
339845,
257927,
225166,
397201,
225171,
380823,
225176,
225183,
184245,
372698,
372704,
372707,
356336,
380919,
393215,
372739,
405534,
266295,
266298,
421961,
200786,
356440,
217180,
430181,
266351,
356467,
266365,
192640,
266375,
381069,
225425,
250003,
225430,
250008,
356507,
250012,
225439,
135328,
192674,
225442,
438434,
225445,
225448,
438441,
225451,
258223,
225456,
430257,
225459,
225462,
225468,
389309,
225472,
372931,
225476,
389322,
225485,
225488,
225491,
266454,
225494,
225497,
225500,
225503,
225506,
225511,
217319,
225515,
225519,
381177,
397572,
389381,
356638,
356641,
356644,
356647,
266537,
389417,
356650,
356656,
332081,
340276,
356662,
397623,
332091,
225599,
348489,
332107,
151884,
430422,
348503,
332118,
250203,
250211,
340328,
250217,
348523,
348528,
332153,
356734,
389503,
332158,
438657,
332162,
389507,
348548,
356741,
332175,
160152,
373146,
373149,
70048,
356783,
266688,
324032,
201158,
340452,
127473,
217590,
340473,
324095,
324100,
324103,
324112,
340501,
324118,
324122,
340512,
332325,
324134,
381483,
356908,
324141,
324143,
356917,
324150,
324156,
168509,
348734,
324161,
324165,
356935,
348745,
381513,
324171,
324174,
324177,
389724,
332381,
373344,
340580,
348777,
381546,
340628,
184983,
373399,
258723,
332455,
332460,
332464,
332473,
381626,
332484,
332487,
332494,
357070,
357074,
332512,
340724,
332534,
373499,
348926,
389927,
348979,
398141,
357202,
389971,
357208,
389979,
430940,
357212,
357215,
439138,
349041,
340850,
381815,
430967,
324473,
398202,
340859,
324476,
430973,
119675,
324479,
340863,
324482,
324485,
324488,
185226,
381834,
324493,
324496,
324499,
430996,
324502,
324511,
422817,
324514,
201638,
398246,
373672,
324525,
111539,
324534,
324539,
324542,
398280,
349129,
340942,
209874,
340958,
431073,
398307,
340964,
209896,
201712,
209904,
349173,
381947,
201724,
349181,
431100,
431107,
349203,
209944,
209948,
250917,
169002,
357419,
209966,
209969,
209973,
209976,
209980,
209988,
209991,
431180,
209996,
349268,
177238,
250968,
210011,
373853,
341094,
210026,
210028,
210032,
349296,
210037,
210042,
210045,
349309,
160896,
349313,
152704,
210053,
210056,
349320,
259217,
373905,
210068,
210072,
210078,
210081,
210085,
210089,
210096,
210100,
324792,
210108,
357571,
210116,
210128,
333010,
210132,
333016,
210139,
210144,
218355,
218361,
275709,
128254,
275713,
242947,
275717,
275723,
333075,
349460,
349486,
349492,
415034,
210261,
365912,
259423,
374113,
251236,
374118,
390518,
357756,
374161,
112021,
349591,
357793,
333222,
259516,
415168,
366035,
415187,
366039,
415192,
415194,
415197,
415200,
333285,
415208,
366057,
366064,
415217,
415225,
423424,
415258,
415264,
366118,
415271,
382503,
349739,
144940,
415279,
415282,
415286,
210488,
415291,
415295,
333396,
333400,
366173,
423529,
423533,
210547,
415354,
333440,
267910,
267929,
333472,
259789,
366301,
333535,
366308,
366312,
431852,
399086,
366319,
210673,
366322,
399092,
366326,
333566,
268042,
210700,
366349,
210707,
399129,
333595,
210720,
366384,
358192,
210740,
366388,
358201,
325441,
366403,
325447,
341831,
341839,
341844,
415574,
358235,
350046,
399200,
399208,
268144,
358256,
358260,
399222,
325494,
333690,
325505,
399244,
333709,
333725,
333737,
382891,
382898,
358348,
333777,
219094,
399318,
358372,
350190,
350194,
333819,
350204,
350207,
325633,
325637,
350214,
268299,
333838,
350225,
350232,
333851,
350238,
350241,
374819,
350245,
350249,
350252,
178221,
350257,
350260,
350272,
243782,
350281,
350286,
374865,
252021,
342134,
374904,
268435,
333998,
334012,
260299,
211161,
375027,
358645,
268553,
268560,
432406,
325920,
358701,
391469,
358705,
358714,
358717,
383307,
358738,
383331,
383334,
391531,
383342,
334204,
268669,
194942,
391564,
366991,
334224,
342431,
375209,
375220,
334263,
326087,
358857,
195041,
334306,
334312,
104940,
375279,
162289,
350724,
186898,
342546,
350740,
342551,
342555,
416294,
350762,
252463,
358962,
334397,
358973,
252483,
219719,
399957,
334425,
326240,
375401,
334466,
334469,
391813,
162446,
342680,
342685,
260767,
342711,
244410,
260798,
334530,
260802,
350918,
154318,
342737,
391895,
154329,
416476,
64231,
113389,
203508,
375541,
342777,
391938,
391949,
375569,
375572,
375575,
375580,
162592,
334633,
326444,
383794,
375613,
244542,
260925,
375616,
342857,
416599,
342875,
244572,
433001,
400238,
211826,
211832,
392061,
351102,
252801,
260993,
400260,
211846,
342921,
342931,
252823,
400279,
392092,
400286,
359335,
211885,
400307,
351169,
359362,
351172,
170950,
187335,
326599,
359367,
359383,
359389,
383968,
343018,
261109,
261112,
244728,
383999,
261130,
261148,
359452,
211999,
261155,
261160,
261166,
359471,
375868,
384099,
384102,
384108,
367724,
187503,
343155,
384115,
212095,
384136,
384140,
384144,
351382,
384152,
384158,
384161,
351399,
384169,
367795,
244917,
384182,
384189,
384192,
351424,
343232,
367817,
244938,
384202,
253132,
384209,
146644,
351450,
384225,
359650,
343272,
351467,
359660,
384247,
351480,
384250,
351483,
351492,
384270,
359695,
261391,
253202,
261395,
384276,
384284,
245021,
384290,
253218,
245032,
171304,
384299,
351535,
245042,
326970,
384324,
212296,
212304,
367966,
343394,
367981,
343410,
155000,
327035,
245121,
245128,
253321,
155021,
384398,
245137,
245143,
245146,
245149,
245152,
245155,
155045,
245158,
114093,
327090,
343478,
359867,
384444,
327108,
327112,
384457,
359887,
359891,
368093,
155103,
343535,
343540,
368120,
409092,
359948,
359951,
245295,
359984,
400977,
400982,
179803,
155241,
155255,
155274,
368289,
245410,
425639,
425652,
425663,
155328,
245463,
155352,
155356,
155364,
245477,
155372,
245487,
212723,
409336,
155394,
155404,
245528,
155423,
360224,
155439,
204592,
155444,
155448,
417596,
384829,
360262,
155463,
155477,
376665,
155484,
261982,
425823,
155488,
376672,
155492,
327532,
261997,
376686,
262000,
262003,
425846,
262006,
147319,
262009,
327542,
262012,
155517,
155523,
155526,
360327,
376715,
155532,
262028,
262031,
262034,
262037,
262040,
262043,
155550,
262046,
253854,
262049,
262052,
327590,
155560,
155563,
155566,
327613,
393152,
393170,
155604,
155620,
253924,
155622,
253927,
327655,
360432,
393204,
360439,
253944,
393209,
155647
] |
84cdd507dceceeaabcb0ef0a1b3b9ee6a332e85b
|
fd9167376549d0ed3e93c280d12eb5949782b42f
|
/GifTV/Track.swift
|
6b9ab08a6ca166f8eae4717786d5cde8861b5b19
|
[] |
no_license
|
SumeraMartin/GifTV
|
145358a82ceeba95d63f47197e9c9b4174dd6edf
|
0bbd181364afe19552daf3b3792d023706a4b357
|
refs/heads/master
| 2021-01-20T06:42:56.105204 | 2017-06-05T15:38:34 | 2017-06-05T15:38:34 | 89,913,238 | 0 | 1 | null | null | null | null |
UTF-8
|
Swift
| false | false | 516 |
swift
|
//
// Track.swift
// GifTV
//
// Created by Martin Sumera on 29/04/2017.
// Copyright © 2017 Martin Sumera. All rights reserved.
//
import Gloss
struct Track: Decodable {
let total: Int
let items: [TrackItem]
public init?(json: JSON) {
guard let total: Int = "total" <~~ json else {
return nil
}
guard let items: [TrackItem] = "items" <~~ json else {
return nil
}
self.total = total
self.items = items
}
}
|
[
-1
] |
67e1c990b8d889c2b12ef50a3e74e940dfada1ac
|
6098d338ed47a91b53a8383bd0231cdc1b0f9f93
|
/MASwifty/Classes/ConstraintLayout+Array.swift
|
58bb31e38cc36fb0e5e62ffaac49811504b4c99f
|
[
"MIT"
] |
permissive
|
aopod/MASwifty
|
050412603c0207976a518cb04e8eb09e6d842c89
|
d8874f7587660ab3cde27e3dab5cfb5ab17e0698
|
refs/heads/master
| 2020-05-19T08:34:10.191732 | 2019-05-18T04:42:42 | 2019-05-18T04:42:42 | 184,923,810 | 1 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,128 |
swift
|
//
// ConstraintLayout+Array.swift
// MASwifty
//
// Created by aopod on 2019/5/5.
//
import Foundation
import Masonry
public extension ConstraintViewArray where Element: ConstraintView {
var mas: ConstraintLayout<Array<Element>> {
return ConstraintLayout(self)
}
}
public extension ConstraintLayout where T == Array<UIView> {
@discardableResult
func makeConstraints(_ closure: (MASConstraintMaker) -> Void) -> [Constraint] {
let target = self.target as NSArray
let constraints = target.mas_makeConstraints { (make) in
guard let make = make else {
return
}
closure(make)
} as? [Constraint]
return constraints ?? []
}
@discardableResult
func updateConstraints(_ closure: (MASConstraintMaker) -> Void) -> [Constraint] {
let target = self.target as NSArray
let constraints = target.mas_updateConstraints { (make) in
guard let make = make else {
return
}
closure(make)
} as? [Constraint]
return constraints ?? []
}
@discardableResult
func remakeConstraints(_ closure: (MASConstraintMaker) -> Void) -> [Constraint] {
let target = self.target as NSArray
let constraints = target.mas_remakeConstraints { (make) in
guard let make = make else {
return
}
closure(make)
} as? [Constraint]
return constraints ?? []
}
func distribute(along axis: MASAxisType, fixedSpacing: Float, leadSpacing: Float, tailSpacing: Float) {
(target as NSArray).mas_distributeViews(along: axis, withFixedSpacing: CGFloat(fixedSpacing), leadSpacing: CGFloat(leadSpacing), tailSpacing: CGFloat(tailSpacing))
}
func distribute(along axis: MASAxisType, fixedItemLength: Float, leadSpacing: Float, tailSpacing: Float) {
(target as NSArray).mas_distributeViews(along: axis, withFixedItemLength: CGFloat(fixedItemLength), leadSpacing: CGFloat(leadSpacing), tailSpacing: CGFloat(tailSpacing))
}
}
|
[
-1
] |
9d5f8afb857f3ef8c88fe9306f4def80247dca77
|
045ad01a86650fbcf4d6039562a19d60854388bc
|
/CurrencyCalc/Global/SceneDelegate.swift
|
c4a5c76bacd81861a0713599bbdb16622e984bc7
|
[
"MIT"
] |
permissive
|
EreskinVA/CurrencyCalc
|
11f7f9458acadd7b2ff573a34b5565648cbe1410
|
99a382f5db5c538a95c0c7d09cdff157ec241843
|
refs/heads/main
| 2023-01-08T08:52:47.497350 | 2020-11-14T10:34:51 | 2020-11-14T10:34:51 | 312,131,079 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,014 |
swift
|
//
// SceneDelegate.swift
// CurrencyCalc
//
// Created by Admin on 11.11.2020.
//
import UIKit
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
guard let scene = (scene as? UIWindowScene) else { return }
let window = UIWindow(windowScene: scene)
let mainVC = MainVC()
let navVC = UINavigationController(rootViewController: mainVC)
window.rootViewController = navVC
self.window = window
window.makeKeyAndVisible()
}
func sceneDidDisconnect(_ scene: UIScene) {
// Called as the scene is being released by the system.
// This occurs shortly after the scene enters the background, or when its session is discarded.
// Release any resources associated with this scene that can be re-created the next time the scene connects.
// The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead).
}
func sceneDidBecomeActive(_ scene: UIScene) {
// Called when the scene has moved from an inactive state to an active state.
// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
}
func sceneWillResignActive(_ scene: UIScene) {
// Called when the scene will move from an active state to an inactive state.
// This may occur due to temporary interruptions (ex. an incoming phone call).
}
func sceneWillEnterForeground(_ scene: UIScene) {
// Called as the scene transitions from the background to the foreground.
// Use this method to undo the changes made on entering the background.
}
func sceneDidEnterBackground(_ scene: UIScene) {
// Called as the scene transitions from the foreground to the background.
// Use this method to save data, release shared resources, and store enough scene-specific state information
// to restore the scene back to its current state.
}
}
|
[
423424,
375297,
379915,
391691,
361490,
405017,
386074,
358942,
381483,
411691,
430130,
386102,
16444,
358973,
254020,
415301,
217158,
347208,
396874,
370254,
343631,
180314,
366173,
180322,
322660,
369254,
173170,
386168,
361599,
333440,
343168,
372354,
415362,
330886,
432272,
340639,
354975,
344736,
332455,
185512,
425639,
271018,
258223,
387250,
345268,
334012,
104636,
373450,
322763,
346317,
386259,
355029,
330966,
419543,
346340,
372977,
375027,
418555,
372481,
207620,
397572,
210696,
194829,
366349,
362274,
263464,
257834,
248112,
264502,
384831,
120129,
244552,
357710,
263509,
418135,
383323,
439138,
108386,
399208,
274281,
257902,
355185,
381815,
333176,
243584,
264585,
361869,
383375,
272787,
40358,
380333,
5040,
337330,
370611,
392129,
361922,
347082,
264661,
399318,
248799,
423393,
386023,
257021
] |
bd108a21d417ebed2d58468a06ed32853bcbb745
|
da613745aeb259fc4d6ce98827179bcb2ea8d7b7
|
/campeao_das_copas/campeao_das_copas/GamesTableViewCell.swift
|
bcaa4bc4d43ef98dfa5602a86fd86bab7045c9d8
|
[] |
no_license
|
JonatanM89/Swfit_IOS_Learn
|
4619adf8007034fb616bf28e68b165ca3e7cf162
|
5712fb4ebc5af1214fefde3398921654bccbca24
|
refs/heads/main
| 2023-03-15T15:24:09.828003 | 2021-03-08T03:10:04 | 2021-03-08T03:10:04 | 300,376,834 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 991 |
swift
|
//
// GamesTableViewCell.swift
// campeao_das_copas
//
// Created by Convidado on 09/08/20.
// Copyright © 2020 Convidado. All rights reserved.
//
import UIKit
class GamesTableViewCell: UITableViewCell {
@IBOutlet weak var lbAway: UILabel!
@IBOutlet weak var imgAway: UIImageView!
@IBOutlet weak var imgHome: UIImageView!
@IBOutlet weak var lbPlacar: UILabel!
@IBOutlet weak var lbHome: UILabel!
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
func prepare(with game:Games){
imgHome.image = UIImage(named: "\(game.home).png")
imgAway.image = UIImage(named: "\(game.away).png")
lbHome.text = game.home
lbAway.text = game.away
lbPlacar.text = game.score
}
}
|
[
-1
] |
31f39da03251575e3e80e752de0d8c6079d5d06f
|
690cc96cfbbe8f9f5e4b59b3cf3fb90a19e9c271
|
/iQuiz/QuestionView.swift
|
3f0e28b13a76331da9587198a40bef04716bf4d7
|
[] |
no_license
|
limj27/iQuiz
|
572f5db8a374d4e71bececb12a9d231614088ac1
|
d34a4988f9094838850fe37b909e8277b58396ed
|
refs/heads/main
| 2023-05-03T09:36:38.944632 | 2021-05-12T01:27:04 | 2021-05-12T01:27:04 | 364,203,523 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,196 |
swift
|
//
// QuestionView.swift
// iQuiz
//
// Created by Justin Lim on 5/6/21.
//
import SwiftUI
struct QuestionView: View {
@State var quiz: Quiz
@State var score: Score
var currIndex: Int
@State private var submit: String? = nil
@State private var answer: String = ""
var body: some View {
let question = quiz.questions[currIndex]
NavigationLink(destination: AnswerView(answer: answer, quiz: quiz, score: score, quizLength: quiz.questions.count, currIndex: currIndex), tag: "submit", selection: $submit) {
EmptyView()
}.navigationBarBackButtonHidden(true)
VStack {
Spacer()
Text("Question:").padding().font(Font.headline.bold())
Spacer()
Text(question.text).padding()
Spacer()
Picker(selection: $answer, label: Text("Choose an Answer!")) {
ForEach(question.answers, id: \.self) {
Text($0)
}
}.pickerStyle(SegmentedPickerStyle())
Spacer()
Button(action: {submit = "submit"}) {
Text("Submit").font(Font.headline.bold())
}
}
}
}
|
[
-1
] |
36ef209cfb652252f295a5c4debd847b205e6c65
|
ba2d2d233c186c98d04c96f5fc239e7e41cdccd0
|
/ChatFun/Model/StorageManagerCD.swift
|
2a195b5ecfed98b21f7e167c0db6474255a5a309
|
[] |
no_license
|
VladimirKalugin/Chat
|
a2a03215d99da86036b8131494778c20774a8acc
|
254c11bedda15f0af8e7515ecfd7b35408dc6be3
|
refs/heads/main
| 2023-06-09T11:51:57.256140 | 2021-06-30T03:52:23 | 2021-06-30T03:52:23 | 381,263,639 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,919 |
swift
|
//
// StorageManagerCD.swift
// ChatFun
//
// Created by Fuhrer_SS on 24.06.2021.
//
import Foundation
import CoreData
class StorageManager {
static let shared = StorageManager()
private init() {}
//MARK: - Core Data Stack
private var persistentContainer: NSPersistentContainer = {
let container = NSPersistentContainer(name: "ChatFun")
container.loadPersistentStores { (storeDescription, error) in
if let error = error as NSError? {
fatalError("Unresolved error \(error), \(error.userInfo)")
}
}
return container
}()
var viewContext: NSManagedObjectContext {
return persistentContainer.viewContext
}
//MARK: - Public Methods
func fetchChats() -> [Chat]? {
do {
return try viewContext.fetch(Chat.fetchRequest())
} catch let error {
print("Failed fetch data \(error)")
return nil
}
}
func fetchChat(from id: UUID) -> Chat? {
do {
guard let chats = try viewContext.fetch(Chat.fetchRequest()) as? [Chat] else { return nil }
for chat in chats {
if chat.id == id {
return chat
}
return nil
}
} catch let error {
print(error)
return nil
}
return nil
}
func fetchMessages(from chat: Chat) -> Set<Message> {
let chat = getChat(form: chat.id)
return chat?.messages ?? []
}
func createChat(messages: Set<Message>, and id: UUID = UUID()) -> Chat {
let newChat = Chat(context: viewContext)
// newChat.messages = messages
newChat.id = id
saveContext()
return newChat
}
func createMessage(chat: Chat, text: String, time: Date, isReciver: Bool) {
let newMessageCore = Message(context: viewContext)
newMessageCore.text = text
newMessageCore.time = time
newMessageCore.isReciver = isReciver
chat.lastMessageTime = time
chat.addToMessages(newMessageCore)
saveContext()
}
func delete(_ chat: Chat) {
viewContext.delete(chat)
saveContext()
}
private func getChat(form id: UUID) -> Chat? {
guard let chats = fetchChats() else { return nil }
for chat in chats {
if chat.id == id {
return chat
}
}
return nil
}
// MARK: - Core Data Saving Support
func saveContext() {
if viewContext.hasChanges {
do {
try viewContext.save()
} catch {
viewContext.rollback()
let error = error as NSError
fatalError("Unresolved error \(error), \(error.userInfo)")
}
}
}
}
|
[
-1
] |
c3eefe6d8ca47e1a3ca40608371edf835d0172a6
|
b40e191a562abdd2ca1233f03b6e8318b3f43f10
|
/Sources/EventsServer/main.swift
|
44a0616b1ce04e6229d4ac7fdd1686ea57e82a84
|
[
"MIT"
] |
permissive
|
udacity/ios-short-s3-events
|
e22919cb25eccf93ab5b07905f20dc6f4226270d
|
bd514c3e458d814be38fdea1bdb14c83a477df45
|
refs/heads/master
| 2023-04-18T16:42:05.500492 | 2021-10-21T13:34:27 | 2021-10-21T13:34:27 | 90,060,477 | 0 | 4 |
MIT
| 2022-07-06T21:25:20 | 2017-05-02T17:37:04 |
Swift
|
UTF-8
|
Swift
| false | false | 2,554 |
swift
|
import Kitura
import LoggerAPI
import HeliumLogger
import Foundation
import EventsService
import MySQL
// Disable stdout buffering (so log will appear)
setbuf(stdout, nil)
// Init logger
HeliumLogger.use(.info)
// Create connection string (use env variables, if exists)
let env = ProcessInfo.processInfo.environment
var connectionString = MySQLConnectionString(host: env["MYSQL_HOST"] ?? "127.0.0.1")
connectionString.port = Int(env["MYSQL_PORT"] ?? "3306") ?? 3306
connectionString.user = env["MYSQL_USER"] ?? "root"
connectionString.password = env["MYSQL_PASSWORD"] ?? "password"
connectionString.database = env["MYSQL_DATABASE"] ?? "game_night"
// Create connection pool
var pool = MySQLConnectionPool(connectionString: connectionString, poolSize: 10, defaultCharset: "utf8mb4")
// Create data accessor (uses pool to get connections and access data!)
var dataAccessor = EventMySQLDataAccessor(pool: pool)
// Check connection to database
if !dataAccessor.isConnected() {
Log.error("Unable to connect to MySQL database: \(connectionString)")
}
// Create handlers
let handlers = Handlers(dataAccessor: dataAccessor)
// Create router
let router = Router()
// Setup paths
router.all("/*", middleware: BodyParser())
router.all("/*", middleware: AllRemoteOriginMiddleware())
router.all("/*", middleware: LoggerMiddleware())
router.options("/*", handler: handlers.getOptions)
// GET
router.get("/*", middleware: CheckRequestMiddleware(method: .get))
router.get("/events/:id/rsvps", handler: handlers.getRSVPsForEvent)
router.get("/events/rsvps", handler: handlers.getRSVPsForUser)
router.get("/events/search", handler: handlers.getEventsBySearch)
router.get("/events/schedule", handler: handlers.getScheduledEvents)
router.get("/events/:id", handler: handlers.getSingleEvent)
router.get("/events", handler: handlers.getEvents)
// POST
router.post("/*", middleware: CheckRequestMiddleware(method: .post))
router.post("/events/:id/rsvps", handler: handlers.postRSVPsForEvent)
router.post("/events", handler: handlers.postEvent)
// PUT
router.put("/*", middleware: CheckRequestMiddleware(method: .put))
router.put("/events/:id/rsvps/:rsvp_id", handler: handlers.putRSVPForEvent)
router.put("/events/:id", handler: handlers.putEvent)
// DELETE
router.delete("/*", middleware: CheckRequestMiddleware(method: .delete))
router.delete("/events/:id", handler: handlers.deleteEvent)
// Add an HTTP server and connect it to the router
Kitura.addHTTPServer(onPort: 8080, with: router)
// Start the Kitura runloop (this call never returns)
Kitura.run()
|
[
-1
] |
8288ecb781ad9ee46118ecf8662b1ffe5bacdd6f
|
0be91cc357a5b65516ccb65bec6c027fecc5e027
|
/Weather/AppDelegate.swift
|
3005d51e22d0d8795f04a1465937d881aaa2676c
|
[] |
no_license
|
raghukv/Weather
|
c03f0582e3efdb294d97adf2753f7965375f9137
|
b115f6c40570e0af14b3360a7863e9c6aed5575c
|
refs/heads/master
| 2021-01-10T20:55:43.162628 | 2015-02-11T03:50:39 | 2015-02-11T03:50:39 | 29,219,730 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 6,109 |
swift
|
//
// AppDelegate.swift
// Weather
//
// Created by RaghuKV on 1/14/15.
// Copyright (c) 2015 RaghuKV. All rights reserved.
//
import UIKit
import CoreData
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
return true
}
func applicationWillResignActive(application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}
func applicationDidEnterBackground(application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(application: UIApplication) {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
// Saves changes in the application's managed object context before the application terminates.
self.saveContext()
}
// MARK: - Core Data stack
lazy var applicationDocumentsDirectory: NSURL = {
// The directory the application uses to store the Core Data store file. This code uses a directory named "com.weather.Weather" in the application's documents Application Support directory.
let urls = NSFileManager.defaultManager().URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask)
return urls[urls.count-1] as NSURL
}()
lazy var managedObjectModel: NSManagedObjectModel = {
// The managed object model for the application. This property is not optional. It is a fatal error for the application not to be able to find and load its model.
let modelURL = NSBundle.mainBundle().URLForResource("Weather", withExtension: "momd")!
return NSManagedObjectModel(contentsOfURL: modelURL)!
}()
lazy var persistentStoreCoordinator: NSPersistentStoreCoordinator? = {
// The persistent store coordinator for the application. This implementation creates and return a coordinator, having added the store for the application to it. This property is optional since there are legitimate error conditions that could cause the creation of the store to fail.
// Create the coordinator and store
var coordinator: NSPersistentStoreCoordinator? = NSPersistentStoreCoordinator(managedObjectModel: self.managedObjectModel)
let url = self.applicationDocumentsDirectory.URLByAppendingPathComponent("Weather.sqlite")
var error: NSError? = nil
var failureReason = "There was an error creating or loading the application's saved data."
if coordinator!.addPersistentStoreWithType(NSSQLiteStoreType, configuration: nil, URL: url, options: nil, error: &error) == nil {
coordinator = nil
// Report any error we got.
let dict = NSMutableDictionary()
dict[NSLocalizedDescriptionKey] = "Failed to initialize the application's saved data"
dict[NSLocalizedFailureReasonErrorKey] = failureReason
dict[NSUnderlyingErrorKey] = error
error = NSError(domain: "YOUR_ERROR_DOMAIN", code: 9999, userInfo: dict)
// Replace this with code to handle the error appropriately.
// abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
NSLog("Unresolved error \(error), \(error!.userInfo)")
abort()
}
return coordinator
}()
lazy var managedObjectContext: NSManagedObjectContext? = {
// Returns the managed object context for the application (which is already bound to the persistent store coordinator for the application.) This property is optional since there are legitimate error conditions that could cause the creation of the context to fail.
let coordinator = self.persistentStoreCoordinator
if coordinator == nil {
return nil
}
var managedObjectContext = NSManagedObjectContext()
managedObjectContext.persistentStoreCoordinator = coordinator
return managedObjectContext
}()
// MARK: - Core Data Saving support
func saveContext () {
if let moc = self.managedObjectContext {
var error: NSError? = nil
if moc.hasChanges && !moc.save(&error) {
// Replace this implementation with code to handle the error appropriately.
// abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
NSLog("Unresolved error \(error), \(error!.userInfo)")
abort()
}
}
}
}
|
[
283144,
277514,
277003,
280085,
278551,
278042,
276510,
281635,
194085,
277030,
228396,
277038,
223280,
278577,
280132,
282203,
189025,
292450,
285796,
279148,
278125,
285296,
40572,
227455,
278656,
228481,
276611,
226440,
278665,
280205,
225934,
188050,
278674,
276629,
283803,
278687,
282274,
277154,
278692,
226469,
228009,
287402,
227499,
278700,
278705,
276149,
278711,
279223,
278718,
283838,
228544,
279753,
229068,
160973,
227533,
164566,
201439,
278751,
226031,
157956,
203532,
181516,
277262,
276751,
278287,
278289,
321296,
276755,
278801,
284432,
278808,
278297,
282910,
282915,
281379,
226597,
280370,
277306,
278844,
280382,
282433,
277826,
164166,
226634,
276313,
278877,
280415,
277344,
276321,
227687,
279405,
278896,
277363,
275828,
281972,
278902,
280439,
276347,
228220,
213886,
279422,
278916,
293773,
284557,
191374,
288147,
214934,
277912,
276892,
278943,
282016,
230320,
230322,
281011,
286130,
277941,
283058,
276923,
278971,
282558,
299970,
280007,
288200,
284617,
287689,
286157,
281041,
283091,
282075,
294390,
282616
] |
c2d17029ae35b450e8c5e9914cee69721a82ab2b
|
5ca637e851dd287c4c288ca772d2e89e50b3868a
|
/ClassesMagicFun/Deck.swift
|
62a6ea26e06acd174d0b074fb7ca4d6564ac110d
|
[
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] |
permissive
|
brianpoole/swift-ClassesMagic-lab-swift-intro-000
|
de0e66405fd5e1e9bb4ce582b1d734cefe52b3ac
|
3339062e352eb562ae017de965f4d5a20e2bc20d
|
refs/heads/master
| 2021-01-20T02:30:32.906594 | 2017-04-26T00:56:27 | 2017-04-26T00:56:27 | 89,417,230 | 0 | 0 | null | 2017-04-25T23:51:50 | 2017-04-25T23:51:50 | null |
UTF-8
|
Swift
| false | false | 745 |
swift
|
//
// Deck.swift
// ClassesMagicFun
//
// Created by Michael Dippery on 7/29/16.
// Copyright © 2016 Flatiron School. All rights reserved.
//
import Foundation
class Deck {
var cards: [Card]
init( ){
self.cards = []
for suit in ["♠️", "♣️", "♥️", "♦️"] {
for rank in ["A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K"] {
let card = Card(suit: suit, rank: rank)
self.cards.append(card)
}
}
}
func shuffle( ){
self.cards.shuffleInPlace()
}
func drawCard() -> Card? {
if self.cards.count > 0{
return self.cards.popLast()
}
return nil
}
}
|
[
-1
] |
83f58148699d8b7e511db1193a4b683491779e2e
|
4b6eaf043381a9d5727028a00c34fe35b7d59ff6
|
/WordFall/Core/Colors.swift
|
5e45ffa2a7a3ef812e53e35b5836283ab411adf3
|
[
"Unlicense"
] |
permissive
|
ivanlisovyi/WordFall
|
5a9db8272bad861591a89b3482bff57d717850db
|
d7629aa238dfb32fab5364d5753a88515316ea66
|
refs/heads/master
| 2022-04-25T22:49:22.840798 | 2020-04-29T13:34:37 | 2020-04-29T13:34:37 | 259,932,229 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 416 |
swift
|
//
// Colors.swift
// WordFall
//
// Created by Ivan Lisovyi on 29.04.20.
// Copyright © 2020 Ivan Lisovyi. All rights reserved.
//
import UIKit
struct Colors {
static let background = UIColor(named: "Background")
static let label = UIColor(named: "PrimaryLabel")
static let primaryButton = UIColor(named: "PrimaryButton")
static let secondaryButton = UIColor(named: "SecondaryButton")
}
|
[
-1
] |
f15c01a017af8811ad64c2240c3a519b0480bf7b
|
679b494701247045514392954bd2bdb82ebe1ed3
|
/SpaceUp/AppDelegate.swift
|
2852bdf72876c1a5d8e211687d18ca10df6359ca
|
[] |
no_license
|
scdev1025/Trump
|
a5f3d8dc640f049615857fb48dab122d665778ef
|
4e341d39fbcb3f7e11be70929bbc70918e98966c
|
refs/heads/master
| 2021-05-31T15:33:12.828342 | 2016-04-13T10:00:32 | 2016-04-13T10:00:32 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,059 |
swift
|
import SpriteKit
import StoreKit
import AVFoundation
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
let paymentTransactionObserver = PaymentTransactionObserver()
var window: UIWindow?
var viewController: UIViewController?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
/*let audioSession = AVAudioSession.sharedInstance()
do {
try audioSession.setCategory(AVAudioSessionCategoryAmbient)
} catch _ {
}*/
// Payment transaction
let queue = SKPaymentQueue.defaultQueue()
queue.addTransactionObserver(paymentTransactionObserver)
return true
}
func applicationWillResignActive(application: UIApplication) {
}
func applicationDidEnterBackground(application: UIApplication) {
}
func applicationWillEnterForeground(application: UIApplication) {
}
func applicationDidBecomeActive(application: UIApplication) {
}
func applicationWillTerminate(application: UIApplication) {
}
}
|
[
-1
] |
1bca42255bc84228e2ead6c6aa697012862b0c69
|
46857eb58826d9d9c41661eaa097d378aea5dc0a
|
/Package.swift
|
08b8910c0843c3c065cd526de9b80564eca3cdc6
|
[
"MIT"
] |
permissive
|
justin747/apollo-ios
|
224460ba7b8d853ae7eca128c13d4e8543e8e30b
|
b94753230bbd3df96d0e64af59ac44e9cb31f304
|
refs/heads/main
| 2023-06-18T04:17:32.902267 | 2021-07-13T01:01:02 | 2021-07-13T03:13:02 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,620 |
swift
|
// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "Apollo",
platforms: [
.iOS(.v12),
.macOS(.v10_14),
.tvOS(.v12),
.watchOS(.v5)
],
products: [
.library(
name: "Apollo",
targets: ["Apollo"]),
.library(
name: "ApolloAPI",
targets: ["ApolloAPI"]),
.library(
name: "ApolloUtils",
targets: ["ApolloUtils"]),
.library(
name: "Apollo-Dynamic",
type: .dynamic,
targets: ["Apollo"]),
.library(
name: "ApolloCodegenLib",
targets: ["ApolloCodegenLib"]),
.library(
name: "ApolloSQLite",
targets: ["ApolloSQLite"]),
.library(
name: "ApolloWebSocket",
targets: ["ApolloWebSocket"]),
],
dependencies: [
.package(
url: "https://github.com/stephencelis/SQLite.swift.git",
.upToNextMinor(from: "0.12.2")),
.package(
url: "https://github.com/apollographql/Starscream",
.upToNextMinor(from: "3.1.2")),
.package(
url: "https://github.com/stencilproject/Stencil.git",
.upToNextMinor(from: "0.14.0")),
.package(
url: "https://github.com/apollographql/InflectorKit",
.upToNextMinor(from: "0.0.2")),
],
targets: [
.target(
name: "Apollo",
dependencies: [
"ApolloAPI",
"ApolloUtils"
],
exclude: [
"Info.plist"
]),
.target(
name: "ApolloAPI",
dependencies: [],
exclude: [
"Info.plist",
"CodegenV1"
]),
.target(
name: "ApolloUtils",
dependencies: [],
exclude: [
"Info.plist"
]),
.target(
name: "ApolloCodegenLib",
dependencies: [
"ApolloUtils",
.product(name: "InflectorKit", package: "InflectorKit"),
.product(name: "Stencil", package: "Stencil"),
],
exclude: [
"Info.plist",
"Frontend/JavaScript",
],
resources: [
.copy("Frontend/dist/ApolloCodegenFrontend.bundle.js"),
.copy("Frontend/dist/ApolloCodegenFrontend.bundle.js.map")
]),
.target(
name: "ApolloSQLite",
dependencies: [
"Apollo",
.product(name: "SQLite", package: "SQLite.swift"),
],
exclude: [
"Info.plist"
]),
.target(
name: "ApolloWebSocket",
dependencies: [
"Apollo",
"ApolloUtils",
.product(name: "Starscream", package: "Starscream"),
],
exclude: [
"Info.plist"
])
]
)
|
[
-1
] |
add59b6c6b161fdcd09c696f5921daaf8c2b9113
|
db021e3a591999411a37354c040b869547265a5c
|
/Sources/Bitpal/UI/Shared/Extensions/Rx+Operator.swift
|
5692706ce10791d265f475ebf1fa8afbf62603c9
|
[
"Apache-2.0"
] |
permissive
|
Pointwelve/Bitpal-iOS
|
735967e7c36fad4fb00ba828bae07b74458ec518
|
ac1eff918db0b28ab8990b0f7de4dee49bfe0d17
|
refs/heads/master
| 2021-07-16T11:53:29.258665 | 2020-09-13T02:18:55 | 2020-09-13T02:18:55 | 228,838,711 | 1 | 1 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,666 |
swift
|
//
// Rx+Operator.swift
// App
//
// Created by Kok Hong Choo on 9/10/17.
// Copyright © 2017 Pointwelve. All rights reserved.
//
import RxCocoa
import RxSwift
import UIKit
// Two way binding operator between control property and variable, that's all it takes {
infix operator <->: DefaultPrecedence
func nonMarkedText(_ textInput: UITextInput) -> String? {
let start = textInput.beginningOfDocument
let end = textInput.endOfDocument
guard let rangeAll = textInput.textRange(from: start, to: end),
let text = textInput.text(in: rangeAll) else {
return nil
}
guard let markedTextRange = textInput.markedTextRange else {
return text
}
guard let startRange = textInput.textRange(from: start, to: markedTextRange.start),
let endRange = textInput.textRange(from: markedTextRange.end, to: end) else {
return text
}
return (textInput.text(in: startRange) ?? "") + (textInput.text(in: endRange) ?? "")
}
@discardableResult
func <-> <Base>(textInput: TextInput<Base>, relay: BehaviorRelay<String>)
-> Disposable {
let bindToUIDisposable = relay.asObservable()
.bind(to: textInput.text)
let bindToVariable = textInput.text
.subscribe(onNext: { [weak base = textInput.base] _ in
guard let base = base else {
return
}
let nonMarkedTextValue = nonMarkedText(base)
/**
In some cases `textInput.textRangeFromPosition(start, toPosition: end)`
will return nil even though the underlying value is not nil.
This appears to be an Apple bug. If it's not, and we are doing something
wrong, please let us know.
The can be reproed easily if replace bottom code with
if nonMarkedTextValue != variable.value {
variable.value = nonMarkedTextValue ?? ""
}
and you hit "Done" button on keyboard.
*/
if let nonMarkedTextValue = nonMarkedTextValue, nonMarkedTextValue != relay.value {
relay.accept(nonMarkedTextValue)
}
}, onCompleted: {
bindToUIDisposable.dispose()
})
return Disposables.create(bindToUIDisposable, bindToVariable)
}
@discardableResult
func <-> <T>(property: ControlProperty<T>, relay: BehaviorRelay<T>) -> Disposable {
if T.self == String.self {
fatalError("")
}
let bindToUIDisposable = relay.asObservable()
.bind(to: property)
let bindToVariable = property
.subscribe(onNext: { n in
relay.accept(n)
}, onCompleted: {
bindToUIDisposable.dispose()
})
return Disposables.create(bindToUIDisposable, bindToVariable)
}
|
[
-1
] |
8ed2d004cb3b3d06d4caaddbbafd8bff0243faa7
|
f40bab3b2656754a42d1de7dac6aa335a635d0ab
|
/BankWallet/BankWallet/Modules/Restore/RestoreRouter.swift
|
e7e6d9be71149e52cd231e406b81232c2ac6e930
|
[
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
zhengweisk/unstoppable-wallet-ios
|
d9f0ebb18275ea1d3b62c17e0c6d0876cf5364c1
|
5204c5394e8608d68435030944c7292c745fb601
|
refs/heads/master
| 2022-03-06T14:12:49.758516 | 2019-07-19T11:34:16 | 2019-07-19T11:34:16 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,810 |
swift
|
import UIKit
class RestoreRouter {
weak var viewController: UIViewController?
private let delegate: IRestoreDelegate
init(delegate: IRestoreDelegate) {
self.delegate = delegate
}
}
extension RestoreRouter: IRestoreRouter {
func showRestore(defaultAccountType: DefaultAccountType, delegate: IRestoreAccountTypeDelegate) {
guard let module = RestoreRouter.module(defaultAccountType: defaultAccountType, mode: .pushed, delegate: delegate) else {
return
}
viewController?.navigationController?.pushViewController(module, animated: true)
}
func notifyRestored(account: Account) {
delegate.didRestore(account: account)
}
func close() {
viewController?.dismiss(animated: true)
}
}
extension RestoreRouter {
static func module(delegate: IRestoreDelegate) -> UIViewController {
let router = RestoreRouter(delegate: delegate)
let presenter = RestorePresenter(router: router, accountCreator: App.shared.accountCreator, predefinedAccountTypeManager: App.shared.predefinedAccountTypeManager)
let viewController = RestoreViewController(delegate: presenter)
presenter.view = viewController
router.viewController = viewController
return WalletNavigationController(rootViewController: viewController)
}
static func module(defaultAccountType: DefaultAccountType, mode: PresentationMode, delegate: IRestoreAccountTypeDelegate) -> UIViewController? {
switch defaultAccountType {
case .mnemonic: return RestoreWordsRouter.module(mode: mode, delegate: delegate)
case .eos: return RestoreEosRouter.module(mode: mode, delegate: delegate)
}
}
enum PresentationMode {
case pushed
case presented
}
}
|
[
-1
] |
29615c0938a90ce150bec9fdeea27a40488787c2
|
890d39e79bf5103c267db71bdb2df92aa353bf61
|
/lab1/PhotoViewController.swift
|
3ca96065739fe0e22b24a91416bf0c8e0afe5e4d
|
[] |
no_license
|
amv138/lab1
|
ff3fb4f364cdd1574f1834d6de7970e069b7ec46
|
46c62c6af6c10314ff73c44247e64af41553a83d
|
refs/heads/master
| 2020-04-19T21:02:05.365053 | 2019-02-06T23:44:52 | 2019-02-06T23:44:52 | 168,430,647 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 3,435 |
swift
|
//
// PhotoViewController.swift
// lab1
//
// Created by Angel Vasquez on 1/30/19.
// Copyright © 2019 codepath. All rights reserved.
//
import UIKit
import AlamofireImage
class PhotoViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {
@IBOutlet weak var tableView: UITableView!
var posts: [[String: Any]] = []
override func viewDidLoad() {
super.viewDidLoad()
tableView.delegate = self
tableView.dataSource = self
// Do any additional setup after loading the view.
// Network request snippet
let url = URL(string: "https://api.tumblr.com/v2/blog/humansofnewyork.tumblr.com/posts/photo?api_key=Q6vHoaVm5L1u2ZAW1fqv3Jw48gFzYVg9P0vH0VHl3GVy6quoGV")!
let session = URLSession(configuration: .default, delegate: nil, delegateQueue: OperationQueue.main)
session.configuration.requestCachePolicy = .reloadIgnoringLocalCacheData
let task = session.dataTask(with: url) { (data, response, error) in
if let error = error {
print(error.localizedDescription)
} else if let data = data,
let dataDictionary = try! JSONSerialization.jsonObject(with: data, options: []) as? [String: Any] {
let responseDictionary = dataDictionary["response"] as! [String: Any]
// Store the returned array of dictionaries in our posts property
self.posts = responseDictionary["posts"] as! [[String: Any]]
DispatchQueue.main.async {
self.tableView.reloadData()
}
// TODO: Get the posts and store in posts property
// TODO: Reload the table view
}
}
self.tableView.reloadData()
task.resume()
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return posts.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "PostCellTableViewCell") as! PostCellTableViewCell
let post = posts[indexPath.row]
if let photos = post["photos"] as? [[String: Any]] {
let photo = photos[0]
// 2.
let originalSize = photo["original_size"] as! [String: Any]
// 3.
let urlString = originalSize["url"] as! String
// 4.
let url = URL(string: urlString)
DispatchQueue.main.async {
cell.imageView?.af_setImage(withURL: url!)
}
}
// Configure YourCustomCell using the outlets that you've defined.
return cell
}
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
let vc = segue.destination as! PhotoDetailsViewController
let cell = sender as! UITableViewCell
let indexPath = tableView.indexPath(for: cell)!
vc.image = cell.imageView?.image
tableView.deselectRow(at: indexPath, animated: true)
}
}
|
[
-1
] |
a1e1bc9ba6128f39285adb903a624368787617e1
|
3201a1da5dc6984a3a6db23728aba9dbb1b06e7c
|
/Sources/BIKCharts/Sample/SampleCharts/LineChartSamples.swift
|
27e45e4751ca4d617c48fbd5f65b08ae3297d9b0
|
[
"MIT"
] |
permissive
|
Mrtckr008/BIKCharts
|
8bdf5b9527439ad3a1c42368626e0044278edcbf
|
60e26720ac3df25434e68822689e928e0731e5ca
|
refs/heads/main
| 2023-04-24T03:58:23.048365 | 2021-05-16T00:46:02 | 2021-05-16T00:46:02 | 367,838,541 | 1 | 0 |
MIT
| 2021-05-16T09:39:28 | 2021-05-16T09:39:28 | null |
UTF-8
|
Swift
| false | false | 893 |
swift
|
//
// LineChartSamples..swift
//
//
// Created by Berdil İlyada Karacam on 14.03.2021.
//
import SwiftUI
public struct LineChartSamples: View {
public var body: some View {
ScrollView(showsIndicators: false) {
VStack(alignment: .center, spacing: 24) {
ForEach(LineMockData().allMockModels) { (model) in
LineChart(with: model)
.frame(minWidth: 0, maxWidth: .infinity)
.frame(height: 120)
.padding()
}
}
.frame(width: UIScreen.main.bounds.width)
}
.navigationBarTitle("Line Charts", displayMode: .inline)
.padding([.bottom, .top])
}
public init() { }
}
struct LineChartSamples_Previews: PreviewProvider {
static var previews: some View {
LineChartSamples()
}
}
|
[
-1
] |
3441469f11b48e7878fb96e13382906bdc1233cb
|
404d292ee6bee85b786e2f6071d1b64de092f941
|
/CustomCamera/TwitterKitResources.bundle/CustomCameraUITests/CustomCameraUITests.swift
|
7a7ebe62158c77ebc12020c3700e8038715d88c9
|
[] |
no_license
|
AshwinECE/Loot
|
5d13c3027e932e0aa57e9ceb2bd700fbd000212a
|
7c1c45a9460084607f93f5c9b6ba881be51aefc5
|
refs/heads/master
| 2021-01-20T01:31:15.796734 | 2017-04-26T16:50:45 | 2017-04-26T16:50:45 | 89,285,768 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,268 |
swift
|
//
// CustomCameraUITests.swift
// CustomCameraUITests
//
// Created by Akshay Sampath on 2016-05-23.
// Copyright © 2016 Akshay Sampath. All rights reserved.
//
import XCTest
class CustomCameraUITests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
// In UI tests it is usually best to stop immediately when a failure occurs.
continueAfterFailure = false
// UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method.
XCUIApplication().launch()
// In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
func testExample() {
// Use recording to get started writing UI tests.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
}
|
[
333827,
182277,
243720,
282634,
313356,
155665,
305173,
237599,
241695,
282503,
223269,
354342,
315431,
229414,
102441,
354346,
278571,
315433,
325675,
313388,
282671,
102446,
229425,
124974,
243763,
241717,
180279,
215095,
229431,
319543,
213051,
288829,
325695,
286787,
288835,
307269,
237638,
313415,
239689,
233548,
311373,
315468,
196687,
278607,
311377,
354386,
280660,
223317,
315477,
368732,
180317,
323678,
315488,
321632,
280674,
45154,
280676,
313446,
227432,
233578,
194667,
307306,
278637,
288878,
319599,
278642,
284789,
284790,
131190,
288890,
215165,
131199,
227459,
194692,
280708,
235661,
278669,
333968,
241809,
323730,
311447,
153752,
327834,
284827,
329884,
278684,
299166,
278690,
233635,
311459,
215204,
333990,
284840,
299176,
184489,
284843,
323761,
184498,
278713,
223418,
180409,
295099,
299197,
227517,
280767,
258233,
280761,
299202,
139459,
309443,
176325,
338118,
131270,
299208,
227525,
301255,
280779,
227536,
282832,
301270,
229591,
280792,
301271,
147679,
311520,
147680,
325857,
356575,
280803,
307431,
338151,
182503,
319719,
295147,
317676,
286957,
125166,
125170,
395511,
313595,
184574,
309504,
125184,
217352,
125192,
125197,
194832,
227601,
125200,
319764,
278805,
338196,
125204,
334104,
282908,
311582,
299294,
282912,
233761,
278817,
125215,
211239,
282920,
334121,
317738,
325930,
311596,
338217,
125225,
321839,
336177,
315698,
98611,
125236,
282938,
278843,
127292,
168251,
287040,
319812,
311622,
280903,
227655,
323914,
201037,
383309,
282959,
229716,
250196,
289109,
379224,
168280,
323934,
391521,
239973,
381286,
285031,
416103,
313703,
280938,
242027,
242028,
321901,
278895,
354671,
287089,
250227,
199030,
227702,
315768,
139641,
291193,
223611,
291194,
313726,
311679,
291200,
211327,
240003,
158087,
313736,
227721,
242059,
311692,
106893,
227730,
285074,
240020,
190870,
315798,
190872,
291225,
285083,
317851,
293275,
227743,
242079,
285089,
289185,
283039,
293281,
156069,
305572,
289195,
375211,
311723,
377265,
334259,
338359,
299449,
319931,
311739,
293309,
278974,
336319,
311744,
317889,
291266,
336323,
278979,
129484,
326093,
278988,
281038,
281039,
283089,
278992,
289229,
283088,
279000,
176602,
242138,
285152,
291297,
369121,
160224,
279009,
188899,
279014,
195044,
319976,
279017,
311787,
334315,
281071,
319986,
236020,
279030,
311800,
293368,
279033,
317949,
322396,
283138,
279042,
233987,
287237,
324098,
334345,
309770,
340489,
342537,
279053,
322057,
283154,
303635,
279060,
279061,
182802,
303634,
279066,
322077,
291359,
342560,
370122,
293420,
289328,
283185,
279092,
234037,
23093,
244279,
244280,
340539,
338491,
301635,
309831,
55880,
322119,
377419,
303693,
281165,
301647,
281170,
326229,
115287,
189016,
244311,
309847,
332379,
111197,
295518,
287327,
283431,
242274,
244326,
277095,
279143,
279150,
281200,
287345,
313970,
301688,
189054,
303743,
287359,
291455,
297600,
301702,
311944,
334473,
344714,
279176,
316044,
311948,
311950,
326288,
311953,
316048,
287379,
336531,
295575,
227991,
289435,
303772,
221853,
205469,
323335,
285348,
314020,
340645,
279207,
295591,
176810,
295598,
248494,
279215,
293552,
285362,
299698,
279218,
164532,
166581,
342705,
285360,
287412,
303802,
314043,
287418,
154295,
66243,
291529,
287434,
225996,
363212,
287438,
135888,
242385,
279249,
303826,
369365,
369366,
279253,
158424,
299737,
230105,
322269,
338658,
295653,
342757,
289511,
230120,
234216,
330473,
285419,
330476,
289517,
312046,
215790,
279278,
170735,
125683,
230133,
199415,
342775,
234233,
242428,
279293,
205566,
289534,
35584,
299777,
322302,
228099,
285443,
375552,
291584,
291591,
295688,
322312,
346889,
285450,
312076,
326413,
285457,
295698,
166677,
291605,
207639,
283418,
285467,
221980,
281378,
234276,
336678,
318247,
262952,
262953,
279337,
318251,
289580,
262957,
293673,
164655,
328495,
301872,
234290,
303921,
285493,
230198,
285496,
301883,
342846,
281407,
289599,
222017,
295745,
201534,
293702,
318279,
283466,
281426,
279379,
244569,
234330,
281434,
295769,
201562,
230238,
230239,
275294,
279393,
293729,
357219,
281444,
303973,
279398,
351078,
301919,
349025,
177002,
308075,
242540,
310132,
295797,
201590,
295799,
228214,
207735,
177018,
279418,
269179,
336765,
308093,
314240,
291713,
158594,
330627,
340865,
240517,
228232,
299912,
320394,
279434,
316299,
252812,
234382,
308111,
189327,
308113,
416649,
293780,
310166,
289691,
209820,
240543,
283551,
310177,
289699,
189349,
289704,
279465,
293801,
326571,
177074,
304050,
326580,
289720,
326586,
289723,
189373,
213956,
359365,
19398,
345030,
281541,
127945,
211913,
279499,
213961,
56270,
191445,
304086,
183254,
207839,
340960,
142309,
234469,
314343,
123880,
340967,
304104,
324587,
234476,
289773,
203758,
248815,
320495,
320492,
287730,
240631,
312313,
214009,
201721,
312317,
234499,
418819,
293894,
330759,
320520,
230411,
322571,
330766,
320526,
234513,
238611,
293911,
140311,
316441,
197658,
326684,
336930,
132140,
113710,
281647,
189487,
322609,
318515,
312372,
203829,
238646,
300087,
238650,
320571,
21567,
308288,
160834,
336962,
314437,
349254,
238663,
300109,
207954,
234578,
250965,
205911,
339031,
296023,
314458,
156763,
234588,
281698,
281699,
285795,
230500,
250982,
322664,
228457,
279659,
318571,
234606,
230514,
300147,
312435,
238706,
187508,
279666,
302202,
285819,
292901,
314493,
285823,
150656,
234626,
279686,
222344,
285833,
285834,
234635,
228492,
318602,
337037,
177297,
187539,
347286,
308375,
324761,
285850,
296091,
119965,
234655,
302239,
300192,
339106,
306339,
234662,
300200,
249003,
302251,
3243,
208044,
322733,
238764,
324790,
300215,
294075,
64699,
228541,
339131,
343230,
283841,
148674,
283846,
312519,
283849,
148687,
290001,
189651,
316628,
279766,
189656,
339167,
310496,
298209,
304353,
279775,
279780,
304352,
228587,
279789,
290030,
302319,
316661,
234741,
208123,
279803,
292092,
228608,
234756,
322826,
242955,
312588,
177420,
318732,
126229,
318746,
320795,
320802,
130342,
304422,
130344,
130347,
292145,
298290,
208179,
312628,
345398,
300342,
159033,
222523,
286012,
279872,
181568,
193858,
294210,
279874,
216387,
300354,
372039,
300355,
304457,
230730,
345418,
337228,
296269,
234830,
222542,
238928,
294220,
296274,
331091,
150868,
314708,
283990,
224591,
357720,
318804,
300378,
300379,
314711,
294236,
316764,
314721,
292194,
230757,
281958,
314727,
134504,
306541,
327023,
234864,
296304,
312688,
316786,
230772,
314740,
327030,
284015,
314742,
310650,
224637,
306558,
290176,
337280,
243073,
314752,
179586,
306561,
294278,
296328,
296330,
298378,
318860,
314765,
368012,
304523,
9618,
112019,
279955,
306580,
234902,
292242,
282008,
224662,
314776,
314771,
318876,
282013,
290206,
343457,
148899,
314788,
298406,
282023,
245160,
279979,
279980,
241067,
314797,
286128,
173492,
279988,
286133,
284086,
259513,
284090,
310714,
228796,
302523,
54719,
302530,
292291,
228804,
310725,
306630,
280003,
300488,
306634,
300490,
310731,
234957,
339403,
337359,
329168,
312785,
222674,
329170,
302539,
310735,
280020,
280025,
310747,
239069,
144862,
286176,
187877,
310758,
320997,
280042,
280043,
191980,
300526,
329198,
337391,
282097,
308722,
296434,
306678,
40439,
288248,
191991,
286201,
300539,
288252,
210429,
359931,
312830,
290304,
245249,
228868,
323079,
218632,
292359,
302602,
323083,
230922,
294413,
359949,
304655,
323088,
329231,
282132,
302613,
316951,
175640,
374297,
282135,
302620,
222754,
306730,
312879,
230960,
288305,
239159,
290359,
323132,
235069,
157246,
130622,
288319,
288322,
280131,
349764,
282182,
194118,
288328,
292424,
292426,
286281,
124486,
333389,
224848,
349780,
230999,
290391,
306777,
128600,
196184,
235096,
212574,
345697,
204386,
300643,
300645,
282214,
312937,
204394,
224874,
243306,
312941,
138862,
206447,
310896,
294517,
314997,
288377,
290425,
339579,
337533,
325246,
333438,
235136,
280193,
282244,
239238,
288391,
282248,
286344,
323208,
179853,
286351,
188049,
229011,
239251,
280217,
323226,
179868,
229021,
302751,
198304,
282272,
245413,
282279,
298664,
212649,
317102,
286387,
300725,
286392,
302778,
306875,
280252,
280253,
282302,
323262,
286400,
321217,
296636,
323265,
280259,
282309,
239305,
296649,
280266,
212684,
306891,
302798,
9935,
241360,
282321,
313042,
286419,
333522,
241366,
280279,
278232,
282330,
278237,
280285,
294621,
282336,
278241,
325345,
321250,
294629,
153318,
337638,
333543,
181992,
12009,
282347,
288492,
282349,
323315,
67316,
34547,
286457,
284410,
313082,
288508,
200444,
282366,
286463,
319232,
288515,
249606,
282375,
280326,
284425,
300810,
116491,
216844,
280333,
284430,
282379,
300812,
161553,
124691,
278292,
118549,
116502,
282390,
284436,
278294,
325403,
321308,
321309,
341791,
241440,
282401,
339746,
282399,
186148,
186149,
216868,
241447,
315172,
333609,
294699,
284460,
280367,
300849,
282418,
280373,
282424,
280377,
319289,
321338,
282428,
280381,
345918,
413500,
241471,
280386,
325444,
280391,
153416,
315209,
325449,
159563,
280396,
307024,
325460,
237397,
341846,
18263,
317268,
241494,
188250,
284508,
300893,
307038,
370526,
237411,
284515,
276326,
282471,
296807,
292713,
282476,
292719,
313200,
296815,
325491,
313204,
317305,
317308,
339840,
315265,
280451,
325508,
327556,
333700,
188293,
315272,
243592,
305032,
315275,
67464,
325514,
350091,
184207,
350092,
311183,
282517,
294806,
350102,
214936,
294808,
337816,
239515,
333727,
298912,
319393,
214943,
294820,
118693,
219046,
333734,
294824,
298921,
284584,
313257,
292783,
126896,
300983,
343993,
288698,
98240,
294849,
214978,
280517,
280518,
214983,
282572,
282573,
153553,
24531,
231382,
323554,
292835,
190437,
292838,
294887,
317416,
174058,
278507,
313322,
311277,
296942,
298987,
124912,
327666,
278515,
325620,
239610
] |
58d8ce0ba48f93677414d3b4b51c7aff353da4bd
|
e274b2072294fc817c629e94a79006dccc90051e
|
/ApprovalTests.Swift/Reporters/ReportMoveCommandToConsole.swift
|
c429aaee4e29694b710f00ba3ddb8b5a91b167d2
|
[
"Apache-2.0"
] |
permissive
|
approvals/ApprovalTests.Swift
|
d6d98d4f08ed0225e2ea1ef0a86ea4055f325c25
|
afe39b0c667fde0250efb3b45aee4f36e143d890
|
refs/heads/master
| 2023-05-02T00:11:34.379000 | 2023-03-12T22:12:17 | 2023-03-12T22:12:17 | 151,502,720 | 79 | 14 |
Apache-2.0
| 2023-09-04T14:46:39 | 2018-10-04T01:19:31 |
Swift
|
UTF-8
|
Swift
| false | false | 818 |
swift
|
/**
A reporter that creates a command line `mv` command for approving the last failed test, and prints it on the console.
*/
public class ReportMoveCommandToConsole: EquatableFailureReporter {
override public init() {}
override public func isEqualTo(_ other: ApprovalFailureReporter) -> Bool {
other is ReportMoveCommandToConsole
}
override public func report(received: String,
approved: String,
file _: StaticString,
line _: UInt) -> Bool
{
print(HelpMessages.lineSeparator)
print("To approve:\n")
print(ReportMoveCommandToClipboard.makeCommandLineMove(received: received, approved: approved))
print(HelpMessages.lineSeparator)
return true
}
}
|
[
-1
] |
a51dc8816cc04a43d5ad45284214d65d5e01d055
|
2eee6e1c6c1bde00a606ee76dd435afd4cf03125
|
/App/Judou/Judou/AppEntrance/Function/JSVariableMenu/JSVariableMenuControl.swift
|
171a38df28be65742a49801060c7b12cf6f99fa0
|
[
"MIT"
] |
permissive
|
doubletcjs/Judou
|
ff5c7641fdd2f5e493ed8493f9f680b83e48833b
|
bf3951bfe6ccf8e1145539ae0ba8c50ec248a212
|
refs/heads/master
| 2020-04-16T12:35:09.178536 | 2019-03-07T04:09:02 | 2019-03-07T04:09:02 | 165,586,185 | 3 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,949 |
swift
|
//
// JSVariableMenuControl.swift
// Judou
//
// Created by 4work on 2018/12/13.
// Copyright © 2018 Sam Cooper Studio. All rights reserved.
//
import UIKit
typealias VariableMenuHandleBlock = (_ inUseTitles: [String], _ unUseTitles: [String]) -> Void
class JSVariableMenuControl: NSObject {
private var nav: UINavigationController!
private var variableMenu: JSVariableMenuView!
private var handle: VariableMenuHandleBlock?
private var blurEffectView: UIVisualEffectView!
var screenShot: UIImage!
override init() {
super.init()
variableMenu = JSVariableMenuView.init(frame: UIScreen.main.bounds)
nav = UINavigationController.init(rootViewController: UIViewController())
nav.topViewController?.title = "频道管理"
nav.topViewController?.view = variableMenu
nav.topViewController?.navigationItem.rightBarButtonItem = UIBarButtonItem.init(barButtonSystemItem: UIBarButtonItem.SystemItem.stop, target: self, action: #selector(self.backMethod))
}
@objc private func backMethod() -> Void {
UIView.animate(withDuration: UIApplication.shared.statusBarOrientationAnimationDuration, animations: {
var frame: CGRect = self.nav.view.frame
frame.origin.y = -self.nav.view.bounds.size.height
self.nav.view.frame = frame
}) { (finish) in
self.nav.view.removeFromSuperview()
}
if handle != nil {
handle!(variableMenu.inUseTitles, variableMenu.unUseTitles)
}
}
func showChannelViewWith(inUseTitles: [String], unUseTitles: [String], fixedNum: Int, completionHandler: VariableMenuHandleBlock?) -> Void {
handle = completionHandler
variableMenu.inUseTitles = inUseTitles
variableMenu.unUseTitles = unUseTitles
variableMenu.fixedNum = fixedNum
variableMenu.reloadData()
var frame: CGRect = nav.view.frame
frame.origin.y = -nav.view.bounds.size.height
nav.view.frame = frame
nav.view.alpha = 0
variableMenu.backgroundColor = UIColor.init(patternImage: screenShot)
if blurEffectView == nil {
let blurEffect = UIBlurEffect.init(style: .light)
blurEffectView = UIVisualEffectView.init(effect: blurEffect)
blurEffectView.frame = CGRect.init(x: 0, y: 0, width: variableMenu.bounds.size.width, height: variableMenu.bounds.size.height)~
} else {
blurEffectView.removeFromSuperview()
}
variableMenu.insertSubview(blurEffectView, at: 0)
UIApplication.shared.keyWindow?.addSubview(nav.view)
UIView.animate(withDuration: UIApplication.shared.statusBarOrientationAnimationDuration, animations: {
self.nav.view.alpha = 1
self.nav.view.frame = UIScreen.main.bounds
})
}
}
|
[
-1
] |
f159b5e002db7ef11988d45fff545b2512a69043
|
b90fa62ce6827104c859a6bdf73ca39d515a3f8b
|
/Beanio/ViewModel/ViewModel.swift
|
9c7d366c0f8a9928b94e8f0430f95569ce7492c8
|
[] |
no_license
|
murraygoodwin/Beanio
|
187aebf553c1d31919b06c679d0d5842e958a93e
|
21242ba3864130b9ed046609592b9308b91d8e3a
|
refs/heads/master
| 2023-03-05T09:23:57.294085 | 2021-02-19T15:29:13 | 2021-02-19T15:29:13 | 334,173,556 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 4,083 |
swift
|
//
// ViewModel.swift
// Beanio
//
// Created by Murray Goodwin on 29/01/2021.
//
import Foundation
import CoreLocation
import UIKit
protocol ViewModelDelegate: AnyObject {
func viewModel(_ manager: ViewModel, didUpdateUserLocation: CLLocation)
func viewModel(_ manager: ViewModel, didUpdateCoffeeShops: [CoffeeShop])
func viewModel(_ manager: ViewModel, didUpdateWarningText: String?)
func viewModel(_ manager: ViewModel, didFailWithError: ErrorHandler.ErrorType)
}
final class ViewModel: NSObject {
private let coreLocationManager: CLLocationManager
private let fourSquareManager: FourSquareManager
init(coreLocationManager: CLLocationManager, fourSquareManager: FourSquareManager) {
self.coreLocationManager = coreLocationManager
self.fourSquareManager = fourSquareManager
}
weak var delegate: ViewModelDelegate?
// MARK: - Location + venue properties
var userLocation: CLLocation = CLLocation(latitude: 51.5154856, longitude: -0.1418396) {
didSet {
delegate?.viewModel(self, didUpdateUserLocation: userLocation)
}
}
var coffeeShops: [CoffeeShop] = [] {
didSet {
delegate?.viewModel(self, didUpdateCoffeeShops: coffeeShops)
}
}
var warningText: String? {
didSet {
delegate?.viewModel(self, didUpdateWarningText: warningText)
}
}
// MARK: - Refresh Data
func refreshData() {
coreLocationManager.delegate = self
fourSquareManager.delegate = self
let userLocationManager = UserLocationManager(coreLocationManager: coreLocationManager)
do {
try userLocationManager.getCurrentLocation()
} catch ErrorHandler.ErrorType.locationServicesDisabled {
delegate?.viewModel(self, didFailWithError: .locationServicesDisabled)
} catch ErrorHandler.ErrorType.locationServicesRestricted {
delegate?.viewModel(self, didFailWithError: .locationServicesRestricted)
} catch {
delegate?.viewModel(self, didFailWithError: .other)
}
}
}
// MARK: - CoreLocationManager Delegate
extension ViewModel: CLLocationManagerDelegate {
func locationManagerDidChangeAuthorization(_ manager: CLLocationManager) {
refreshData()
}
func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
let userLocationManager = UserLocationManager(coreLocationManager: coreLocationManager)
// Prevent multiple delegate calls from the same search:
if let foundLocation = locations.last, userLocationManager.coreLocationDidFinishRequestingALocation == false {
userLocationManager.coreLocationDidFinishRequestingALocation = true
manager.stopUpdatingLocation()
userLocation = CLLocation(latitude: foundLocation.coordinate.latitude, longitude: foundLocation.coordinate.longitude)
fourSquareManager.downloadVenueDataNearLocation(location: userLocation) { (data) in
guard let data = data else { return }
do {
let jsonParser = JSONParser()
if let parsedShops = try jsonParser.parseCoffeeShopJSON(data).coffeeShops {
self.coffeeShops = parsedShops.sorted(by: { $0.distance < $1.distance })
}
self.warningText = try jsonParser.parseCoffeeShopJSON(data).warningText
} catch {
self.delegate?.viewModel(self, didFailWithError: .locationServicesDisabled)
}
}
}
}
//FIXME: In production, I would handle the various types of error that could be returned here (https://developer.apple.com/documentation/corelocation/cllocationmanagerdelegate/1423786-locationmanager).
func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) {
delegate?.viewModel(self, didFailWithError: .coreLocationError)
}
}
// MARK: - FourSquare delegate
extension ViewModel: FourSquareMangerDelegate {
func fourSquareManager(_ manager: FourSquareManager, didFailWithError: ErrorHandler.ErrorType) {
delegate?.viewModel(self, didFailWithError: didFailWithError)
}
}
|
[
-1
] |
4e227aae91484a47d3c069305e3803642da9ac36
|
7f4607c9f8fac6c8499b94c002dc752968504f83
|
/politicsAboutBorders/ViewController.swift
|
76dfe51fc6af5f4b8025a44bae3b7286b5b0362c
|
[] |
no_license
|
bhavrish/PoliticsWithoutBorders
|
602c9c21cb52dc6615b98f6e927a382e9077883c
|
f6b57fe3e1487e022924aa840224f486cc9aaed5
|
refs/heads/master
| 2022-08-28T18:46:53.821311 | 2020-05-28T03:06:12 | 2020-05-28T03:06:12 | 267,480,270 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 460 |
swift
|
//
// ViewController.swift
// politicsAboutBorders
//
// Created by Bhavesh Shah on 10/13/18.
// Copyright © 2018 Bhavesh Shah. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
|
[
292418,
311045,
284005,
187882,
233869,
229712,
284435,
316371,
53876,
284310,
284311,
283032,
284313,
283035,
283036
] |
e7500cc1a8209826f9c9dab07952b73908feff9d
|
15d05f17c637974067944727fe46701294f0831f
|
/playBetaV1/pages/personalInfoChangePage.swift
|
831b3c9f06e2abf7598edcaee26df48c7b3fc93e
|
[] |
no_license
|
dustycrusty/Play-IOS
|
205ba27970d7778fc7b2c76443f23a9bb3bb0210
|
427d2fc08446f5a4ef5b47b988e447812fe9b23c
|
refs/heads/master
| 2020-08-28T05:38:17.962519 | 2019-10-25T20:24:06 | 2019-10-25T20:24:06 | 208,929,008 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 6,545 |
swift
|
//
// personalInfoChangePage.swift
// playBetaV1
//
// Created by 이승윤 on 2018. 5. 27..
// Copyright © 2018년 Dustin Lee. All rights reserved.
//
import UIKit
import AvatarImageView
import Kingfisher
import Firebase
class personalInfoChangePage: UIViewController {
@IBOutlet weak var profilePic: AvatarImageView!{
didSet {
configureRoundAvatar() // Comment this line for a square avatar as that is the default.
showInitials()
showProfilePicture()
}
}
func configureRoundAvatar() {
struct Config: AvatarImageViewConfiguration { var shape: Shape = .circle }
profilePic.configuration = Config()
}
func showProfilePicture() {
var data = avatarImageDatasource()
if Auth.auth().currentUser?.photoURL != nil{
print("URL EXISTS")
KingfisherManager.shared.retrieveImage(with: (Auth.auth().currentUser?.photoURL)!, options: nil, progressBlock: nil, completionHandler: { image, error, cacheType, imageURL in
if error == nil {
print("ERROR IS NIL")
data.avatar = image
self.profilePic.dataSource = data
}
})
}
}
func showInitials() {
profilePic.dataSource = avatarImageDatasource()
}
@IBOutlet weak var id: UILabel!
@IBOutlet weak var username: UIButton!
@IBOutlet weak var password: UIButton!
@IBOutlet weak var phoneNumber: UIButton!
override func viewWillAppear(_ animated: Bool) {
setUpTexts()
let tap = UITapGestureRecognizer(target: self, action: #selector(handleTap))
profilePic.addGestureRecognizer(tap)
}
@objc func handleTap(){
CameraHandler.shared.showActionSheet(vc: self)
CameraHandler.shared.imagePickedBlock = { (image) in
print("pickedImage..")
guard let uid = Auth.auth().currentUser?.uid else {return}
guard let imageData = UIImageJPEGRepresentation(image, 0.5) else {return}
let profileImgReference = Storage.storage().reference().child("profile_image_urls").child("\(uid).png")
let uploadTask = profileImgReference.putData(imageData, metadata: nil) { (metadata, error) in
print("uploading...")
if let error = error {
errorPopup(vc: self, error: error, errorName: "이미지 업로드 에러")
}
else {
print("metadataExists ", (metadata != nil))
profileImgReference.downloadURL(completion: { (url, error) in
if let error = error{
errorPopup(vc: self, error: error, errorName: "업로드 에러")
}
print("downloadingUrl...")
let changeRequest = Auth.auth().currentUser?.createProfileChangeRequest()
changeRequest?.photoURL = url
changeRequest?.commitChanges { (error) in
if let error = error{
errorPopup(vc: self, error: error, errorName: "정보 변경 에러")
}
else{
self.showInitials()
self.showProfilePicture()
print("committingChanges..")
let alert = UIAlertController(title: "성공", message: "프로파일 이미지 업로드를 성공했습니다!", preferredStyle: UIAlertControllerStyle.alert)
alert.addAction(UIAlertAction(title: "OK", style: .cancel, handler: nil))
self.present(alert, animated: true, completion: nil)
}
}
})
}
}
uploadTask.observe(.progress, handler: { (snapshot) in
print(snapshot.progress?.fractionCompleted ?? "")
// Here you can get the progress of the upload process.
})
}
}
override func viewDidLoad() {
super.viewDidLoad()
self.navigationController?.navigationBar.tintColor = UIColor.white
// Do any additional setup after loading the view.
}
@IBAction func okTapped(_ sender: Any)
{
self.navigationController?.popViewController(animated: true)
}
func setUpTexts(){
if let email = Auth.auth().currentUser?.email{
self.id.text = email
}
else{
self.id.text = "이메일 아이디가 없습니다."
}
self.username.setTitle(Auth.auth().currentUser?.displayName, for: UIControlState.normal)
self.username.titleLabel?.minimumScaleFactor = 0.5
self.username.titleLabel?.adjustsFontSizeToFitWidth = true
self.username.titleLabel?.numberOfLines = 1
self.password.setTitle("눌러서 변경해주세요", for: UIControlState.normal)
self.password.titleLabel?.minimumScaleFactor = 0.5
self.password.titleLabel?.adjustsFontSizeToFitWidth = true
self.password.titleLabel?.numberOfLines = 1
self.phoneNumber.titleLabel?.minimumScaleFactor = 0.5
self.phoneNumber.titleLabel?.adjustsFontSizeToFitWidth = true
self.phoneNumber.titleLabel?.numberOfLines = 1
if let ph = Auth.auth().currentUser?.phoneNumber{
self.phoneNumber.setTitle(ph, for: UIControlState.normal)
}
else{
self.phoneNumber.setTitle("전화번호가 없습니다. 눌러서 설정해주세요.", for: UIControlState.normal)
}
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destinationViewController.
// Pass the selected object to the new view controller.
}
*/
}
|
[
-1
] |
17fe6b81ae71123f8920e81f9e9d8db78e93fb50
|
77295d73bab14b3280885ca209e4b7a1f0943d1b
|
/iTunesClient/AlbumDetailDataSource.swift
|
c67f06afae9c44efb0984428ecff11fa4459e16e
|
[] |
no_license
|
rdevnani/ItunesSearchApp
|
69bf141f56c4a5b9dcce60cb85f124c20d7c1ab8
|
6d6700b0b31741ffb78cbbfac04e76707b6679b5
|
refs/heads/master
| 2021-01-20T09:21:36.326493 | 2017-08-28T01:18:11 | 2017-08-28T01:18:11 | 101,591,314 | 2 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,369 |
swift
|
//
// AlbumDetailDataSource.swift
// iTunesClient
//
// Created by Rohit Devnani on 23/8/17.
// Copyright © 2017 Rohit Devnani. All rights reserved.
//
import Foundation
import UIKit
class AlbumDetailDataSource: NSObject, UITableViewDataSource {
private var songs: [Song]
init(songs: [Song]) {
self.songs = songs
}
func numberOfSections(in tableView: UITableView) -> Int {
return 1
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return songs.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: SongCell.reuseIdentifier, for: indexPath) as! SongCell
let song = songs[indexPath.row]
let viewModel = SongViewModel(song: song)
cell.songTitleLabel.text = viewModel.title
cell.songRuntimeLabel.text = viewModel.runtime
return cell
}
func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
switch section {
case 0: return "Tracks"
default: return nil
}
}
func update(with songs: [Song]) {
self.songs = songs
}
}
|
[
-1
] |
d6932ca40eb43ccbdfd7030d750cf74298010db9
|
53c73c3044c6f887a51d03c7f6c76ab04a18f0c9
|
/SwiftFirestorePhotoAlbum/Support Files/AppDelegate.swift
|
e9fcd36544e0d9332347db489553441246bead1a
|
[] |
no_license
|
Yeehaareal/ChuckNorrisApp
|
5cefe11d7571cabccebc328c48fb5f73d09c8f23
|
10053d7c4fe07aca7b5219c562daa8aba34fd6b1
|
refs/heads/master
| 2023-01-21T18:08:40.838678 | 2019-12-10T09:55:59 | 2019-12-10T09:55:59 | 226,814,692 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 502 |
swift
|
//
// AppDelegate.swift
// SwiftFirestorePhotoAlbum
//
// Created by Alex Akrimpai on 03/09/2018.
// Copyright © 2018 Alex Akrimpai. All rights reserved.
//
import UIKit
import Firebase
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
FirebaseApp.configure()
return true
}
}
|
[
354680,
133787,
217140,
180277
] |
cc21dbd5876278dd3c81893ff46afe205be8bb85
|
65f5f892b8990fc6075a00572da1a7fb89246f94
|
/SuperTerrificHappyFourSquare/SuperTerrificHappyFourSquare/Controllers/SearchController.swift
|
40eac86ceddc22cbc77a4dcc9ebb190c53c743a1
|
[] |
no_license
|
CameronRivera/SuperTerrificHappyFourSquare
|
e297d5e4b4b881a4078543991e81a357945a254c
|
07bfd069aa2899185b71637728d4635ed25308a8
|
refs/heads/qa
| 2021-01-09T03:56:52.804828 | 2020-04-14T22:07:48 | 2020-04-14T22:07:48 | 242,237,583 | 1 | 1 | null | 2020-03-02T21:48:28 | 2020-02-21T21:55:55 |
Swift
|
UTF-8
|
Swift
| false | false | 10,573 |
swift
|
//
// ViewController.swift
// SuperTerrificHappyFourSquare
//
// Created by Cameron Rivera on 2/21/20.
// Copyright © 2020 Cameron Rivera. All rights reserved.
//
import Foundation
import UIKit
import MapKit
import CoreLocation
import DataPersistence
import ImageKit
class SearchController: UIViewController {
let dataPersistence: DataPersistence<Collection>
private var searchView = SearchView()
var mapView = MKMapView()
private var location = [Location]()
init(_ dataPersistence: DataPersistence<Collection>){
self.dataPersistence = dataPersistence
super.init(nibName: nil, bundle: nil)
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
private var venus = [Venue](){
didSet{
DispatchQueue.main.async {
self.loadMap()
self.searchView.venueCollectionView.reloadData()
}
}
}
private var venuePhoto = [PhotoItems](){
didSet{
DispatchQueue.main.async {
self.searchView.venueCollectionView.reloadData()
}
}
}
private let locationSession = CoreLocationHandler()
var userTrackingButton: MKUserTrackingButton!
var defaultLocation = "Brooklyn"
var annotations = [MKPointAnnotation]()
let searchRadius: CLLocationDistance = 100.0
private var isShowingNewAnnotations = false
override func loadView() {
view = searchView
}
override func viewDidLoad() {
super.viewDidLoad()
searchView.backgroundColor = .systemBackground
setUp()
userTrackingButton = MKUserTrackingButton(frame: CGRect(x: 20, y: 20, width: 40, height: 40))
userTrackingButton.mapView = searchView.mapView
searchView.mapView.addSubview(userTrackingButton)
//loadMap()
// getVenueWOCoordinate(query: "", location: "")
searchView.mapView.delegate = self
searchView.venueSearchBar.delegate = self
searchView.locationSearch.delegate = self
locationSession.delegate = self
searchView.eventsListButton.addTarget(self, action: #selector(listButtonPressed), for: .touchUpInside)
}
private func setUp(){
navigationItem.title = "Search Venues"
searchView.venueCollectionView.register(CustomCollectionCell.self, forCellWithReuseIdentifier: "customCollectCell")
searchView.venueCollectionView.dataSource = self
searchView.venueCollectionView.delegate = self
}
private func getVenueWOCoordinate(query: String, location: String){
let _ = query.addingPercentEncoding(withAllowedCharacters: .urlHostAllowed) ?? "McDonalds"
let _ = location.addingPercentEncoding(withAllowedCharacters: .urlHostAllowed) ?? "Queens"
FourSquareAPIClient.getVenuesWithoutCoordinates(query: query, location: location) { (result) in
switch result {
case .failure(let error):
print("This is an error I wrote in the API call \(error) CHECK. CHECK")
case .success(let venue):
self.venus = venue
print(self.venus)
}
}
}
@objc func listButtonPressed(){
let catVC = CategoryController(dataPersistence, venues: venus)
self.modalPresentationStyle = .fullScreen
navigationController?.pushViewController(catVC, animated: true)
}
private func loadMap() {
let annotations = makeAnnotations()
// mapView.addAnnotations(annotations)
searchView.mapView.addAnnotations(annotations)
searchView.mapView.showAnnotations(annotations, animated: true)
}
private func makeAnnotations() -> [MKPointAnnotation] {
var annotations = [MKPointAnnotation]()
for location in venus {
let annotation = MKPointAnnotation()
annotation.title = location.name
annotation.coordinate.latitude = location.location.lat
annotation.coordinate.longitude = location.location.lng
annotations.append(annotation)
}
isShowingNewAnnotations = true
self.annotations = annotations
return annotations
}
private func convertPlaceNameToCoordinate(_ placeName: String) {
locationSession.convertPlaceNameToCoordinate(placeName) { (result) in
switch result {
case .failure(let error):
print("geocode error: \(error)")
case .success(let coordinate):
let region = MKCoordinateRegion(center: coordinate, latitudinalMeters: 800, longitudinalMeters: 800)
self.searchView.mapView.setRegion(region, animated: true)
}
}
}
func loadUserLocation(_ position: CLLocation){
locationSession.convertCoordinateToPlacemark(position.coordinate) { (result) in
switch result {
case .failure(let error):
print("error finding user location: \(error)")
case .success(let location):
self.defaultLocation = location.name ?? ""
print(location.name ?? "Mcdonalds")
}
}
}
}
//---------------------------------------------------------------
//MARK: EXTENSIONS
extension SearchController: MKMapViewDelegate {
func mapView(_ mapView: MKMapView, didSelect view: MKAnnotationView) {
let mappedArr = venus.map{ $0.name }
if let title = view.annotation?.title ?? "", let venueIndex = mappedArr.firstIndex(of: title) {
let sb = UIStoryboard(name: "DetailTableViewController", bundle: nil)
let detailVC = sb.instantiateViewController(identifier: "DetailTableViewController") { [unowned self] (coder) in
return DetailTableViewController(coder: coder,self.venus[venueIndex], self.dataPersistence)
}
guard view.annotation != nil else {return}
navigationController?.pushViewController(detailVC, animated: true)
}
}
func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? {
guard annotation is MKPointAnnotation else {return nil}
let identifier = "annotationView"
let annotationView = MKAnnotationView(annotation: annotation, reuseIdentifier: identifier)
annotationView.image = UIImage(named: "alexHeadThumbnail")
annotationView.canShowCallout = true
return annotationView
}
func mapViewDidFinishLoadingMap(_ mapView: MKMapView) {
if isShowingNewAnnotations{
mapView.showAnnotations(annotations, animated: false)
}
isShowingNewAnnotations = false
}
}
//---------------------------------------------------------------
//MARK: EXTENSIONS
extension SearchController: UITextFieldDelegate {
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
textField.resignFirstResponder()
guard let searchText = textField.text,!searchText.isEmpty else {
return true
}
if textField == searchView.locationSearch {
getVenueWOCoordinate(query: searchView.venueSearchBar.text ?? "Pizza", location: searchView.locationSearch.text ?? "Brooklyn")
resignFirstResponder()
}
if textField == searchView.venueSearchBar {
getVenueWOCoordinate(query: searchView.venueSearchBar.text ?? "pizza", location: searchView.locationSearch.text ?? "Brooklyn" )
resignFirstResponder()
}
// MARK: ****** FIX THIS ********
//textFieldSelector(textField)
convertPlaceNameToCoordinate(searchText)
return true
}
}
//---------------------------------------------------------------
//MARK: EXTENSIONS
extension SearchController: UICollectionViewDataSource{
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
venus.count
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "customCollectCell", for: indexPath) as? CustomCollectionCell else {
fatalError("could not cast to cell")
}
cell.backgroundColor = .systemGroupedBackground
let venue = venus[indexPath.row]
cell.configureMKViewCollectionCell(venue)
return cell
}
}
extension SearchController: UICollectionViewDelegateFlowLayout{
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
let venu = venus[indexPath.row]
let sb = UIStoryboard(name: "DetailTableViewController", bundle: nil)
let detailVC = sb.instantiateViewController(identifier: "DetailTableViewController") { (coder) in
return DetailTableViewController(coder: coder, venu, self.dataPersistence)
}
navigationController?.pushViewController(detailVC, animated: true)
}
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
let itemSpacing: CGFloat = 0.2
let maxWidth = UIScreen.main.bounds.size.width
let numberOfItems: CGFloat = 1
let totalSpace: CGFloat = numberOfItems * itemSpacing
let itemWidth: CGFloat = (maxWidth - totalSpace) / 1
return CGSize(width: itemWidth/2, height: itemWidth/1.5)
}
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
return UIEdgeInsets(top: 10, left: 25, bottom: 10, right: 25)
}
}
extension SearchController: CoreLocationHandlerDelegate {
func locationUpdated(_ coreLocationHandler: CoreLocationHandler, _ locations: [CLLocation]) {
if let newLoc = locations.first{
loadUserLocation(newLoc)
}
}
}
|
[
-1
] |
2cf9d07636a04099804e96b465c811be2214bcfa
|
a179d91f57996f0eb89deee63991385dea0c474e
|
/TaskManageriOS/Controllers/CoreUI/ProfileViewController.swift
|
9c8d8563cc47215a280b33a9f37c0e141f1836c0
|
[] |
no_license
|
JasonHaque/taskmanagerios
|
9e83383d9991db33ec1de94185fbc489b498fe73
|
3d8e8cfda5ab4326e39dc5732dfc05d622a52cd2
|
refs/heads/master
| 2021-05-23T13:56:49.364638 | 2020-09-15T16:58:08 | 2020-09-15T16:58:08 | 253,323,564 | 3 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 3,444 |
swift
|
//
// ProfileViewController.swift
// TaskManageriOS
//
// Created by Sanviraj Zahin Haque on 12/9/20.
// Copyright © 2020 Sanviraj Zahin Haque. All rights reserved.
//
import UIKit
/// class to show Profile
class ProfileViewController: UIViewController {
private let tableView : UITableView = {
let table = UITableView()
table.register(ProfileTableViewCell.self, forCellReuseIdentifier: ProfileTableViewCell.identifier)
return table
}()
var data = [ProfileViewModel]()
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .systemBackground
tableView.delegate = self
tableView.dataSource = self
title = "Profile"
let name = UserDefaults.standard.value(forKey: "userName") as? String
let email = UserDefaults.standard.value(forKey: "email") as? String
data.append(ProfileViewModel(viewModelType: .info, title: "Name : \(name!)", handler: nil))
data.append(ProfileViewModel(viewModelType: .info, title: "Email : \(email!)", handler: nil))
data.append(ProfileViewModel(viewModelType: .logout, title: "Log Out", handler: {
//add log out code
print("Logging you out")
self.showLogOutAction()
}))
view.addSubview(tableView)
}
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
tableView.frame = view.bounds
}
func showLogOutAction(){
let actionsheet = UIAlertController(title: "Log Out", message: "Are you sure you want to proceed?", preferredStyle: .actionSheet)
actionsheet.addAction(UIAlertAction(title: "Log Out", style: .destructive, handler: { [weak self] _ in
self?.logOut()
}))
actionsheet.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler: nil))
present(actionsheet,animated: true)
}
func logOut(){
Authmanager.shared.logUserOut { [weak self] loggedOut in
if loggedOut{
DispatchQueue.main.async {
let vc = LogInViewController()
vc.title = "Log In"
let nav = UINavigationController(rootViewController: vc)
nav.modalPresentationStyle = .fullScreen
self?.present(nav,animated: false)
}
}
else{
//this shouldn't bloody happen
}
}
}
}
extension ProfileViewController : UITableViewDelegate,UITableViewDataSource{
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return data.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: ProfileTableViewCell.identifier, for: indexPath) as! ProfileTableViewCell
let model = data[indexPath.row]
cell.setUp(with: model)
return cell
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
tableView.deselectRow(at: indexPath, animated: true)
data[indexPath.row].handler?()
}
}
|
[
-1
] |
c86626110eb3f90c8ece940f98c935b882980e74
|
a1521e7bd632c7f5156e9a2a126b0ab76ca2692d
|
/layerone2019swift/MJPEGStreamLib.swift
|
d72f80baec59f9ad4fd28a77eb1f40b890d57aa3
|
[] |
no_license
|
astropika/layerone_2019_ios
|
6bc516e98d064982f56b9580e1759eb7468049c5
|
9f12a8c72d59a90ce6062236070dfa3d9731a2c5
|
refs/heads/master
| 2020-05-27T18:07:49.887760 | 2019-06-07T22:07:48 | 2019-06-07T22:47:06 | 188,736,685 | 1 | 1 | null | null | null | null |
UTF-8
|
Swift
| false | false | 20,758 |
swift
|
// from https://github.com/WrathChaos/MJPEGStreamLib
import UIKit
import Vision
import GPUImage
open class MJPEGStreamLib: NSObject, URLSessionDataDelegate {
fileprivate enum StreamStatus {
case stop
case loading
case play
}
fileprivate var receivedData: NSMutableData?
fileprivate var dataTask: URLSessionDataTask?
fileprivate var session: Foundation.URLSession!
fileprivate var status: StreamStatus = .stop
open var authenticationHandler: ((URLAuthenticationChallenge) -> (Foundation.URLSession.AuthChallengeDisposition, URLCredential?))?
open var didStartLoading: (()->Void)?
open var didFinishLoading: (()->Void)?
open var contentURL: URL?
open var imageView: UIView
open var image_outlet: Int
open var laugh_face:UIImage
open var laugh_banner:UIImage
open var errors = 0;
open var recording:Bool = false
open var recordingPath:URL?
open var recordingCounter:Int = 0
open var recordingStarted:NSDate?
var lastAlarmTrigger:AlarmTrigger?
open var filter:String?
open var lastrotate:Int?
open var face_draw_layers = [CALayer]();
var facedetector: FaceDetector
public init(imageView: UIView) {
self.facedetector = FaceDetector.init()
self.imageView = imageView
self.image_outlet = 1;
laugh_face = UIImage(named:"laughingmanface")!;
laugh_banner = UIImage(named:"laughingmantext")!;
super.init()
self.session = Foundation.URLSession(configuration: URLSessionConfiguration.default, delegate: self, delegateQueue: nil)
lastrotate = config.prerotate
}
public convenience init(imageView: UIView, contentURL: URL) {
self.init(imageView: imageView)
self.contentURL = contentURL
}
deinit {
dataTask?.cancel()
}
func applyFilter(_ source: UIImage) -> UIImage {
//incredibly inefficient
if self.filter != nil {
switch (self.filter){
case "cartoon":
return source.filterWithOperation(SmoothToonFilter())
case "sketch":
return source.filterWithOperation(SketchFilter())
case "pixellate":
return source.filterWithOperation(Pixellate())
case "polkadot":
return source.filterWithOperation(PolkaDot())
case "halftone":
return source.filterWithOperation(Halftone())
case "cga":
return source.filterWithOperation(CGAColorspaceFilter())
case "solarize":
return source.filterWithOperation(Solarize())
default:
return source
}
}
return source
}
open func blankImageview() {
let blank = UIImage.emptyImage(with: CGSize(width: 80, height: 80))
DispatchQueue.main.async { self.imageView.layer.contents = blank!.cgImage;}
}
// Play function with url parameter
open func play(url: URL){
// Checking the status for it is already playing or not
if status == .play || status == .loading {
stop()
}
contentURL = url
play()
}
open func setOutlet(_ mode: Int)
{
image_outlet = mode;
imageView.layer.sublayers = nil
face_draw_layers = [CALayer]()
}
open func setImageView(view: UIView){
self.imageView = view;
self.imageView.layer.zPosition = 99
}
open func getImageView() -> UIView {
return self.imageView;
}
open func hideImageView() {
self.imageView.isHidden = true
}
open func showImageView()
{
self.imageView.isHidden = false
}
func canAlarm() -> Bool {
let alarm = config.alarm
if alarm != nil {
if lastAlarmTrigger != nil {
let endoftrigger = (lastAlarmTrigger!.start) + lastAlarmTrigger!.period
if endoftrigger.timeIntervalSinceNow <= -(config.alarm?.cooldown)! {
return true
}
return false
}
return true
}
return false
}
open func handleAlarm(faces: [VNFaceObservation], source: UIImage) {
let alarm = config.alarm
if alarm != nil {
if faces.count >= alarm!.faces && recording == false {
start_recording()
let when = DispatchTime.now() + (alarm?.period)!
DispatchQueue.main.asyncAfter(deadline: when){
self.stop_recording(nil,inst: nil)
}
}
}
}
open func imageDispatch(source: UIImage)
{
// inefficient and bad
if config.alarm != nil && image_outlet != 1 {
if canAlarm(){
facedetector.getFaces(for: source, complete: handleAlarm )
}
}
switch (image_outlet){
// eye highlight mode
case 1:
self.facedetector.showEye(for: source, complete: onNewImage)
// face highlight mode
case 2:
stream.showImageView()
self.facedetector.highlightFaces(for: source, complete: onNewImage)
//passthru
case 3:
stream.showImageView()
onNewImage(source: source)
case 4:
stream.showImageView()
self.facedetector.getFaces(for: source, complete: drawLaugh )
case 5:
stream.showImageView()
self.facedetector.drawFeatures(for: source, complete: onNewImage)
default:
break
}
}
open func translateToView(view: CGRect, op: CGRect) -> CGRect {
let x = op.minX * view.width
let y = op.minY * view.height
let width = op.size.width * view.width
let height = op.size.height * view.height
let rect = CGRect(x: x, y: y, width: width, height: height)
let transform = CGAffineTransform(scaleX: 1, y: -1).translatedBy(x: 0, y: -view.size.height)
return rect.applying(transform)
}
open func centerZoom(factor:CGFloat = 2.0, rect: CGRect) -> CGRect {
var x:CGFloat
var y:CGFloat
var width:CGFloat
var height:CGFloat
if factor > 1.0 {
x = rect.midX - rect.width/2 * factor
y = rect.midY - rect.height/2 * factor
}
else {
x = rect.midX + rect.width/2 * factor
y = rect.midY + rect.height/2 * factor
}
width = rect.width * factor
height = rect.height * factor
return CGRect(x: x, y: y, width: width, height:height)
}
open func drawLaugh(faces: [VNFaceObservation], source: UIImage){
if config.debug{
var bg = source
for i in faces{
var landmarks = [VNFaceLandmarkRegion2D]()
bg = facedetector.drawOnImage(source: bg,boundingRect: i.boundingBox, roiRect: i.boundingBox,faceLandmarkRegions: landmarks)
}
onNewImage(source: bg)
}
else{
onNewImage(source: source)
}
var current = [CALayer]();
for faceObservation in faces {
if lastrotate != config.prerotate{
lastrotate = config.prerotate
face_draw_layers = [CALayer]()
}
var found = false;
for layer in face_draw_layers {
let newrect = translateToView(view:self.imageView.layer.frame , op: faceObservation.boundingBox)
let centerpoint = CGPoint(x: newrect.midX, y: newrect.midY)
if layer.frame.contains(centerpoint){
var placement = translateToView(view:self.imageView.layer.frame , op: faceObservation.boundingBox);
if placement.width > placement.height {
let diff = placement.width-placement.height
placement = placement.insetBy(dx:0.0, dy:-(diff/2))
}
if placement.width < placement.height {
let diff = placement.height-placement.width
placement = placement.insetBy(dx:-(diff/2),dy:0.0)
}
layer.frame = centerZoom(factor: 2.0, rect: placement);
for i in layer.sublayers! {
switch (i.zPosition){
case 1:
var banx:CGFloat = 0
var bany:CGFloat = 0
switch(config.prerotate)
{
case 1:
banx = 0-(layer.frame.height*0.05)
bany = 0-(layer.frame.width*0.085)
case 2:
banx = 0-(layer.frame.width*0.015)
bany = 0-(layer.frame.height*0.05)
case 3:
bany = 0-(layer.frame.width*0.015)
banx = 0-(layer.frame.height*0.05)
default:
banx = 0-(layer.frame.width*0.085)
bany = 0-(layer.frame.height*0.05)
}
i.frame = CGRect(x: banx,y:bany,width:layer.frame.width*1.1,height:layer.frame.height*1.1)
default:
i.frame = CGRect(x:0,y:0,width:layer.frame.width,height:layer.frame.height)
}
}
current.append(layer)
found = true;
}
}
if !found {
let newlayer = CALayer()
let newbanner = CALayer()
let overlayer = CALayer()
var placement = translateToView(view:self.imageView.layer.frame , op: faceObservation.boundingBox);
if placement.width > placement.height {
let diff = placement.width-placement.height
placement = placement.insetBy(dx:0.0, dy:-(diff/2))
}
if placement.width < placement.height {
let diff = placement.height-placement.width
placement = placement.insetBy(dx:-(diff/2),dy:0.0)
}
placement = centerZoom(factor: 2.0, rect: placement);
overlayer.frame = placement
if config!.prerotate != 0 {
newlayer.contents = laugh_face.imageRotatedByDegrees(degrees: CGFloat(90*config.prerotate), flip: false).cgImage
}
else {
newlayer.contents = laugh_face.cgImage;
}
newlayer.shouldRasterize = true;
newlayer.frame = CGRect(x:0,y:0,width:overlayer.frame.width,height:overlayer.frame.height)
var banx:CGFloat = 0
var bany:CGFloat = 0
switch(config.prerotate)
{
case 1:
banx = 0-(overlayer.frame.height*0.05)
bany = 0-(overlayer.frame.width*0.085)
case 2:
banx = 0-(overlayer.frame.width*0.015)
bany = 0-(overlayer.frame.height*0.05)
case 3:
bany = 0-(overlayer.frame.width*0.015)
banx = 0-(overlayer.frame.height*0.05)
default:
banx = 0-(overlayer.frame.width*0.085)
bany = 0-(overlayer.frame.height*0.05)
}
newbanner.frame = CGRect(x:banx,y:bany,width:overlayer.frame.width*1.1,height:overlayer.frame.height*1.1)
newbanner.contents = laugh_banner.cgImage
let rotate = CABasicAnimation(keyPath: "transform.rotation.z")
rotate.fromValue = 0.0
rotate.toValue = CGFloat(Double.pi * 2.0)
rotate.duration = 4.0
rotate.repeatCount = Float.infinity
newbanner.add(rotate, forKey: nil)
newbanner.zPosition = 1
newlayer.zPosition = 2
overlayer.addSublayer(newbanner)
overlayer.addSublayer(newlayer)
current.append(overlayer)
}
}
face_draw_layers = current;
imageView.layer.sublayers = nil;
for layer in face_draw_layers {
imageView.layer.addSublayer(layer)
}
}
// Play function without URL parameter
open func play() {
guard let url = contentURL , status == .stop else {
return
}
status = .loading
DispatchQueue.main.async { self.didStartLoading?() }
receivedData = NSMutableData()
let request = URLRequest(url: url, timeoutInterval: 5.0)
dataTask = session.dataTask(with: request)
dataTask?.resume()
}
// Stop the stream function
open func stop(){
status = .stop
dataTask?.cancel()
}
open func errorHandler(data: Data?, response: URLResponse?, error: Error?)
{
if let unwrappedError = error {
print(unwrappedError)
}
}
// NSURLSessionDataDelegate
open func onNewImage(source: UIImage){
if self.filter != nil {
DispatchQueue.main.async { self.imageView.layer.contents = self.applyFilter(source).cgImage }
}
else {
DispatchQueue.main.async { self.imageView.layer.contents = source.cgImage; }
}
if self.recording {
if recordingCounter == 0 {
self.recordingStarted = NSDate()
}
recordingCounter += 1
let path = recordingPath?.appendingPathComponent("\(recordingCounter).png")
grab()!.save(path!)
}
}
open func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive response: URLResponse, completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) {
// Controlling the imageData is not nil
if let imageData = receivedData , imageData.length > 0,
let receivedImage = UIImage(data: imageData as Data) {
if status == .loading {
status = .play
DispatchQueue.main.async { self.didFinishLoading?() }
}
if config!.prerotate != 0 {
DispatchQueue.main.async{ self.imageDispatch(source: receivedImage.imageRotatedByDegrees(degrees: CGFloat(90*config.prerotate), flip: false))}
}
else {
DispatchQueue.main.async{ self.imageDispatch(source: receivedImage)}
}
}
receivedData = NSMutableData()
completionHandler(.allow)
}
open func grab() -> UIImage? {
UIGraphicsBeginImageContextWithOptions(self.imageView.frame.size, false, 0.0)
imageView.layer.render(in: UIGraphicsGetCurrentContext()!)
let image = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
return image
}
open func save(_ f:Selector, inst:UIViewController) {
let oneimage = UIImage(cgImage: self.imageView.layer.contents as! CGImage)
guard let image = grab() else { return }
DispatchQueue.main.async {UIImageWriteToSavedPhotosAlbum(image, inst, f , nil)}
}
open func start_recording()
{
self.recording = true
let tmpdir = FileManager.default.temporaryDirectory
let timeInterval = NSDate().timeIntervalSince1970
self.recordingPath = tmpdir.appendingPathComponent(String(Int(timeInterval)))
do {
try FileManager.default.createDirectory(atPath: self.recordingPath!.path, withIntermediateDirectories: true, attributes: nil)
}
catch let error as NSError
{
NSLog("Unable to create directory \(error.debugDescription)")
}
}
open func stop_recording(_ f:Selector?, inst:UIViewController?)
{
var framecount:Int32 = 0
self.recording = false
self.recordingCounter = 0
var files:[String]?
do {
files = try FileManager.default.contentsOfDirectory(atPath: (recordingPath?.path)!)
framecount = Int32(files!.count)
}
catch let error as NSError
{
NSLog("Unable to count recording directory \(error.debugDescription)")
}
let end = NSDate()
let duration: Double = end.timeIntervalSince(recordingStarted! as Date)
let fps = Double(framecount)/duration
if f == nil {
self.lastAlarmTrigger = AlarmTrigger(period: (config.alarm?.period)!, start: recordingStarted! as Date)
}
self.recordingStarted = nil
let first = UIImage(fileURLWithPath: (recordingPath?.appendingPathComponent("1.png"))!)
let size:CGSize = first!.size
var absofiles = [String]()
for i in files!.sorted(by: { Int($0.replace(target: ".png",withString: ""))! < Int($1.replace(target: ".png",withString: ""))! }) {
absofiles.append((recordingPath?.appendingPathComponent(i).absoluteString)!)
}
let videoBuilder = VideoBuilder(photoURLs: absofiles, size:size, fps: fps)
videoBuilder.build({ progress in
// print(progress)
}, success: { url in
UISaveVideoAtPathToSavedPhotosAlbum(
url.path,
inst,
f,
nil)
self.cleanup_video()
}, failure: { error in
print(error)
self.cleanup_video()
})
}
fileprivate func cleanup_video() {
do {
let filePaths = try FileManager.default.contentsOfDirectory(atPath: (recordingPath?.path)!)
for filePath in filePaths {
try FileManager.default.removeItem(atPath: (recordingPath?.appendingPathComponent(filePath).path)!)
}
} catch {
print("Could not clear temp folder: \(error)")
}
recordingPath = nil
}
open func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) {
receivedData?.append(data)
}
public func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) {
if let unwrappedError = error {
print(unwrappedError.localizedDescription)
switch (unwrappedError.localizedDescription) {
case "cancelled":
break
default:
// add to errors then restart
errors+=1
if errors >= config.error_tries{
NotificationCenter.default.post(name: NSNotification.Name("badgeurlfailure"), object: nil)
stop()
errors = 0
} else {
stop()
play()
}
}
}
}
// NSURLSessionTaskDelegate
open func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) {
var credential: URLCredential?
var disposition: Foundation.URLSession.AuthChallengeDisposition = .performDefaultHandling
// Getting the authentication if stream asks it
if challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust {
if let trust = challenge.protectionSpace.serverTrust {
credential = URLCredential(trust: trust)
disposition = .useCredential
}
} else if let onAuthentication = authenticationHandler {
(disposition, credential) = onAuthentication(challenge)
}
completionHandler(disposition, credential)
}
}
|
[
-1
] |
cafda9b37e6326ab03b076fb8d3532c3672ada63
|
f8d994f1858413bd0c36065737fec23c5b6b2109
|
/On The Map/On The Map/UdacityClient.swift
|
791952cade72d9be6f0f38f50e1e019542976b0a
|
[] |
no_license
|
TaherElsayeed/On-The-Map
|
692ef573c67c6b14eb5cfd38539035ed3c8985ab
|
fa15cf0c92cc659eff580a064c0866d1cb87b385
|
refs/heads/master
| 2020-04-09T09:39:25.553182 | 2016-08-21T02:26:20 | 2016-08-21T02:26:20 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 3,968 |
swift
|
//
// UdacityClient.swift
// On The Map
//
// Created by lily on 8/3/16.
// Copyright © 2016 Seab Jackson. All rights reserved.
//
import Foundation
class UdacityClient: NSObject {
// shared session
var session = NSURLSession.sharedSession()
// authentication state
var sessionID: String?
var userID: Int?
// MARK: Initializers
override init() {
super.init()
}
// MARK: GET
func taskForPOSTMethod(method: String, jsonBody: String?, methodType: String?, completionHandlerForGET: (result: AnyObject!, error: NSError?) -> Void) -> NSURLSessionDataTask {
// build the url and configure the request
let request = NSMutableURLRequest(URL: udacityURL(method))
if let methodType = methodType {
request.HTTPMethod = methodType
}
if let jsonBody = jsonBody {
request.addValue("application/json", forHTTPHeaderField: "Accept")
request.addValue("application/json", forHTTPHeaderField: "Content-Type")
request.HTTPBody = jsonBody.dataUsingEncoding(NSUTF8StringEncoding)
}
// make the request
let task = session.dataTaskWithRequest(request) { (data, response, error) in
func sendError(error: String) {
print(error)
let userInfo = [NSLocalizedDescriptionKey: error]
completionHandlerForGET(result: nil, error: NSError(domain: "taskForGETMethod", code: 1, userInfo: userInfo))
}
// check for errors
guard (error == nil) else {
completionHandlerForGET(result: false, error: error)
return
}
// check for successful 2xx response
guard let statusCode = (response as? NSHTTPURLResponse)?.statusCode where statusCode >= 200 && statusCode <= 299 else {
completionHandlerForGET(result: false, error: error)
return
}
// check to see if data was returned
guard let data = data else {
completionHandlerForGET(result: false, error: error)
return
}
// NEED TO SKIP THE FIRST 5 CHARACTERS OF THE UDACITY JSON RESPONSES
let range = NSMakeRange(5, data.length - 5)
let newData = data.subdataWithRange(range)
// parse the data and use the data
self.convertDataWithCompletionHandler(newData, completionHandlerForConvertData: completionHandlerForGET)
}
task.resume()
return task
}
func convertDataWithCompletionHandler(data: NSData, completionHandlerForConvertData: (result: AnyObject!, error: NSError?) -> Void) {
var parsedResult: AnyObject!
do {
parsedResult = try NSJSONSerialization.JSONObjectWithData(data, options: .AllowFragments)
} catch {
let userInfo = [NSLocalizedDescriptionKey: "Could not parse the data as JSON: '\(data)'"]
completionHandlerForConvertData(result: nil, error: NSError(domain: "convertDataWithCompletionHandler", code: 1, userInfo: userInfo))
}
completionHandlerForConvertData(result: parsedResult, error: nil)
}
func udacityURL(withPathExtension: String?) -> NSURL {
let components = NSURLComponents()
components.scheme = Constants.Udacity.ApiScheme
components.host = Constants.Udacity.ApiHost
components.path = Constants.Udacity.ApiPath + (withPathExtension ?? "")
return components.URL!
}
// MARK: Shared Instance
class func sharedInstance() -> UdacityClient {
struct Singleton {
static var sharedInstance = UdacityClient()
}
return Singleton.sharedInstance
}
}
|
[
-1
] |
25344dcba327dd84c25f33aef6bd17a1e2e3e963
|
7f17bb6e1107665e3428d127e61bc46c51b5a571
|
/ARKitLightEstimationDemo-master/ARKitLightEstimation/AppDelegate.swift
|
22e176ee9065c671c0b5a5805dea598435d1b8f1
|
[] |
no_license
|
fcu-d0409786/AR
|
85d45f2dd8666e6c64696362b4fdb3baac779dab
|
d8345e31e2051bdd03ee9ed45ee306373d0e927b
|
refs/heads/master
| 2020-03-13T20:00:10.958069 | 2018-04-30T08:04:07 | 2018-04-30T08:04:07 | 131,265,179 | 1 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,178 |
swift
|
//
// AppDelegate.swift
// ARKitLightDemo
//
// Created by Jayven Nhan on 1/25/18.
// Copyright © 2018 Jayven Nhan. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
}
|
[
229380,
229383,
229385,
278539,
294924,
229388,
278542,
229391,
327695,
229394,
278548,
229397,
229399,
229402,
352284,
229405,
278556,
278559,
229408,
278564,
294950,
229415,
229417,
327722,
237613,
229422,
360496,
229426,
237618,
229428,
311349,
286774,
286776,
319544,
286778,
229432,
204856,
352318,
286791,
237640,
286797,
278605,
311375,
163920,
237646,
196692,
319573,
311383,
278623,
278626,
319590,
311400,
278635,
303212,
278639,
131192,
278648,
237693,
303230,
327814,
303241,
131209,
417930,
303244,
311436,
319633,
286873,
286876,
311460,
311469,
32944,
327862,
286906,
327866,
180413,
286910,
131264,
286916,
295110,
286922,
286924,
286926,
319694,
286928,
131281,
278743,
278747,
295133,
155872,
319716,
237807,
303345,
286962,
303347,
131314,
229622,
327930,
278781,
278783,
278785,
237826,
319751,
278792,
286987,
319757,
311569,
286999,
319770,
287003,
287006,
287009,
287012,
287014,
287016,
287019,
311598,
287023,
262448,
311601,
295220,
287032,
155966,
319809,
319810,
278849,
319814,
311623,
319818,
311628,
229709,
319822,
287054,
278865,
229717,
196963,
196969,
139638,
213367,
106872,
319872,
311683,
319879,
311693,
65943,
319898,
311719,
278952,
139689,
278957,
311728,
278967,
180668,
311741,
278975,
319938,
278980,
98756,
278983,
319945,
278986,
319947,
278990,
278994,
311767,
279003,
279006,
188895,
172512,
287202,
279010,
279015,
172520,
319978,
279020,
172526,
311791,
279023,
172529,
279027,
319989,
172534,
180727,
164343,
279035,
311804,
287230,
279040,
303617,
287234,
279045,
172550,
303623,
172552,
287238,
320007,
279051,
172558,
279055,
303632,
279058,
303637,
279063,
279067,
172572,
279072,
172577,
295459,
172581,
295461,
279082,
311850,
279084,
172591,
172598,
279095,
172607,
172609,
172612,
377413,
172614,
213575,
172618,
303690,
33357,
287309,
303696,
279124,
172634,
262752,
254563,
172644,
311911,
189034,
295533,
172655,
172656,
352880,
295538,
189039,
172660,
287349,
189040,
189044,
287355,
287360,
295553,
172675,
295557,
287365,
311942,
303751,
352905,
279178,
287371,
311946,
311951,
287377,
172691,
287381,
311957,
221850,
287386,
230045,
172702,
164509,
303773,
172705,
287394,
172707,
303780,
287390,
287398,
205479,
279208,
287400,
172714,
295595,
279212,
189102,
172721,
287409,
66227,
303797,
189114,
287419,
303804,
328381,
287423,
328384,
172737,
279231,
287427,
312005,
312006,
107208,
172748,
287436,
107212,
172751,
287440,
295633,
172755,
303827,
279255,
172760,
287450,
303835,
279258,
189149,
303838,
213724,
312035,
279267,
295654,
279272,
230128,
312048,
312050,
230131,
189169,
205564,
303871,
230146,
328453,
295685,
230154,
33548,
312077,
295695,
295701,
230169,
369433,
295707,
328476,
295710,
230175,
295720,
303914,
279340,
205613,
279353,
230202,
312124,
328508,
222018,
295755,
377676,
148302,
287569,
303959,
230237,
279390,
230241,
279394,
303976,
336744,
303981,
303985,
328563,
303987,
279413,
303991,
303997,
295806,
295808,
295813,
304005,
320391,
213895,
304007,
304009,
304011,
230284,
304013,
295822,
279438,
213902,
189329,
295825,
304019,
189331,
58262,
304023,
304027,
279452,
410526,
279461,
279462,
304042,
213931,
230327,
304055,
287675,
197564,
230334,
304063,
238528,
304065,
213954,
189378,
156612,
295873,
213963,
197580,
312272,
304084,
304090,
320481,
304106,
320490,
312302,
328687,
320496,
304114,
295928,
320505,
312321,
295945,
230413,
295949,
197645,
320528,
140312,
295961,
238620,
197663,
304164,
304170,
304175,
238641,
312374,
238652,
238655,
230465,
238658,
336964,
296004,
205895,
320584,
238666,
296021,
402518,
336987,
230497,
296036,
296040,
361576,
205931,
296044,
279661,
205934,
164973,
312432,
279669,
337018,
189562,
279679,
304258,
279683,
222340,
66690,
205968,
296084,
238745,
304285,
238756,
205991,
222377,
165035,
337067,
238766,
165038,
230576,
238770,
304311,
230592,
312518,
279750,
230600,
230607,
148690,
320727,
279769,
304348,
279777,
304354,
296163,
320740,
279781,
304360,
320748,
279788,
279790,
304370,
296189,
320771,
312585,
296202,
296205,
230674,
320786,
230677,
296213,
296215,
320792,
230681,
214294,
304416,
230689,
173350,
312622,
296243,
312630,
222522,
296253,
222525,
296255,
312639,
230718,
296259,
378181,
296262,
230727,
238919,
296264,
320840,
296267,
296271,
222545,
230739,
312663,
222556,
337244,
230752,
312676,
230760,
173418,
148843,
410987,
230763,
230768,
296305,
312692,
230773,
304505,
304506,
279929,
181626,
181631,
148865,
312711,
312712,
296331,
288140,
288144,
230800,
304533,
337306,
288154,
288160,
173472,
288162,
288164,
279975,
304555,
370092,
279983,
173488,
288176,
279985,
312755,
296373,
312759,
279991,
288185,
337335,
222652,
312766,
173507,
296389,
222665,
230860,
312783,
288208,
230865,
288210,
370130,
288212,
222676,
148946,
288214,
239064,
288217,
329177,
280027,
288220,
288218,
239070,
288224,
280034,
288226,
280036,
288229,
280038,
288230,
288232,
370146,
288234,
320998,
288236,
288238,
288240,
288242,
296435,
288244,
288250,
296446,
321022,
402942,
148990,
296450,
206336,
230916,
230919,
214535,
230923,
304651,
304653,
370187,
230940,
222752,
108066,
296486,
296488,
157229,
239152,
230961,
157236,
288320,
288325,
124489,
280140,
280145,
288338,
280149,
288344,
280152,
239194,
280158,
403039,
370272,
181854,
239202,
312938,
280183,
280185,
280188,
280191,
116354,
280194,
280208,
280211,
288408,
280218,
280222,
419489,
190118,
198310,
321195,
296622,
321200,
337585,
296626,
296634,
296637,
419522,
313027,
280260,
419525,
206536,
280264,
206539,
206541,
206543,
263888,
313044,
280276,
321239,
280283,
313052,
18140,
288478,
313055,
419555,
321252,
313066,
288494,
280302,
280304,
313073,
321266,
288499,
419570,
288502,
280314,
288510,
124671,
67330,
280324,
198405,
288519,
280331,
198416,
280337,
296723,
116503,
321304,
329498,
296731,
321311,
313121,
313123,
304932,
321316,
280363,
141101,
165678,
280375,
321336,
296767,
288576,
345921,
280388,
337732,
304968,
280393,
280402,
173907,
313171,
313176,
42842,
280419,
321381,
296809,
296812,
313201,
1920,
255873,
305028,
280454,
247688,
280464,
124817,
280468,
239510,
280473,
124827,
214940,
247709,
214944,
280487,
313258,
321458,
296883,
124853,
214966,
296890,
10170,
288700,
296894,
190403,
296900,
280515,
337862,
165831,
280521,
231379,
296921,
354265,
354270,
239586,
313320,
354281,
231404,
124913,
165876,
321528,
239612,
313340,
288764,
239617,
313347,
288773,
313358,
305176,
321560,
313371,
354338,
305191,
223273,
313386,
354348,
124978,
215090,
124980,
288824,
288826,
321595,
378941,
313406,
288831,
288836,
67654,
280651,
354382,
288848,
280658,
215123,
354390,
288855,
288859,
280669,
313438,
149599,
280671,
149601,
321634,
149603,
223327,
329830,
280681,
313451,
223341,
280687,
149618,
215154,
313458,
280691,
313464,
329850,
321659,
280702,
288895,
321670,
215175,
141446,
141455,
141459,
280725,
313498,
100520,
288936,
280747,
288940,
288947,
280755,
321717,
280759,
280764,
280769,
280771,
280774,
280776,
313548,
321740,
280783,
280786,
280788,
313557,
280793,
280796,
280798,
338147,
280804,
280807,
157930,
280811,
280817,
125171,
157940,
280819,
182517,
280823,
280825,
280827,
280830,
280831,
280833,
125187,
280835,
125191,
125207,
125209,
321817,
125218,
321842,
223539,
125239,
280888,
305464,
280891,
289087,
280897,
280900,
305480,
239944,
280906,
239947,
305485,
305489,
379218,
280919,
248153,
354653,
354656,
313700,
280937,
313705,
190832,
280946,
223606,
313720,
280956,
239997,
280959,
313731,
199051,
240011,
289166,
240017,
297363,
190868,
240021,
297365,
297368,
297372,
141725,
297377,
289186,
297391,
289201,
240052,
289207,
289210,
305594,
281024,
289218,
289221,
289227,
281045,
281047,
215526,
166378,
305647,
281075,
174580,
240124,
281084,
305662,
305664,
240129,
305666,
305668,
223749,
240132,
281095,
223752,
150025,
338440,
330244,
223757,
281102,
223763,
223765,
281113,
322074,
281116,
281121,
182819,
281127,
281135,
150066,
158262,
158266,
289342,
281154,
322115,
158283,
281163,
281179,
338528,
338532,
281190,
199273,
281196,
19053,
158317,
313973,
297594,
281210,
158347,
264845,
182926,
133776,
314003,
117398,
314007,
289436,
174754,
330404,
289448,
133801,
174764,
314029,
314033,
240309,
133817,
314045,
314047,
314051,
199364,
297671,
158409,
256716,
289493,
363234,
289513,
289522,
289525,
289532,
322303,
289537,
322310,
264969,
322314,
322318,
281361,
281372,
322341,
215850,
281388,
289593,
281401,
289601,
281410,
281413,
281414,
240458,
281420,
240468,
281430,
322393,
297818,
281435,
281438,
281442,
174955,
224110,
207733,
207737,
158596,
183172,
240519,
322440,
314249,
338823,
183184,
142226,
289687,
240535,
297883,
289694,
289696,
289700,
289712,
281529,
289724,
52163,
183260,
281567,
289762,
322534,
297961,
183277,
281581,
322550,
134142,
322563,
314372,
330764,
175134,
322599,
322610,
314421,
281654,
314427,
314433,
207937,
314441,
207949,
322642,
314456,
281691,
314461,
281702,
281704,
314474,
281708,
281711,
289912,
248995,
306341,
306344,
306347,
322734,
306354,
142531,
199877,
289991,
306377,
289997,
249045,
363742,
363745,
298216,
330988,
126190,
216303,
322801,
388350,
257302,
363802,
199976,
199978,
314671,
298292,
298294,
257334,
216376,
380226,
298306,
224584,
224587,
224594,
216404,
306517,
150870,
314714,
224603,
159068,
314718,
265568,
314723,
281960,
150890,
306539,
314732,
314736,
290161,
216436,
306549,
298358,
314743,
306552,
290171,
314747,
306555,
290174,
298365,
224641,
281987,
298372,
314756,
281990,
224647,
265604,
298377,
314763,
142733,
298381,
314768,
224657,
306581,
314773,
314779,
314785,
314793,
282025,
282027,
241068,
241070,
241072,
282034,
241077,
150966,
298424,
306618,
282044,
323015,
306635,
306640,
290263,
290270,
290275,
339431,
282089,
191985,
282098,
290291,
282101,
241142,
191992,
290298,
151036,
290302,
282111,
290305,
175621,
306694,
192008,
323084,
257550,
282127,
290321,
282130,
323090,
290325,
282133,
241175,
290328,
282137,
290332,
241181,
282142,
282144,
290344,
306731,
290349,
290351,
290356,
282186,
224849,
282195,
282199,
282201,
306778,
159324,
159330,
314979,
298598,
323176,
224875,
241260,
323181,
257658,
315016,
282249,
290445,
324757,
282261,
175770,
298651,
282269,
323229,
298655,
323231,
61092,
282277,
306856,
196133,
282295,
282300,
323260,
323266,
282310,
323273,
282319,
306897,
241362,
306904,
282328,
298714,
52959,
216801,
282337,
241380,
216806,
323304,
282345,
12011,
282356,
323318,
282364,
282367,
306945,
241412,
323333,
282376,
216842,
323345,
282388,
323349,
282392,
184090,
315167,
315169,
282402,
315174,
323367,
241448,
315176,
241450,
282410,
306988,
306991,
315184,
323376,
315190,
241464,
159545,
282425,
298811,
118593,
307009,
413506,
307012,
241475,
298822,
315211,
282446,
307027,
315221,
323414,
315223,
241496,
241498,
307035,
307040,
110433,
282465,
241509,
110438,
298860,
110445,
282478,
315249,
110450,
315251,
282481,
315253,
315255,
339838,
315267,
282499,
315269,
241544,
282505,
241546,
241548,
298896,
298898,
282514,
241556,
44948,
298901,
241560,
282520,
241563,
241565,
241567,
241569,
282531,
241574,
282537,
298922,
36779,
241581,
282542,
241583,
323504,
241586,
282547,
241588,
290739,
241590,
241592,
241598,
290751,
241600,
241605,
151495,
241610,
298975,
241632,
298984,
241640,
241643,
298988,
241646,
241649,
241652,
323574,
290807,
299003,
241661,
299006,
282623,
315396,
241669,
315397,
282632,
307211,
282639,
290835,
282645,
241693,
282654,
241701,
102438,
217127,
282669,
323630,
282681,
290877,
282687,
159811,
315463,
315466,
192589,
307278,
192596,
176213,
307287,
307290,
217179,
315482,
192605,
315483,
233567,
299105,
200801,
217188,
299109,
307303,
315495,
356457,
45163,
307307,
315502,
192624,
307314,
323700,
299126,
233591,
299136,
307329,
315524,
307338,
233613,
241813,
307352,
299164,
241821,
299167,
315552,
184479,
184481,
315557,
184486,
307370,
307372,
184492,
307374,
307376,
299185,
323763,
184503,
176311,
299191,
307385,
307386,
307388,
258235,
307390,
176316,
299200,
184512,
307394,
299204,
307396,
184518,
307399,
323784,
233679,
307409,
307411,
176343,
299225,
233701,
307432,
184572,
282881,
184579,
282893,
323854,
291089,
282906,
291104,
233766,
295583,
176435,
307508,
315701,
332086,
307510,
307512,
168245,
307515,
307518,
282942,
282947,
323917,
110926,
282957,
233808,
323921,
315733,
323926,
233815,
315739,
323932,
299357,
242018,
242024,
299373,
315757,
250231,
242043,
315771,
299388,
299391,
291202,
299398,
242057,
291212,
299405,
291222,
315801,
283033,
242075,
291226,
194654,
61855,
291231,
283042,
291238,
291241,
127403,
127405,
291247,
299440,
127407,
299444,
127413,
283062,
291254,
127417,
291260,
283069,
127421,
127424,
299457,
127429,
127431,
127434,
315856,
176592,
127440,
315860,
176597,
283095,
127447,
299481,
127449,
176605,
242143,
127455,
127457,
291299,
340454,
127463,
242152,
291305,
127466,
176620,
127469,
127474,
291314,
291317,
127480,
135672,
291323,
233979,
127485,
291330,
127490,
283142,
127494,
135689,
233994,
127497,
127500,
291341,
233998,
127506,
234003,
127509,
234006,
127511,
152087,
283161,
242202,
234010,
135707,
242206,
135710,
242208,
291361,
242220,
291378,
234038,
152118,
234041,
315961,
70213,
242250,
111193,
242275,
299620,
242279,
168562,
184952,
135805,
291456,
135808,
373383,
299655,
135820,
316051,
225941,
316054,
299672,
135834,
373404,
299677,
225948,
135839,
299680,
225954,
299684,
135844,
242343,
209576,
242345,
373421,
135870,
135873,
135876,
135879,
299720,
299723,
299726,
225998,
226002,
119509,
226005,
226008,
299740,
242396,
201444,
299750,
283368,
234219,
283372,
226037,
283382,
316151,
234231,
234236,
226045,
242431,
234239,
209665,
234242,
299778,
242436,
226053,
234246,
226056,
234248,
291593,
242443,
234252,
242445,
234254,
291601,
234258,
242450,
242452,
234261,
348950,
201496,
234264,
234266,
234269,
283421,
234272,
234274,
152355,
299814,
234278,
283432,
234281,
234284,
234287,
283440,
185138,
242483,
234292,
234296,
234298,
160572,
283452,
234302,
234307,
242499,
234309,
292433,
316233,
234313,
316235,
234316,
283468,
234319,
242511,
234321,
234324,
185173,
201557,
234329,
234333,
308063,
234336,
242530,
349027,
234338,
234341,
234344,
234347,
177004,
234350,
324464,
234353,
152435,
177011,
234356,
234358,
234362,
226171,
234364,
291711,
234368,
291714,
234370,
291716,
234373,
201603,
226182,
234375,
308105,
226185,
234379,
324490,
234384,
234388,
234390,
324504,
234393,
209818,
308123,
324508,
234396,
291742,
226200,
234398,
234401,
291747,
291748,
234405,
291750,
234407,
324520,
324518,
324522,
234410,
291756,
226220,
291754,
324527,
291760,
234417,
201650,
324531,
234414,
234422,
226230,
275384,
324536,
234428,
291773,
242623,
324544,
234431,
234434,
324546,
324548,
226245,
234437,
234439,
226239,
234443,
291788,
234446,
275406,
193486,
234449,
316370,
193488,
234452,
234455,
234459,
234461,
234464,
234467,
234470,
168935,
5096,
324585,
234475,
234478,
316400,
234481,
316403,
234484,
234485,
234487,
324599,
234490,
234493,
316416,
234496,
308226,
234501,
275462,
308231,
234504,
234507,
234510,
234515,
300054,
316439,
234520,
234519,
234523,
234526,
234528,
300066,
234532,
300069,
234535,
234537,
234540,
144430,
234543,
234546,
275508,
300085,
234549,
300088,
234553,
234556,
234558,
316479,
234561,
316483,
160835,
234563,
308291,
234568,
234570,
316491,
234572,
300108,
234574,
300115,
234580,
234581,
242777,
234585,
275545,
234590,
234593,
234595,
234597,
300133,
234601,
300139,
234605,
160879,
234607,
275569,
234610,
316530,
300148,
234614,
398455,
144506,
234618,
234620,
275579,
234623,
226433,
234627,
275588,
234629,
242822,
234634,
234636,
177293,
234640,
275602,
234643,
308373,
226453,
234647,
275606,
275608,
234650,
308379,
234648,
300189,
324766,
119967,
234653,
324768,
283805,
234657,
242852,
300197,
234661,
283813,
234664,
177318,
275626,
234667,
316596,
308414,
234687,
300223,
300226,
308418,
234692,
300229,
308420,
308422,
226500,
283844,
300234,
283850,
300238,
300241,
316625,
300243,
300245,
316630,
300248,
300253,
300256,
300258,
300260,
234726,
300263,
300265,
300267,
161003,
300270,
300272,
120053,
300278,
275703,
316663,
300284,
275710,
300287,
292097,
300289,
161027,
300292,
300294,
275719,
234760,
177419,
300299,
242957,
300301,
283917,
177424,
275725,
349451,
349464,
415009,
283939,
259367,
292143,
283951,
300344,
226617,
243003,
283963,
226628,
300357,
283973,
177482,
283983,
316758,
357722,
316766,
292192,
316768,
218464,
292197,
316774,
243046,
218473,
284010,
136562,
324978,
275834,
333178,
275836,
275840,
316803,
316806,
226696,
316811,
226699,
316814,
226703,
300433,
234899,
300436,
226709,
357783,
316824,
316826,
144796,
300448,
144807,
144810,
144812,
284076,
144814,
144820,
374196,
284084,
292279,
284087,
144826,
144828,
144830,
144832,
144835,
144837,
38342,
144839,
144841,
144844,
144847,
144852,
144855,
103899,
300507,
333280,
226787,
218597,
292329,
300523,
259565,
300527,
308720,
259567,
292338,
226802,
227440,
316917,
308727,
292343,
300537,
316933,
316947,
308757,
308762,
284191,
316959,
284194,
284196,
235045,
284199,
284204,
284206,
284209,
284211,
194101,
284213,
316983,
194103,
284215,
308790,
284218,
226877,
292414,
284223,
284226,
284228,
292421,
226886,
284231,
128584,
243268,
284234,
276043,
317004,
366155,
284238,
226895,
284241,
194130,
284243,
300628,
284245,
276053,
284247,
317015,
284249,
243290,
284251,
276052,
284253,
300638,
284255,
235097,
243293,
284258,
292452,
292454,
284263,
177766,
284265,
292458,
284267,
292461,
284272,
284274,
284278,
292470,
276086,
292473,
284283,
276093,
284286,
292479,
284288,
292481,
284290,
325250,
284292,
292485,
325251,
276095,
276098,
284297,
317066,
284299,
317068,
284301,
276109,
284303,
284306,
276114,
284308,
284312,
284314,
284316,
276127,
284320,
284322,
284327,
284329,
317098,
284331,
276137,
284333,
284335,
276144,
284337,
284339,
300726,
284343,
284346,
284350,
276160,
358080,
284354,
358083,
284358,
276166,
358089,
284362,
276170,
284365,
276175,
284368,
276177,
284370,
358098,
284372,
317138,
284377,
276187,
284379,
284381,
284384,
358114,
284386,
358116,
276197,
317158,
358119,
284392,
325353,
358122,
284394,
284397,
358126,
284399,
358128,
276206,
358133,
358135,
276216,
358138,
300795,
358140,
284413,
358142,
358146,
317187,
284418,
317189,
317191,
284428,
300816,
300819,
317207,
284440,
300828,
300830,
276255,
300832,
325408,
300834,
317221,
227109,
358183,
186151,
276268,
300845,
243504,
300850,
284469,
276280,
325436,
358206,
276291,
366406,
276295,
300872,
292681,
153417,
358224,
284499,
276308,
178006,
317271,
284502,
276315,
292700,
317279,
284511,
227175,
292715,
300912,
292721,
284529,
300915,
284533,
292729,
317306,
284540,
292734,
325512,
169868,
276365,
317332,
358292,
284564,
284566,
399252,
350106,
284572,
276386,
284579,
276388,
358312,
317353,
284585,
276395,
292776,
292784,
276402,
358326,
161718,
358330,
276410,
276411,
276418,
276425,
301009,
301011,
301013,
292823,
358360,
301017,
301015,
292828,
276446,
153568,
276448,
276452,
292839,
276455,
292843,
276460,
292845,
276464,
178161,
227314,
276466,
325624,
276472,
317435,
276476,
276479,
276482,
276485,
317446,
276490,
350218,
292876,
350222,
317456,
276496,
317458,
178195,
243733,
243740,
317468,
317472,
325666,
243751,
292904,
276528,
243762,
309298,
325685,
325689,
235579,
325692,
235581,
178238,
276539,
276544,
284739,
325700,
243779,
292934,
243785,
276553,
350293,
350295,
309337,
194649,
227418,
350299,
350302,
227423,
350304,
178273,
309346,
194657,
194660,
350308,
309350,
309348,
292968,
309352,
227426,
276579,
227430,
276583,
309354,
301167,
276590,
350321,
350313,
350316,
284786,
350325,
252022,
276595,
350328,
292985,
301178,
350332,
292989,
301185,
292993,
350339,
317570,
317573,
350342,
350345,
350349,
301199,
317584,
325777,
350354,
350357,
350359,
350362,
350366,
276638,
284837,
153765,
350375,
350379,
350381,
350383,
129200,
350385,
350387,
350389,
350395,
350397,
350399,
227520,
350402,
227522,
301252,
350406,
227529,
301258,
309450,
276685,
309455,
276689,
309462,
301272,
276699,
194780,
309468,
309471,
301283,
317672,
317674,
325867,
243948,
194801,
309491,
227571,
309494,
243960,
276735,
227583,
227587,
276739,
211204,
276742,
227593,
227596,
325910,
309530,
342298,
211232,
317729,
276775,
211241,
325937,
325943,
211260,
260421,
276809,
285002,
276811,
235853,
276816,
235858,
276829,
276833,
391523,
276836,
293227,
276843,
293232,
276848,
186744,
211324,
227709,
285061,
366983,
317833,
178572,
285070,
285077,
178583,
227738,
317853,
276896,
317858,
342434,
285093,
317864,
285098,
276907,
235955,
276917,
293304,
293307,
293314,
309707,
293325,
317910,
293336,
235996,
317917,
293343,
358880,
276961,
227810,
293346,
276964,
293352,
236013,
293364,
301562,
293370,
317951,
309764,
301575,
121352,
293387,
236043,
342541,
317963,
113167,
55822,
309779,
317971,
309781,
277011,
55837,
227877,
227879,
293417,
227882,
309804,
293421,
105007,
236082,
285236,
23094,
277054,
244288,
219714,
129603,
301636,
318020,
301639,
301643,
277071,
285265,
399955,
309844,
277080,
309849,
285277,
285282,
326244,
318055,
277100,
309871,
121458,
277106,
170618,
170619,
309885,
309888,
277122,
227975,
277128,
285320,
301706,
318092,
326285,
334476,
318094,
277136,
277139,
227992,
334488,
318108,
285340,
318110,
227998,
137889,
383658,
285357,
318128,
277170,
293555,
342707,
154292,
318132,
277173,
277177,
277181,
318144,
277187,
277191,
277194,
277196,
277201,
342745,
137946,
342747,
342749,
113378,
203491,
228069,
277223,
342760,
285417,
56041,
56043,
277232,
228081,
56059,
310015,
285441,
310020,
285448,
310029,
228113,
285459,
277273,
293659,
326430,
228128,
285474,
293666,
228135,
318248,
277291,
318253,
293677,
285489,
301876,
293685,
285494,
301880,
285499,
301884,
310080,
293696,
277317,
277322,
293706,
277329,
162643,
310100,
301911,
301913,
277337,
301921,
400236,
236397,
162671,
326514,
310134,
236408,
15224,
277368,
416639,
416640,
113538,
310147,
416648,
39817,
187274,
277385,
301972,
424853,
277405,
277411,
310179,
293798,
293802,
236460,
277426,
293811,
293817,
293820,
203715,
326603,
342994,
276586,
293849,
293861,
228327,
228328,
318442,
228330,
228332,
326638,
277486,
351217,
318450,
293876,
293877,
285686,
302073,
121850,
293882,
302075,
285690,
244731,
293887,
277504,
277507,
277511,
293899,
277519,
293908,
302105,
293917,
293939,
318516,
277561,
277564,
310336,
7232,
293956,
277573,
228422,
293960,
310344,
277577,
277583,
203857,
293971,
310355,
310359,
236632,
277594,
138332,
277598,
203872,
277601,
285792,
310374,
203879,
310376,
228460,
318573,
203886,
187509,
285815,
367737,
285817,
302205,
285821,
392326,
285831,
253064,
294026,
302218,
285835,
162964,
384148,
187542,
302231,
285849,
302233,
285852,
302237,
285854,
285856,
302241,
285862,
277671,
302248,
64682,
277678,
294063,
294065,
302258,
277687,
294072,
318651,
294076,
277695,
318657,
244930,
302275,
130244,
302277,
228550,
302282,
310476,
302285,
302288,
310481,
302290,
203987,
302292,
302294,
310486,
302296,
384222,
310498,
285927,
318698,
302315,
195822,
228592,
294132,
138485,
228601,
204026,
228606,
204031,
64768,
310531,
285958,
138505,
228617,
318742,
204067,
277798,
130345,
277801,
113964,
285997,
277804,
285999,
277807,
113969,
277811,
318773,
318776,
277816,
286010,
277819,
294204,
417086,
277822,
286016,
302403,
294211,
384328,
277832,
277836,
294221,
294223,
326991,
277839,
277842,
277847,
277850,
179547,
277853,
146784,
277857,
302436,
277860,
294246,
327015,
310632,
327017,
351594,
277864,
277869,
277872,
351607,
310648,
277880,
310651,
277884,
277888,
310657,
351619,
294276,
310659,
327046,
277892,
253320,
310665,
318858,
277894,
277898,
277903,
310672,
351633,
277905,
277908,
277917,
310689,
277921,
130468,
228776,
277928,
277932,
310703,
277937,
310710,
130486,
310712,
277944,
310715,
277947,
302526,
228799,
277950,
277953,
302534,
310727,
64966,
245191,
163272,
277959,
277963,
302541,
277966,
302543,
310737,
277971,
228825,
163290,
277978,
310749,
277981,
277984,
310755,
277989,
277991,
187880,
277995,
310764,
286188,
278000,
228851,
310772,
278003,
278006,
40440,
212472,
278009,
40443,
286203,
310780,
40448,
228864,
286214,
228871,
302603,
65038,
302614,
286233,
302617,
302621,
286240,
146977,
187939,
40484,
294435,
40486,
286246,
294440,
40488,
294439,
294443,
40491,
294445,
278057,
310831,
245288,
286248,
40499,
40502,
212538,
40507,
40511,
40513,
228933,
327240,
40521,
286283,
40525,
40527,
212560,
400976,
228944,
40533,
147032,
40537,
40539,
40541,
278109,
40544,
40548,
40550,
40552,
286313,
40554,
286312,
310892,
40557,
40560,
188022,
122488,
294521,
343679,
294537,
310925,
286354,
278163,
302740,
122517,
278168,
179870,
327333,
229030,
212648,
278188,
302764,
278192,
319153,
278196,
302781,
319171,
302789,
294599,
278216,
294601,
302793,
343757,
212690,
319187,
278227,
286420,
229076,
286425,
319194,
278235,
301163,
278238,
229086,
286432,
294625,
294634,
302838,
319226,
286460,
278274,
302852,
278277,
302854,
294664,
311048,
352008,
319243,
311053,
302862,
319251,
294682,
278306,
188199,
294701,
278320,
319280,
319290,
229192,
302925,
188247,
280021,
188252,
237409,
229233,
294776,
360317,
294785,
327554,
360322,
40840,
40851,
294803,
188312,
294811,
237470,
319390,
40865,
319394,
294817,
294821,
311209,
180142,
343983,
294831,
188340,
40886,
319419,
294844,
294847,
393177,
294876,
294879,
294883,
393190,
294890,
311279,
278513,
237555,
278516,
311283,
278519,
237562
] |
a6f22edfd05a2b7dec2e812bddb2c2fa790fe9f6
|
fd698b365537d208d1bff275b51117d29dee4208
|
/Flixy/Views/MovieCell.swift
|
49d4f871932a0b2f2f6216b254dd4d57fe5adade
|
[
"Apache-2.0"
] |
permissive
|
Aaivazi000/Flixy
|
bb9057bdce812512b70110f289c5ca5951eba13f
|
91b2f2ab54420765b86adbd1490ad0f221e9380a
|
refs/heads/master
| 2020-03-29T20:56:58.145646 | 2018-11-02T01:22:58 | 2018-11-02T01:22:58 | 150,338,857 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 662 |
swift
|
//
// MovieCell.swift
// Flixy
//
// Created by Andriana Aivazians on 9/27/18.
// Copyright © 2018 Andriana Aivazians. All rights reserved.
//
import UIKit
class MovieCell: UITableViewCell {
//UI Declarations
@IBOutlet weak var titleLabel: UILabel!
@IBOutlet weak var overviewLabel: UILabel!
@IBOutlet weak var posterImageView: UIImageView!
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
}
|
[
300800,
277121,
300801,
300802,
348935,
266376,
418826,
328211,
276756,
288149,
158740,
123678,
345633,
345634,
328228,
349477,
337321,
110387,
64691,
303540,
312761,
300988,
311755,
312531,
312535,
317020,
339039,
369380,
213098,
330605,
237551,
179567,
213105,
14578,
222836,
244599,
213115,
242301,
201727
] |
4a7ad0919c10062eb347fae2609cdea916aae37a
|
835780970682c45997429d10d85f36cd0e88b8d2
|
/IOS-Project-Assigment/Controllers/InitialViewController.swift
|
29ddcff878cb29718f64b69cec4e09b26d55cda0
|
[] |
no_license
|
Y-Nots/IOS-Assignment
|
9d95b153d5d34d6040b9db080ea02f4fa5d4173d
|
ac3febfd453ae7464bf2d013f586bb3f3747aa9a
|
refs/heads/master
| 2020-05-25T17:02:27.833157 | 2019-05-31T08:11:46 | 2019-05-31T08:11:46 | 187,900,403 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 655 |
swift
|
import Foundation
import UIKit
class InitialViewController: UIViewController {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
//- Todo: Check if user is authenticated. If so, segue to the HomeViewController, otherwise, segue to the MenuViewController
self.performSegue(withIdentifier: "toMenuScreen", sender: self)
}
override var preferredStatusBarStyle: UIStatusBarStyle {
get {
return .lightContent
}
}
}
|
[
-1
] |
a95b94e87de63dbfb0e89b191ee0b5bc3e985c40
|
63638dd8deafcf7e7c2998deeb5d917f2caf2b5a
|
/Stocks/Stocks/Managers/HapticsManager.swift
|
c1b20cd55321d585f9bb0b9a12eca9001e66887c
|
[
"MIT"
] |
permissive
|
Seneza/Stocks-iOS-App
|
5148b63521f303a0cf0dc4ae5ed22fa89f3bec2a
|
d844302d8c29709972867e6ddefcb5acf4e81ac2
|
refs/heads/main
| 2023-08-14T10:10:23.297403 | 2021-09-28T05:25:55 | 2021-09-28T05:25:55 | 410,118,524 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 419 |
swift
|
//
// HapticsManager.swift
// Stocks
//
// Created by Gaston Seneza on 9/26/21.
//
import Foundation
import UIKit
final class HapticsManager {
static let shared = HapticsManager()
private init() {}
//MARK: - Public
public func vibrateForSelection() {
//Vibrate lightly for selection tap interaction in this function
}
public func vibrateForType() {
}
}
|
[
-1
] |
054d34722bf69d69ad9fe7fdcf2ee76964c7580a
|
a90d6e12a3aade599f1cb6d8788f66fdc7277905
|
/Playground/Exercise Files/Ch08/08_03.playground/Contents.swift
|
5541ab2cb32370201848d47eed734b10bfb64562
|
[] |
no_license
|
andreyfilyakov/ios-training-internship
|
1f5203e563413e79ff8c9d3d21ef8dcde09cd97d
|
1e233d6de6526a2bbc230c5eb4a743b60115c120
|
refs/heads/master
| 2020-03-07T10:19:22.679167 | 2018-10-19T12:19:50 | 2019-01-21T21:15:33 | 127,422,655 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,128 |
swift
|
import UIKit
class MyClass {
// Properties, initializers, deinitializers, methods, subscripts
}
class ElectricVehicle {
// Type properties
static var count = 0
// Instance properties
var passengerCapacity = 4
let zeroTo60: Float
var color: UIColor
// Initializers
init(passengers: Int, zeroTo60: Float, color: UIColor = #colorLiteral(red: 0, green: 0, blue: 0, alpha: 1)) {
passengerCapacity = passengers
self.zeroTo60 = zeroTo60
self.color = color
ElectricVehicle.count += 1
}
convenience init(zeroTo60: Float) {
self.init(passengers: 4, zeroTo60: zeroTo60)
}
convenience init() {
self.init(zeroTo60: 6.0)
}
// Deinitializer
deinit {
ElectricVehicle.count -= 1
}
}
let teslaModelS = ElectricVehicle(passengers: 4, zeroTo60: 2.5)
var teslaModel3: ElectricVehicle? = ElectricVehicle()
teslaModel3 = nil
ElectricVehicle.count
let p100d = teslaModelS
p100d.color = #colorLiteral(red: 0.1764705926, green: 0.4980392158, blue: 0.7568627596, alpha: 1)
teslaModelS.color
|
[
-1
] |
5adc0c53fd261b3b062b872124521658e79b7d3c
|
358817c5985369b72fe48a298bf6a8886ee65b1f
|
/AR/ARMeasureKit/ARMeasureKit/ViewController.swift
|
b6464c3eb1782c157cd280aac052ddd2c5d2005a
|
[
"MIT"
] |
permissive
|
miguelius/practice-swift
|
16310e8188aac2c79fb984ee4dc36d5ae69ee450
|
0ee3618fee2b2701f27e0f50f995eddc892f030f
|
refs/heads/master
| 2021-05-13T14:37:39.692460 | 2017-08-25T16:49:59 | 2017-08-25T16:49:59 | 116,742,836 | 1 | 0 | null | 2018-01-09T00:05:51 | 2018-01-09T00:05:51 | null |
UTF-8
|
Swift
| false | false | 9,708 |
swift
|
//
// ViewController.swift
// ARMeasureKit
//
// Created by Domenico Solazzo on 8/21/17.
// Copyright © 2017 Domenico Solazzo. All rights reserved.
//
import UIKit
import SceneKit
import ARKit
class ViewController: UIViewController, ARSCNViewDelegate {
@IBOutlet var sceneView: ARSCNView!
private var distanceLabel = UILabel()
private var trackingStateLabel = UILabel()
private var startNode: SCNNode?
private var endNode: SCNNode?
var dragOnInfinitePlanesEnabled = false
override func viewDidLoad() {
super.viewDidLoad()
// Set the view's delegate
sceneView.delegate = self
// Show statistics such as fps and timing information
sceneView.showsStatistics = true
// Adding tap gesture
let tapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(ViewController.handleTapGesture))
view.addGestureRecognizer(tapGestureRecognizer)
distanceLabel.text = "Distance: ?"
distanceLabel.textColor = .red
distanceLabel.frame = CGRect(x: 5, y: 5, width: 150, height: 25)
view.addSubview(distanceLabel)
trackingStateLabel.frame = CGRect(x: 5, y: 35, width: 300, height: 25)
view.addSubview(trackingStateLabel)
setupFocusSquare()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
// Create a session configuration
let configuration = ARWorldTrackingSessionConfiguration()
// Run the view's session
sceneView.session.run(configuration)
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
// Pause the view's session
sceneView.session.pause()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Release any cached data, images, etc that aren't in use.
}
/**
* Calculating the distance using the Three-dimensional Euclidean distance formula
* Reference: https://en.wikipedia.org/wiki/Euclidean_distance
**/
func distance(startNode: SCNNode, endNode: SCNNode) -> Float {
let vector = SCNVector3Make(startNode.position.x - endNode.position.x, startNode.position.y - endNode.position.y, startNode.position.z - endNode.position.z)
// Scene units map to meters in ARKit.
return sqrtf(vector.x * vector.x + vector.y * vector.y + vector.z * vector.z)
}
func getCurrentFrame() -> ARFrame? {
guard let currentFrame = sceneView.session.currentFrame else {
return nil
}
return currentFrame
}
/**
* Reset the UI. It will reset both startNode and endNode and the distanceLabel
* Check if the endNode has been set already before resetting...
**/
func resetUI(){
// Reset
if let endNode = endNode {
// Reset
startNode?.removeFromParentNode()
self.startNode = nil
endNode.removeFromParentNode()
self.endNode = nil
distanceLabel.text = "Distance = ?"
return
}
}
/**
* Create a new SceneKit node with a sphere shape at a given position.
**/
func createAnchorNode() -> SCNNode{
let sphere = SCNSphere(radius: 0.002)
sphere.firstMaterial?.diffuse.contents = UIColor.blue
sphere.firstMaterial?.lightingModel = .constant
sphere.firstMaterial?.isDoubleSided = true
let node = SCNNode(geometry: sphere)
return node
}
/**
* Create a new SceneKit node with a sphere shape at a given position.
**/
func createAnchorNodeAt(position: SCNVector3) -> SCNNode{
let node = self.createAnchorNode()
node.position = position
return node
}
/**
* Setting the node to either startNode or endNode
**/
func settingNode(node:SCNNode){
if self.startNode != nil {
self.endNode = node
}else{
self.startNode = node
}
}
/**
* Check if the start node has been already set
**/
func isStartNodeAvailable() -> Bool {
if self.startNode != nil {
return true
}
return false
}
/**
* Check if the end node has been already set
**/
func isEndNodeAvailable() -> Bool {
if self.endNode != nil {
return true
}
return false
}
func createFormatter() -> NumberFormatter {
let formatter = NumberFormatter()
formatter.numberStyle = .decimal
formatter.roundingMode = .ceiling
formatter.maximumFractionDigits = 2
return formatter
}
func calculateDistance(useEuclideanDistance: Bool) -> Float{
if (useEuclideanDistance){
return distance(startNode: self.startNode!, endNode: self.endNode!)
}else{
let vector = (self.startNode?.position)! - (self.endNode?.position)!
return vector.length()
}
}
func executeHitTest(){
guard let currentFrame = self.getCurrentFrame() else {
return
}
let planeHitTestResults = sceneView.hitTest(view.center, types: .existingPlaneUsingExtent)
if let result = planeHitTestResults.first {
let hitPosition = SCNVector3.positionFromTransform(result.worldTransform)
// Create the node to add to the scene
let node = self.createAnchorNodeAt(position: hitPosition)
sceneView.scene.rootNode.addChildNode(node)
self.settingNode(node: node)
if self.isStartNodeAvailable() && self.isEndNodeAvailable() {
let formatter = self.createFormatter()
let distanceLength = self.calculateDistance(useEuclideanDistance: false)
// Scene units map to meters in ARKit.
distanceLabel.text = "Distance: " + formatter.string(from: NSNumber(value: distanceLength))! + " m"
}
}
else {
// Create a transform with a translation of 0.1 meters (10 cm) in front of the camera
var translation = matrix_identity_float4x4
translation.columns.3.z = -0.1
// Add a node to the session
let node = self.createAnchorNode()
node.simdTransform = simd_mul(currentFrame.camera.transform, translation)
sceneView.scene.rootNode.addChildNode(node)
self.settingNode(node: node)
if self.isStartNodeAvailable() && self.isEndNodeAvailable() {
let distanceLength = self.calculateDistance(useEuclideanDistance: true)
self.distanceLabel.text = String(format: "%.2f", distanceLength) + "m"
}
}
}
@objc func handleTapGesture(sender: UITapGestureRecognizer) {
if sender.state != .ended {
return
}
self.resetUI()
self.executeHitTest()
}
// MARK: - ARSCNViewDelegate
func renderer(_ renderer: SCNSceneRenderer, updateAtTime time: TimeInterval) {
DispatchQueue.main.async {
self.updateFocusSquare()
}
}
func session(_ session: ARSession, cameraDidChangeTrackingState camera: ARCamera) {
switch camera.trackingState {
case .notAvailable:
trackingStateLabel.text = "Tracking not available"
trackingStateLabel.textColor = .red
case .normal:
trackingStateLabel.text = "Tracking normal"
trackingStateLabel.textColor = .green
case .limited(let reason):
switch reason {
case .excessiveMotion:
trackingStateLabel.text = "Tracking limited: excessive motion"
case .insufficientFeatures:
trackingStateLabel.text = "Tracking limited: insufficient features"
case .none:
trackingStateLabel.text = "Tracking limited"
case .initializing:
trackingStateLabel.text = "Tracking limited: initializing"
}
trackingStateLabel.textColor = .yellow
}
}
// MARK: - Focus Square
var focusSquare = FocusSquare()
func setupFocusSquare() {
focusSquare.unhide()
focusSquare.removeFromParentNode()
sceneView.scene.rootNode.addChildNode(focusSquare)
}
func updateFocusSquare() {
let (worldPosition, planeAnchor, _) = worldPositionFromScreenPosition(view.center, objectPos: focusSquare.position)
if let worldPosition = worldPosition {
focusSquare.update(for: worldPosition, planeAnchor: planeAnchor, camera: sceneView.session.currentFrame?.camera)
}
}
/*
// Override to create and configure nodes for anchors added to the view's session.
func renderer(_ renderer: SCNSceneRenderer, nodeFor anchor: ARAnchor) -> SCNNode? {
let node = SCNNode()
return node
}
*/
func session(_ session: ARSession, didFailWithError error: Error) {
// Present an error message to the user
}
func sessionWasInterrupted(_ session: ARSession) {
// Inform the user that the session has been interrupted, for example, by presenting an overlay
}
func sessionInterruptionEnded(_ session: ARSession) {
// Reset tracking and/or remove existing anchors if consistent tracking is required
}
}
|
[
-1
] |
b245e223cea18fa5ba9714bcd710332670e95da1
|
d95fa812c0ee2becc66810a7429223eeb7bb135c
|
/Slate/Custom Cells/PicturesCollectionViewCell.swift
|
7a4050d33e3e58b7e836f7b1a342c1c179f29e15
|
[] |
no_license
|
timmyvc123/Slate
|
2c702c804001f027da130611a785ed3ab2984456
|
84548fa62acc7ebed3972b5d0f536e60342e8113
|
refs/heads/master
| 2021-08-06T19:53:36.921292 | 2021-07-08T16:47:29 | 2021-07-08T16:47:29 | 214,065,596 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 381 |
swift
|
//
// PicturesCollectionViewCell.swift
// PenPals
//
// Created by Tim Van Cauwenberge on 4/1/20.
// Copyright © 2020 SeniorProject. All rights reserved.
//
import UIKit
class PicturesCollectionViewCell: UICollectionViewCell {
@IBOutlet weak var imageView: UIImageView!
func generateCell(image: UIImage) {
self.imageView.image = image
}
}
|
[
-1
] |
3aba97d4a1407d84b1ad1130d2be390c8f5502cb
|
a09d4873186bee0bf12039c44bd7255b03497f55
|
/Surf/Classes/Presentation/ChatScreen/Views/ChatTableView/Cells/MyChatImageCell.swift
|
f72f04364ffc7ef2b9cb555185efb4b255004b0a
|
[] |
no_license
|
AgentChe/Surf
|
f86af0cc390796de4cb6019e04a2ca234bff4d13
|
982e20851ea46ab3f9451f49f67d3ca11dcf172e
|
refs/heads/master
| 2022-12-08T21:08:11.248890 | 2020-09-09T17:31:01 | 2020-09-09T17:31:01 | 278,627,017 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,009 |
swift
|
//
// MyChatImageCell.swift
// FAWN
//
// Created by Andrey Chernyshev on 08/06/2020.
// Copyright © 2020 Алексей Петров. All rights reserved.
//
import UIKit
import Kingfisher
final class MyChatImageCell: MessageTableCell {
lazy var messageImageView = makeImageView()
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
contentView.backgroundColor = .white
makeConstraints()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func bind(message: Message) {
super.bind(message: message)
messageImageView.kf.cancelDownloadTask()
messageImageView.image = nil
if let url = URL(string: message.body) {
messageImageView.kf.setImage(with: url)
}
}
}
// MARK: Make constraints
private extension MyChatImageCell {
func makeConstraints() {
NSLayoutConstraint.activate([
messageImageView.trailingAnchor.constraint(equalTo: contentView.trailingAnchor, constant: -16.scale),
messageImageView.topAnchor.constraint(equalTo: contentView.topAnchor, constant: 6.scale),
messageImageView.bottomAnchor.constraint(equalTo: contentView.bottomAnchor, constant: -6.scale),
messageImageView.leadingAnchor.constraint(equalTo: contentView.leadingAnchor, constant: 80.scale),
messageImageView.heightAnchor.constraint(equalToConstant: 196.scale)
])
}
}
// MARK: Lazy initialization
private extension MyChatImageCell {
func makeImageView() -> UIImageView {
let view = UIImageView()
view.layer.cornerRadius = 18.scale
view.clipsToBounds = true
view.contentMode = .scaleAspectFit
view.translatesAutoresizingMaskIntoConstraints = false
contentView.addSubview(view)
return view
}
}
|
[
-1
] |
3091b50b333482291ec5caf3196f600c7b0600bf
|
68b0644e8560abb95a6e20d43d291e82a162fd54
|
/LearnCleanArchitecture/Extension/UIViewController+.swift
|
cb5cf4bd7aabca64f4a69f270338d132fc9b5dff
|
[] |
no_license
|
TranXuanThien/LearnCleanArchitecture
|
c16b842d878d39aabcf96b050789be7a4e03b328
|
46b1a1b6f97ef0f468c0f4c6423c899ddd6aab74
|
refs/heads/master
| 2020-03-27T15:35:10.932966 | 2018-09-06T12:10:35 | 2018-09-06T12:10:35 | 146,726,959 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 185 |
swift
|
//
// UIViewController+.swift
// LearnCleanArchitecture
//
// Created by tran.xuan.thien on 8/7/18.
// Copyright © 2018 tran.xuan.thien. All rights reserved.
//
import Foundation
|
[
-1
] |
89449d53e91ba32d472898061f10693ea0ee579f
|
6d3340ed14efb487086f065860e56f5c692388d5
|
/Sources/SwiftDependencyInjection/Injector+Component.swift
|
b855df9fcb5fadf4629cf5588ee7ba97e30db52c
|
[
"MIT"
] |
permissive
|
AbyssAlora/SwiftDependencyInjection
|
0021569fc5981c08f0265877b7d7442682fbb529
|
aea9246f0a1b54b790ebc603b9bd95f3c41fc60d
|
refs/heads/master
| 2023-02-02T19:00:17.566262 | 2020-12-20T22:49:02 | 2020-12-20T22:49:02 | 276,071,893 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 129 |
swift
|
//
// Created by Abyss Alora on 07/07/2020.
//
import Foundation
public extension Injector {
typealias Component = Module
}
|
[
-1
] |
4f691de48f9895b3343dfa154618b1e377100c2a
|
a4ac43c5a88b4b34e37ef2cc00032aeffc47ff17
|
/NavDemo/NavDemo/AppDelegate.swift
|
db8c8350abe109c2a68e03dee0c2ca2669eb4fbe
|
[] |
no_license
|
donmiller/360iDev2020
|
2c2f43e581cb32dfac614b2023cce19bea21a477
|
be74605e5e0bddfaee7c260055b99e6c35156491
|
refs/heads/master
| 2022-12-04T17:16:37.457235 | 2020-08-19T03:31:48 | 2020-08-19T03:31:48 | 288,032,305 | 1 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,413 |
swift
|
//
// AppDelegate.swift
// NavDemo
//
// Created by Don Miller on 8/15/20.
// Copyright © 2020 GroundSpeed. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
// MARK: UISceneSession Lifecycle
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
// Called when a new scene session is being created.
// Use this method to select a configuration to create the new scene with.
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
// Called when the user discards a scene session.
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
}
}
|
[
393222,
393224,
393230,
393250,
344102,
393261,
393266,
163891,
213048,
376889,
385081,
393275,
376905,
327756,
254030,
286800,
368727,
180313,
368735,
180320,
376931,
286831,
286844,
417924,
262283,
286879,
286888,
377012,
327871,
180416,
377036,
180431,
377046,
377060,
327914,
205036,
393456,
393460,
336123,
418043,
385280,
262404,
180490,
368911,
262416,
262422,
262436,
336180,
262454,
393538,
262472,
213332,
65880,
262496,
418144,
262499,
213352,
246123,
262510,
213372,
385419,
393612,
262550,
262552,
385440,
385443,
385451,
262573,
393647,
385458,
262586,
344511,
262592,
360916,
369118,
328177,
328179,
328182,
328189,
328192,
164361,
328206,
410128,
393747,
254490,
188958,
385570,
377383,
352821,
188987,
369223,
385609,
385616,
352856,
352864,
369253,
262760,
352874,
254587,
377472,
336512,
148105,
352918,
98968,
361129,
385713,
164534,
336567,
328378,
328386,
352968,
352971,
418507,
352973,
385742,
361179,
189153,
369381,
361195,
418553,
344831,
336659,
418580,
418585,
434970,
369435,
418589,
262942,
418593,
336675,
328484,
418605,
336696,
361273,
328515,
336708,
328519,
336711,
328522,
336714,
426841,
254812,
361309,
361315,
361322,
328573,
377729,
222128,
345035,
386003,
345043,
386011,
386018,
386022,
435187,
328702,
328714,
361489,
386069,
336921,
386073,
336925,
345118,
377887,
345133,
345138,
386101,
197707,
189520,
345169,
156761,
361567,
345199,
361593,
410745,
214149,
386186,
337047,
345246,
214175,
337071,
337075,
345267,
386258,
328924,
328941,
386285,
345376,
345379,
410917,
337205,
345399,
378169,
369978,
337222,
337229,
337234,
263508,
402791,
345448,
271730,
378227,
181638,
353673,
181643,
181649,
181654,
181670,
337329,
181681,
181684,
181690,
361917,
181696,
337349,
181703,
337365,
271839,
361960,
329194,
116210,
337398,
329226,
419339,
419343,
419349,
345625,
419355,
370205,
419359,
419362,
394786,
370213,
419368,
419376,
206395,
214593,
419400,
419402,
353867,
419406,
419410,
345701,
394853,
222830,
370297,
353919,
403075,
198280,
403091,
345749,
345757,
345762,
419491,
345765,
419497,
419501,
370350,
419509,
337592,
419512,
337599,
419527,
419530,
419535,
272081,
394966,
419542,
419544,
181977,
345818,
419547,
419550,
419559,
337642,
419563,
337645,
370415,
141051,
337659,
337668,
395021,
362255,
321299,
116509,
345887,
378663,
345905,
354111,
247617,
354117,
370503,
329544,
370509,
354130,
247637,
337750,
313180,
354142,
345970,
345974,
403320,
354172,
247691,
337808,
247700,
329623,
436126,
436132,
337833,
362413,
337844,
346057,
247759,
346063,
329697,
354277,
247789,
354313,
346139,
436289,
378954,
338004,
100453,
329832,
329855,
329867,
329885,
346272,
362660,
100524,
387249,
379066,
256191,
395466,
346316,
411861,
411864,
411868,
411873,
379107,
411876,
346343,
338152,
387306,
387312,
346355,
436473,
321786,
379134,
411903,
379152,
395538,
338199,
387352,
182558,
338211,
248111,
362822,
190796,
321879,
379233,
354673,
321910,
420236,
379278,
272786,
354727,
338352,
330189,
338381,
338386,
256472,
338403,
338409,
248308,
199164,
330252,
199186,
330267,
354855,
10828,
199249,
174695,
248425,
191084,
338543,
346742,
354974,
150183,
174774,
248504,
174777,
223934,
273108,
264918,
183005,
338660,
338664,
264941,
363251,
207619,
338700,
256786,
199452,
363293,
396066,
346916,
396069,
215853,
355122,
355131,
355140,
355143,
338763,
355150,
330580,
355166,
355175,
387944,
355179,
330610,
330642,
412599,
207808,
379848,
396245,
248792,
248798,
347105,
257008,
183282,
330748,
330760,
330768,
248862,
158761,
199728,
330800,
396336,
396339,
339001,
388161,
347205,
248904,
330826,
248914,
339036,
412764,
257120,
248951,
420984,
330889,
248985,
339097,
44197,
380070,
339112,
249014,
330958,
330965,
388347,
175375,
159005,
175396,
208166,
273708,
372015,
347441,
372018,
199988,
44342,
175415,
396600,
437566,
175423,
437570,
437575,
437583,
331088,
331093,
396633,
175450,
437595,
175457,
208227,
175460,
175463,
437620,
175477,
249208,
175483,
175486,
249214,
175489,
249218,
249227,
249234,
175513,
175516,
396705,
175522,
355748,
380332,
396722,
208311,
372163,
216517,
380360,
216522,
339404,
372176,
208337,
339412,
413141,
339417,
249308,
339420,
339424,
339428,
339434,
69113,
372228,
339461,
208398,
380432,
339503,
265778,
265795,
396872,
265805,
224853,
224857,
257633,
372327,
372337,
224884,
224887,
224890,
224894,
224897,
216707,
339588,
126596,
421508,
159374,
11918,
339601,
126610,
224913,
224916,
224919,
126616,
224922,
224929,
224932,
257704,
224936,
224942,
257712,
257716,
257720,
257724,
257732,
339662,
257747,
224993,
257761,
224999,
339695,
257787,
225020,
339710,
257790,
225025,
257794,
339721,
257801,
257804,
225038,
257807,
225043,
167700,
372499,
257819,
225053,
184094,
225058,
257833,
225066,
257836,
413484,
225070,
225073,
372532,
257845,
397112,
225082,
397115,
225087,
225092,
323402,
257868,
225103,
257871,
397139,
225108,
225112,
257883,
225119,
257890,
257896,
274280,
257901,
225137,
257908,
225141,
257912,
257916,
257920,
339844,
225165,
397200,
225170,
380822,
225180,
118691,
184244,
372664,
372702,
356335,
380918,
405533,
430129,
266294,
266297,
217157,
421960,
356439,
430180,
266350,
381068,
225423,
250002,
250004,
225429,
356506,
225437,
135327,
225441,
438433,
225444,
438436,
225447,
438440,
225450,
258222,
225455,
430256,
225458,
225461,
225466,
225470,
381120,
430274,
225475,
225484,
225487,
225490,
225493,
266453,
225496,
225499,
225502,
356578,
217318,
225510,
225514,
225518,
372976,
381176,
389380,
61722,
356637,
356640,
356643,
356646,
266536,
356649,
356655,
332080,
340275,
356660,
397622,
332090,
332097,
201028,
348488,
332106,
250199,
250202,
332125,
250210,
348525,
332152,
250238,
356740,
332172,
340379,
389550,
266687,
340451,
160234,
340472,
324094,
266754,
324099,
324102,
324111,
340500,
324117,
324131,
332324,
381481,
324139,
356907,
324142,
356916,
324149,
324155,
348733,
324160,
324164,
356934,
381512,
324170,
324173,
324176,
389723,
332380,
340627,
184982,
373398,
258721,
332453,
332459,
332463,
381617,
332471,
332483,
332486,
373449,
332493,
357069,
357073,
332511,
332520,
340718,
332533,
348924,
389926,
152370,
340789,
348982,
398139,
127814,
430939,
201579,
201582,
349040,
340849,
201588,
324472,
398201,
340858,
324475,
119674,
340861,
324478,
324481,
373634,
324484,
324487,
324492,
324495,
430995,
324501,
324510,
422816,
324513,
398245,
201637,
324524,
340909,
324533,
5046,
324538,
324541,
398279,
340939,
340941,
340957,
431072,
398306,
340963,
209895,
201711,
349172,
349180,
439294,
431106,
209943,
250914,
209965,
209968,
209971,
209975,
209979,
209987,
209990,
341071,
349267,
250967,
210010,
341091,
210025,
210027,
210030,
210039,
341113,
210044,
152703,
160895,
349311,
210052,
349319,
210055,
210067,
210071,
210077,
210080,
210084,
251044,
185511,
210088,
210095,
210098,
210107,
210115,
332997,
333009,
210131,
333014,
210138,
218354,
251128,
218360,
275712,
275715,
275721,
333078,
251160,
349484,
349491,
251189,
415033,
251210,
357708,
365911,
259421,
365921,
333154,
251235,
374117,
333162,
234866,
390516,
333175,
136590,
112020,
357792,
259515,
415166,
415185,
366034,
366038,
415193,
415199,
423392,
333284,
415207,
366056,
415216,
210420,
423423,
415257,
415263,
366117,
415270,
144939,
415278,
415281,
415285,
210487,
415290,
415293,
349761,
415300,
333386,
333399,
366172,
333413,
423528,
423532,
210544,
415353,
333439,
415361,
153227,
333498,
333511,
210631,
259788,
358099,
333534,
366307,
366311,
431851,
366318,
210672,
366321,
366325,
210695,
210698,
366348,
210706,
399128,
333594,
358191,
210739,
366387,
399159,
358200,
325440,
366401,
341829,
325446,
46920,
341834,
341838,
341843,
415573,
358234,
341851,
399199,
399206,
268143,
358255,
358259,
341876,
333689,
243579,
325504,
333698,
333708,
333724,
382890,
350146,
358339,
333774,
358371,
350189,
268298,
333850,
178218,
350256,
243781,
350285,
374864,
342111,
342133,
374902,
333997,
350410,
260298,
350416,
350422,
211160,
350425,
268507,
334045,
350445,
375026,
358644,
350458,
350461,
350464,
325891,
350467,
350475,
268559,
350480,
350486,
350490,
325917,
350493,
350498,
350504,
358700,
350509,
391468,
358704,
358713,
358716,
383306,
334161,
383321,
383330,
391530,
383341,
334203,
268668,
194941,
391563,
268701,
416157,
375208,
334262,
334275,
326084,
358856,
334304,
334311,
375277,
334321,
350723,
186897,
342545,
334358,
342550,
342554,
334363,
358941,
350761,
252461,
334384,
358961,
383536,
334394,
252482,
219718,
334407,
350822,
334465,
162445,
326290,
342679,
342683,
260766,
342710,
244409,
334528,
260801,
350917,
154328,
416473,
64230,
342766,
375535,
203506,
342776,
326416,
375568,
375571,
162591,
326441,
326451,
326454,
244540,
326460,
375612,
326467,
244551,
326473,
326477,
326485,
416597,
326490,
326502,
375656,
326507,
326510,
211825,
211831,
392060,
351104,
342915,
236430,
252822,
392091,
400285,
252836,
359334,
211884,
351168,
359361,
359366,
326598,
359382,
359388,
383967,
343015,
359407,
261108,
244726,
383997,
261129,
359451,
261147,
211998,
261153,
261159,
359476,
343131,
384098,
384101,
367723,
384107,
187502,
343154,
384114,
212094,
351364,
384135,
384139,
384143,
351381,
384151,
384160,
384168,
367794,
244916,
384181,
384188,
351423,
384191,
384198,
326855,
244937,
384201,
253130,
343244,
384208,
146642,
384224,
359649,
343270,
351466,
384246,
351479,
384249,
343306,
261389,
359694,
253200,
261393,
384275,
384283,
245020,
384288,
245029,
351534,
376110,
245040,
384314,
425276,
384323,
212291,
343365,
212303,
367965,
343393,
343398,
367980,
425328,
343409,
154999,
253303,
343417,
327034,
245127,
384397,
245136,
245142,
245145,
343450,
245148,
245151,
245154,
245157,
245162,
327084,
359865,
384443,
146876,
327107,
384453,
327110,
327115,
327117,
359886,
343507,
368092,
343534,
343539,
368119,
343544,
368122,
359983,
343630,
327275,
245357,
138864,
155254,
155273,
245409,
425638,
155322,
425662,
155327,
245460,
155351,
155354,
212699,
245475,
155363,
245483,
155371,
409335,
155393,
155403,
245525,
155422,
360223,
155438,
155442,
155447,
155461,
360261,
376663,
155482,
261981,
425822,
155487,
376671,
155490,
155491,
327531,
261996,
376685,
261999,
262002,
327539,
425845,
262005,
147317,
262008,
262011,
155516,
155521,
155525,
360326,
262027,
155531,
262030,
262036,
262039,
262042,
155549,
262045,
262048,
262051,
327589,
155559,
155562,
155565,
393150,
384977,
393169,
155611,
155619,
253923,
155621,
327654,
253926,
393203,
360438,
253943,
393206,
393212,
155646
] |
a9a0c555a496c2c95b094f31f2d0c51b3a498985
|
50e350ce659aa3c7b3ad5b6a021e17b58f34e220
|
/Blue Paw/PageCell.swift
|
2ec4c91aafbe455f651f21a7501bda20c4886f2a
|
[] |
no_license
|
ParkhomenkoAlexey/Blue_Paw
|
1ff5875715b4fc7a189e3cf61ca5e01690242ec6
|
43ecaf908b1d1b5a2a80fd7f7b5b3aa90a6dfc48
|
refs/heads/master
| 2020-04-12T12:10:23.771355 | 2018-12-21T21:05:32 | 2018-12-21T21:05:32 | 162,483,628 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 4,659 |
swift
|
//
// PageCell.swift
// Blue Paw
//
// Created by Алексей Пархоменко on 16/12/2018.
// Copyright © 2018 Алексей Пархоменко. All rights reserved.
//
import UIKit
class PageCell: UICollectionViewCell {
var pageSetup: Page! {
didSet {
guard let imageName = pageSetup.imageName,
let headerText = pageSetup.headerText else {
return }
profileImage.image = UIImage(named: "\(imageName)")
let attributedText = NSMutableAttributedString(string: headerText,
attributes: [NSAttributedString.Key.font:UIFont.systemFont(ofSize: 18, weight: .heavy)])
attributedText.append(NSAttributedString(string: "\n\n\(pageSetup.bodyText ?? "Nothing(")",
attributes: [NSAttributedString.Key.font : UIFont.systemFont(ofSize: 13),
NSAttributedString.Key.foregroundColor : UIColor.gray]))
descriptionTextView.attributedText = attributedText
descriptionTextView.textAlignment = .center
}
}
private let topImageContainerView: UIView! = {
let view = UIView()
view.backgroundColor = #colorLiteral(red: 0.4745098054, green: 0.8392156959, blue: 0.9764705896, alpha: 1)
view.translatesAutoresizingMaskIntoConstraints = false
return view
}()
private let profileImage: UIImageView! = {
let imageView = UIImageView()
imageView.contentMode = .scaleAspectFit
imageView.clipsToBounds = true
imageView.backgroundColor = #colorLiteral(red: 0, green: 0.5690457821, blue: 0.5746168494, alpha: 1)
imageView.image = UIImage(named: "Albert")
imageView.translatesAutoresizingMaskIntoConstraints = false
return imageView
}()
private var descriptionTextView: UITextView! = {
let textView = UITextView()
textView.translatesAutoresizingMaskIntoConstraints = false
textView.textAlignment = .center
textView.isEditable = false
textView.isScrollEnabled = false
textView.backgroundColor = #colorLiteral(red: 0.9686274529, green: 0.78039217, blue: 0.3450980484, alpha: 1)
return textView
}()
override init(frame: CGRect) {
super.init(frame: frame)
backgroundColor = .purple
setupLayout()
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
private func setupLayout() {
addSubview(topImageContainerView)
addSubview(descriptionTextView)
// the leading and trailing anchors better to use then left and right anchors because certail languages such as
// Arabic it's a language that goes from fight to left so leading and trailing anchors is going to be aware of if the
// language is right to left ot left to right you don't have to worry about so much what the language orientation so
// Apple recommends to use leading and trailing
// topImageContainerView constraints
topImageContainerView.heightAnchor.constraint(equalTo: heightAnchor, multiplier: 0.5).isActive = true
topImageContainerView.topAnchor.constraint(equalTo: topAnchor).isActive = true
topImageContainerView.leadingAnchor.constraint(equalTo: leadingAnchor).isActive = true
topImageContainerView.trailingAnchor.constraint(equalTo: trailingAnchor).isActive = true
topImageContainerView.addSubview(profileImage)
// profileImage constraints
profileImage.centerXAnchor.constraint(equalTo: topImageContainerView.centerXAnchor).isActive = true
profileImage.centerYAnchor.constraint(equalTo: topImageContainerView.centerYAnchor).isActive = true
profileImage.heightAnchor.constraint(equalTo: topImageContainerView.heightAnchor, multiplier: 0.5).isActive = true
// descriptionTextView constraints
descriptionTextView.topAnchor.constraint(equalTo: topImageContainerView.bottomAnchor).isActive = true
descriptionTextView.leadingAnchor.constraint(equalTo: safeAreaLayoutGuide.leadingAnchor).isActive = true
descriptionTextView.trailingAnchor.constraint(equalTo: safeAreaLayoutGuide.trailingAnchor).isActive = true
descriptionTextView.bottomAnchor.constraint(equalTo: safeAreaLayoutGuide.bottomAnchor).isActive = true
}
}
|
[
-1
] |
8043ea07d8d3c5fb9ea313d556abc64b8dea1ac6
|
e37aa9e916b37d1ebd133faeef08095eaff7a910
|
/Pulsing/Pulsing/ViewController.swift
|
f31b7172f8bb1367d5cee4d976cdc3961e71244f
|
[] |
no_license
|
Philipp146/PulsatingView
|
15210c3420cc3480af33ea7fc8eb07af93c577a2
|
bbb92af2afcf8d92a295c95bdb465a9ee17f5d9e
|
refs/heads/master
| 2020-04-09T00:54:23.902716 | 2018-11-30T22:40:48 | 2018-11-30T22:40:48 | 159,885,368 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 4,235 |
swift
|
//
// ViewController.swift
// Pulsing
//
// Created by Philipp Dümlein on 02.11.18.
// Copyright © 2018 Philipp Dümlein. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
var targetView: UIView?
let baseLayer = CAShapeLayer()
var pulsatingLayer: CAShapeLayer?
var biggerSide: CGFloat = 0
override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = UIColor.black
targetView = UIView(frame: CGRect.zero)
guard let targetView = targetView else { return }
targetView.backgroundColor = .white
targetView.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(targetView)
targetView.heightAnchor.constraint(equalToConstant: 20).isActive = true
targetView.widthAnchor.constraint(equalToConstant: 20).isActive = true
targetView.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true
targetView.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true
// Do any additional setup after loading the view, typically from a nib.
}
override func viewDidLayoutSubviews() {
let onboarder = Onboarder(targetView: targetView, baseView: view)
onboarder.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(onboarder)
}
private func setupOnboarding() {
setupUI()
}
private func setupUI() {
view.backgroundColor = .clear
setupPulsatingLayer()
setupBaseLayer()
setupLabel(with: "Hey schau doch mal unser neues iOS-Feature an")
}
private func setupBaseLayer() {
baseLayer.strokeColor = UIColor.yellow.cgColor
baseLayer.fillColor = UIColor.clear.cgColor
setupLayer(layer: baseLayer)
}
private func setupPulsatingLayer() {
pulsatingLayer = CAShapeLayer()
guard let pulsatingLayer = pulsatingLayer else { return }
pulsatingLayer.strokeColor = UIColor.yellow.cgColor.copy(alpha: 0.2)
pulsatingLayer.fillColor = UIColor.clear.cgColor
setupLayer(layer: pulsatingLayer)
animatePulsatingLayer()
}
private func setupLayer(layer: CAShapeLayer) {
guard let targetView = targetView else { return }
biggerSide = targetView.bounds.width > targetView.bounds.height ? targetView.bounds.width : targetView.bounds.height
let circularPath = UIBezierPath(arcCenter: .zero, radius: biggerSide*3, startAngle: 0, endAngle: 2 * CGFloat.pi, clockwise: true)
layer.path = circularPath.cgPath
let lineWidth = biggerSide*4 > 250 ? 250 : biggerSide*4
layer.lineWidth = lineWidth
layer.position = targetView.center
view.layer.addSublayer(layer)
}
private func animatePulsatingLayer() {
let animation = CABasicAnimation(keyPath: "transform.scale")
animation.toValue = 1.3
animation.timingFunction = CAMediaTimingFunction(name: .easeOut)
animation.duration = 0.7
animation.autoreverses = true
animation.repeatCount = Float.infinity
self.pulsatingLayer?.add(animation, forKey: "pulsing")
}
private func setupLabel(with text: String) {
guard let targetView = targetView else { return }
let label = UILabel(frame: CGRect.zero)
label.translatesAutoresizingMaskIntoConstraints = false
label.text = text
let fontSize = biggerSide/2 > 20 ? 20 : biggerSide/2
label.font = UIFont.systemFont(ofSize: fontSize)
label.textAlignment = .center
label.numberOfLines = 3
view.addSubview(label)
view.addConstraint(NSLayoutConstraint(item: label, attribute: .top, relatedBy: .equal, toItem: targetView, attribute: .bottom, multiplier: 1, constant: biggerSide))
view.addConstraint(NSLayoutConstraint(item: label, attribute: .leading, relatedBy: .equal, toItem: targetView, attribute: .leading, multiplier: 1, constant: -biggerSide*2))
view.addConstraint(NSLayoutConstraint(item: label, attribute: .trailing, relatedBy: .equal, toItem: targetView, attribute: .trailing, multiplier: 1, constant: biggerSide*2))
}
}
|
[
-1
] |
d62b3f3a8749ca6ad041a2c89650148117ad4b4f
|
de6c7da08c50186b8323e93a2bb35020d56d9a67
|
/MyPlayground11.playground/Contents.swift
|
384ae7abc25b01cba9e5feef6ae82d821acde706
|
[] |
no_license
|
sergplotnikov/ios-learn
|
bd96af82e5d92894aa1fd018ccfab5a3c3864bdd
|
eb52ed1768f04bd70050a9b030752bd03b92ca17
|
refs/heads/master
| 2022-12-07T17:08:16.623450 | 2020-09-02T09:05:32 | 2020-09-02T09:05:32 | 284,009,469 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 681 |
swift
|
import UIKit
extension Int {
func sqr() -> Int {
return self * self;
}
func mod5() -> Int {
return self % 5
}
}
let n = 9
n.sqr()
n.mod5()
let col1 = ["a1","a2","a3","a4","a5","a5"]
let col2 = Set(["b1","b2","b3","b3"])
extension Collection {
func prtcnt() {
print("there are \(count) in collection")
for name in self {
print(name)
}
}
}
col1.prtcnt()
col2.prtcnt()
protocol pr1 {
var id: String {get set}
func identify()
}
extension pr1 {
func identify() {
print("id is \(id)")
}
}
struct strc: pr1 {
var id: String
}
let s1 = strc(id: "test")
s1.identify()
|
[
-1
] |
21fd097850f15b8e4709a14bdd6109eab959e7ec
|
a5bf92c53fa48b59258b200fee48ba10e647b73f
|
/src/xcode/ENA/ENATests/Helper/CodableExposureDetectionSummary+Helpers.swift
|
4c9ae882fcc73ca5ca1db35645e97e4367883a57
|
[
"BSD-3-Clause",
"MIT",
"Apache-2.0"
] |
permissive
|
heinezen/cwa-app-ios
|
3a71cee2185a3614f31ad428199516731da052db
|
e7d739ccb24adff248def82398f5d56ad6b560f5
|
refs/heads/main
| 2023-03-04T07:43:38.081488 | 2020-12-08T10:53:25 | 2020-12-08T10:53:25 | 315,066,395 | 0 | 0 | null | 2020-11-22T15:16:06 | 2020-11-22T15:16:05 | null |
UTF-8
|
Swift
| false | false | 1,166 |
swift
|
//
// 🦠 Corona-Warn-App
//
import Foundation
@testable import ENA
extension CodableExposureDetectionSummary {
static var summaryLow: CodableExposureDetectionSummary {
makeExposureSummaryContainer(maxRiskScoreFullRange: 80, ad_low: 10, ad_mid: 10, ad_high: 10)
}
static var summaryMed: CodableExposureDetectionSummary {
makeExposureSummaryContainer(maxRiskScoreFullRange: 128, ad_low: 15, ad_mid: 15, ad_high: 15)
}
static var summaryHigh: CodableExposureDetectionSummary {
makeExposureSummaryContainer(maxRiskScoreFullRange: 255, ad_low: 30, ad_mid: 30, ad_high: 30)
}
static func summary(for riskLevel: EitherLowOrIncreasedRiskLevel) -> CodableExposureDetectionSummary {
switch riskLevel {
case .low:
return .summaryLow
case .increased:
return .summaryHigh
}
}
static func makeExposureSummaryContainer(
maxRiskScoreFullRange: Int,
ad_low: Double,
ad_mid: Double,
ad_high: Double
) -> CodableExposureDetectionSummary {
.init(
daysSinceLastExposure: 0,
matchedKeyCount: 0,
maximumRiskScore: 0,
attenuationDurations: [ad_low, ad_mid, ad_high],
maximumRiskScoreFullRange: maxRiskScoreFullRange
)
}
}
|
[
-1
] |
ce74ecb3cdcd078ff294b4aa70ef3573f17208c2
|
5b97061993abd1ff67ca549ad25f9e3f0f84af29
|
/PerfectTemplate/Packages/PerfectHTTP-2.0.5/Sources/HTTPMethod.swift
|
913101c495b122b974e404136c4cb6c3641a95a3
|
[
"Apache-2.0"
] |
permissive
|
V0idPRO/SwiftAlpsSrv
|
702f7c4509db458fcbc2e1a2f81acd01f1a3162c
|
9ee3c15e61c1b79167e08551fc3b6bbd725817f1
|
refs/heads/master
| 2020-12-24T07:46:28.791326 | 2016-11-10T12:04:23 | 2016-11-10T12:04:23 | 73,369,665 | 0 | 1 | null | 2016-11-10T12:04:24 | 2016-11-10T10:05:36 |
C
|
UTF-8
|
Swift
| false | false | 2,096 |
swift
|
//
// HTTPMethod.swift
// PerfectLib
//
// Created by Kyle Jessup on 2016-06-20.
// Copyright (C) 2016 PerfectlySoft, Inc.
//
//===----------------------------------------------------------------------===//
//
// This source file is part of the Perfect.org open source project
//
// Copyright (c) 2015 - 2016 PerfectlySoft Inc. and the Perfect project authors
// Licensed under Apache License v2.0
//
// See http://perfect.org/licensing.html for license information
//
//===----------------------------------------------------------------------===//
//
/// HTTP request method types
public enum HTTPMethod: Hashable, CustomStringConvertible {
/// OPTIONS
case options,
/// GET
get,
/// HEAD
head,
/// POST
post,
/// PUT
put,
/// DELETE
delete,
/// TRACE
trace,
/// CONNECT
connect,
/// Any unaccounted for or custom method
custom(String)
public static func from(string: String) -> HTTPMethod {
switch string {
case "OPTIONS": return .options
case "GET": return .get
case "HEAD": return .head
case "POST": return .post
case "PUT": return .put
case "DELETE": return .delete
case "TRACE": return .trace
case "CONNECT": return .connect
default: return .custom(string)
}
}
/// Method String hash value
public var hashValue: Int {
return self.description.hashValue
}
/// The method as a String
public var description: String {
switch self {
case .options: return "OPTIONS"
case .get: return "GET"
case .head: return "HEAD"
case .post: return "POST"
case .put: return "PUT"
case .delete: return "DELETE"
case .trace: return "TRACE"
case .connect: return "CONNECT"
case .custom(let s): return s
}
}
}
/// Compare two HTTP methods
public func == (lhs: HTTPMethod, rhs: HTTPMethod) -> Bool {
return lhs.description == rhs.description
}
|
[
-1
] |
f9ba1886c357833418d4807be6d32194286f2d83
|
3268a0bf27fde05a2a004265f95a515a826a4703
|
/English For FunUITests/English_For_FunUITests.swift
|
31c983aa7397d8654b19a042fdc997c79c5a6ae6
|
[] |
no_license
|
huutrung2585/Hien21
|
1cee32f2cbed73aeb63ec297a4b29451c61808cd
|
bd2b8d7d4e4777f05c305e695f1a5fb1398bb87c
|
refs/heads/master
| 2020-06-13T05:33:53.023668 | 2016-12-03T16:53:38 | 2016-12-03T16:53:38 | 75,486,767 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,264 |
swift
|
//
// English_For_FunUITests.swift
// English For FunUITests
//
// Created by Hien Pham on 12/3/16.
// Copyright © 2016 Hien Pham. All rights reserved.
//
import XCTest
class English_For_FunUITests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
// In UI tests it is usually best to stop immediately when a failure occurs.
continueAfterFailure = false
// UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method.
XCUIApplication().launch()
// In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
func testExample() {
// Use recording to get started writing UI tests.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
}
|
[
333827,
243720,
282634,
313356,
155665,
241695,
237599,
223269,
229414,
315431,
292901,
315433,
354342,
325675,
278571,
313388,
124974,
282671,
102446,
229425,
354346,
243763,
321589,
241717,
229431,
180279,
215095,
319543,
213051,
288829,
325695,
286787,
288835,
237638,
313415,
285360,
239689,
233548,
315468,
311373,
196687,
278607,
311377,
354386,
333902,
329812,
315477,
223317,
354394,
200795,
323678,
315488,
321632,
45154,
315489,
280676,
313446,
215144,
227432,
217194,
194667,
233578,
278637,
307306,
319599,
288878,
278642,
284789,
131190,
284790,
249976,
288890,
292987,
215165,
131199,
227459,
194692,
278669,
235661,
241809,
323730,
278676,
311447,
153752,
327834,
284827,
329884,
278684,
299166,
278690,
233635,
215204,
311459,
284840,
299176,
278698,
284843,
278707,
125108,
180409,
280761,
278713,
223418,
227517,
295099,
299197,
280767,
258233,
299202,
139459,
309443,
176325,
131270,
301255,
299208,
227525,
280779,
233678,
282832,
321744,
227536,
301271,
229591,
280792,
356575,
311520,
325857,
334049,
18661,
182503,
338151,
307431,
319719,
317676,
286957,
125166,
125170,
313595,
125180,
125184,
309504,
125192,
217352,
125197,
125200,
194832,
227601,
325904,
125204,
319764,
278805,
334104,
315674,
282908,
311582,
125215,
282912,
299294,
233761,
278817,
211239,
282920,
125225,
317738,
325930,
311596,
321839,
315698,
98611,
125236,
332084,
282938,
307514,
168251,
278843,
287040,
319812,
311622,
227655,
280903,
319816,
323914,
282959,
229716,
289109,
168280,
323934,
391521,
239973,
381286,
285031,
313703,
416103,
280938,
242027,
242028,
321901,
354671,
354672,
287089,
278895,
227702,
199030,
315768,
315769,
291193,
223611,
291194,
248188,
313726,
211327,
291200,
311679,
158087,
313736,
227721,
242059,
311692,
285074,
227730,
240020,
190870,
315798,
291225,
285083,
293275,
317851,
242079,
285089,
293281,
289185,
305572,
156069,
301482,
311723,
289195,
377265,
338359,
299449,
311739,
319931,
293309,
278974,
311744,
317889,
291266,
278979,
326083,
278988,
289229,
281038,
326093,
278992,
283089,
373196,
283088,
281039,
279000,
242138,
176602,
285152,
369121,
160224,
279009,
195044,
291297,
279014,
242150,
319976,
279017,
188899,
311787,
281071,
319986,
236020,
279030,
311800,
317949,
279042,
283138,
233987,
287237,
377352,
322057,
309770,
342537,
279053,
283154,
303635,
303634,
279061,
279060,
182802,
279066,
188954,
322077,
291359,
227881,
293420,
289328,
236080,
283185,
279092,
23093,
234037,
244279,
244280,
338491,
234044,
301635,
309831,
55880,
322119,
377419,
303693,
281165,
281170,
326229,
309847,
189016,
115287,
332379,
111197,
295518,
287327,
242274,
244326,
279143,
279150,
287345,
313970,
287348,
301688,
244345,
189054,
287359,
291455,
297600,
303743,
301702,
164487,
279176,
311944,
316044,
184974,
311950,
316048,
311953,
316050,
336531,
287379,
326288,
295575,
227991,
289435,
303772,
221853,
205469,
285348,
314020,
279207,
295591,
248494,
318127,
293552,
295598,
285362,
299698,
279215,
166581,
287412,
154295,
164532,
342705,
287418,
314043,
303802,
66243,
291529,
287434,
225996,
363212,
287438,
242385,
279249,
303826,
164561,
279253,
158424,
230105,
299737,
322269,
342757,
295653,
289511,
230120,
330473,
234216,
285419,
330476,
289517,
279278,
170735,
312046,
215790,
125683,
230133,
199415,
234233,
242428,
279293,
205566,
322302,
289534,
299777,
291584,
228099,
285443,
291591,
295688,
346889,
285450,
322312,
312076,
264971,
326413,
322320,
285457,
295698,
291605,
166677,
283418,
285467,
326428,
221980,
281378,
234276,
283431,
262952,
262953,
279337,
318247,
318251,
262957,
203560,
164655,
328495,
289580,
301872,
242481,
303921,
234290,
230198,
285493,
285496,
301883,
201534,
281407,
289599,
222017,
295745,
342846,
293702,
318279,
283466,
281426,
279379,
295769,
234330,
201562,
244569,
281434,
230238,
275294,
301919,
279393,
293729,
322396,
281444,
230239,
279398,
349025,
303973,
351078,
177002,
308075,
242540,
242542,
310132,
295797,
201590,
207735,
228214,
295799,
177018,
269179,
279418,
308093,
314240,
291713,
158594,
330627,
240517,
287623,
228232,
416649,
279434,
236427,
320394,
316299,
234382,
189327,
299912,
308113,
252812,
308111,
293780,
310166,
289691,
209820,
277404,
240543,
283551,
310177,
289699,
189349,
293673,
289704,
293801,
279465,
326571,
177074,
304050,
326580,
289720,
326586,
289723,
189373,
213956,
281541,
345030,
19398,
213961,
326602,
279499,
56270,
191445,
183254,
304086,
183258,
234469,
340967,
314343,
304104,
324587,
183276,
289773,
203758,
234476,
320495,
320492,
287730,
277493,
240631,
320504,
214009,
312313,
312315,
312317,
328701,
328705,
234499,
293894,
322571,
230411,
320526,
330766,
234513,
238611,
140311,
293911,
238617,
197658,
316441,
330789,
248871,
132140,
113710,
189487,
281647,
322609,
312372,
203829,
238646,
300087,
238650,
320571,
21567,
308288,
160834,
336962,
314437,
349254,
238663,
300109,
207954,
234578,
205911,
296023,
314458,
156763,
277600,
281698,
281699,
230500,
285795,
214116,
322664,
228457,
318571,
279659,
234606,
300145,
230514,
238706,
187508,
312435,
279666,
300147,
302202,
285819,
314493,
285823,
150656,
234626,
279686,
222344,
318602,
234635,
285834,
337037,
228492,
177297,
162962,
187539,
326803,
308375,
324761,
285850,
296091,
119965,
234655,
330912,
300192,
302239,
306339,
339106,
234662,
300200,
249003,
208044,
238764,
302251,
322733,
3243,
279729,
294069,
300215,
294075,
339131,
228541,
64699,
283841,
148674,
283846,
312519,
279752,
283849,
148687,
290001,
189651,
316628,
279766,
189656,
279775,
304352,
298209,
304353,
310496,
279780,
228587,
279789,
290030,
302319,
251124,
234741,
283894,
316661,
279803,
208123,
292092,
228608,
320769,
234756,
242955,
312588,
177420,
318732,
126229,
245018,
320795,
318746,
320802,
304422,
130342,
130344,
292145,
298290,
312628,
345398,
300342,
159033,
333114,
333115,
286012,
222523,
181568,
279872,
279874,
300355,
294210,
216387,
286019,
193858,
300354,
304457,
345418,
230730,
372039,
296269,
234830,
224591,
238928,
294220,
296274,
102441,
314708,
318804,
283990,
314711,
357720,
300378,
300379,
316764,
294236,
314721,
292194,
230757,
281958,
314727,
134504,
306541,
314734,
284015,
234864,
327023,
316786,
312688,
314740,
230772,
314742,
327030,
296304,
314745,
290170,
310650,
224637,
306558,
290176,
306561,
243073,
179586,
314752,
294278,
314759,
296328,
296330,
298378,
318860,
314765,
368012,
304523,
292242,
279955,
306580,
314771,
224662,
234902,
282008,
314776,
112019,
318876,
282013,
290206,
148899,
314788,
314790,
282023,
333224,
298406,
245160,
241067,
279980,
314797,
279979,
286128,
173492,
279988,
286133,
284086,
284090,
302523,
228796,
310714,
54719,
415170,
292291,
302530,
280003,
228804,
310725,
300488,
306630,
306634,
339403,
280011,
302539,
300490,
310731,
370122,
312785,
327122,
222674,
280020,
329168,
329170,
310735,
280025,
310747,
239069,
144862,
286176,
320997,
310758,
187877,
280042,
280043,
191980,
300526,
329198,
337391,
282097,
308722,
296434,
306678,
40439,
191991,
288248,
286201,
300539,
288252,
312830,
290304,
286208,
245249,
228868,
292359,
218632,
230922,
302602,
323083,
294413,
329231,
304655,
323088,
282132,
230933,
302613,
316951,
282135,
374297,
302620,
313338,
282147,
222754,
306730,
245291,
312879,
230960,
288305,
239159,
290359,
323132,
235069,
157246,
288319,
288322,
280131,
349764,
310853,
124486,
282182,
288328,
286281,
292426,
194118,
333389,
224848,
224852,
290391,
196184,
239192,
306777,
128600,
235096,
212574,
99937,
204386,
323171,
345697,
300643,
282214,
300645,
312937,
204394,
224874,
243306,
312941,
206447,
310896,
294517,
314997,
290425,
288377,
325246,
333438,
235136,
280193,
282244,
239238,
288391,
323208,
282248,
286344,
286351,
188049,
239251,
229011,
280217,
323226,
229021,
302751,
282272,
198304,
245413,
282279,
298664,
212649,
298666,
317102,
286387,
300725,
337590,
286392,
300729,
302778,
306875,
280252,
296636,
282302,
280253,
286400,
323265,
323262,
280259,
333508,
282309,
321220,
321217,
296649,
239305,
306891,
212684,
302798,
9935,
241360,
282321,
333522,
286419,
313042,
241366,
280279,
282330,
18139,
280285,
294621,
282336,
325345,
321250,
294629,
153318,
333543,
181992,
12009,
337638,
282347,
288492,
282349,
34547,
67316,
323315,
286457,
284410,
200444,
288508,
282366,
286463,
319232,
278273,
288515,
280326,
282375,
323335,
284425,
300810,
282379,
216844,
280333,
284430,
116491,
300812,
161553,
124691,
278292,
118549,
278294,
282390,
116502,
284436,
325403,
321308,
321309,
282399,
241440,
282401,
325411,
186148,
186149,
315172,
241447,
333609,
294699,
286507,
284460,
280367,
300849,
282418,
280373,
282424,
280377,
321338,
319289,
282428,
280381,
345918,
241471,
413500,
280386,
325444,
280391,
153416,
325449,
315209,
159563,
280396,
307024,
337746,
317268,
325460,
307030,
18263,
237397,
241494,
188250,
284508,
300893,
307038,
237411,
284515,
276326,
282471,
296807,
292713,
282476,
292719,
296815,
313200,
325491,
313204,
333687,
317305,
124795,
317308,
339840,
182145,
315265,
280451,
325508,
333700,
243590,
282503,
67464,
327556,
188293,
325514,
243592,
305032,
315272,
184207,
311183,
124816,
315275,
282517,
294806,
214936,
337816,
294808,
329627,
239515,
214943,
298912,
319393,
333727,
219046,
333734,
294824,
298921,
284584,
313257,
292783,
126896,
200628,
300983,
343993,
288698,
98240,
294849,
214978,
280517,
280518,
214983,
282572,
282573,
153553,
231382,
329696,
323554,
292835,
6116,
190437,
292838,
294887,
317416,
313322,
278507,
329707,
298987,
296942,
311277,
124912,
327666,
278515,
325620,
239610
] |
925030c03f0e2bb83bdaf49205b68cd399f88870
|
aad7ceed4786f4b45cd76e4e900f6382c0f1ffe9
|
/ParseChat/ParseChat/ParseChat/AppDelegate.swift
|
3c36e30f2b77abb612ec122bbb264675308aa91b
|
[] |
no_license
|
optimusprike/ParseChat
|
ee8f13253565efb122218da6e9256d4b45c2db6e
|
a34618b5b03e438c396361cee972cae09d48912b
|
refs/heads/master
| 2020-04-06T04:43:05.061067 | 2017-02-23T05:19:06 | 2017-02-23T05:19:06 | 82,887,170 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,454 |
swift
|
//
// AppDelegate.swift
// ParseChat
//
// Created by Prakash Pudhucode on 2/22/17.
// Copyright © 2017 Prakash Pudhucode. All rights reserved.
//
import UIKit
import Parse
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
Parse.initialize(with: ParseClientConfiguration(block: { (configuration: ParseMutableClientConfiguration) in
configuration.applicationId = "CodePath-Parse"
configuration.server = "http://45.79.67.127:1337/parse"
}))
// Override point for customization after application launch.
return true
}
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
}
|
[
229380,
229383,
229385,
294924,
229388,
229391,
327695,
229394,
229397,
229399,
229402,
229405,
229408,
294950,
229415,
229417,
327722,
237613,
229422,
229426,
237618,
229428,
311349,
286774,
286776,
319544,
286778,
229432,
286791,
237640,
286797,
237646,
311375,
163920,
196692,
319573,
311383,
319590,
311400,
303212,
131192,
237693,
303230,
327814,
303241,
303244,
311436,
319633,
286873,
286876,
311460,
311469,
32944,
327862,
286906,
327866,
180413,
286910,
131264,
286916,
286922,
286924,
286926,
319694,
131281,
278743,
278747,
295133,
155872,
319716,
237807,
303345,
286962,
131314,
229622,
327930,
278781,
278783,
278785,
237826,
319751,
278792,
286987,
319757,
311569,
286999,
319770,
287003,
287006,
287009,
287012,
287014,
287016,
287019,
311598,
287023,
311601,
295220,
287032,
155966,
319809,
319810,
278849,
319814,
311623,
311628,
229709,
319822,
287054,
278865,
229717,
196963,
196969,
139638,
213367,
106872,
319872,
311683,
319879,
311693,
65943,
311719,
278952,
139689,
278957,
311728,
278967,
180668,
311741,
278975,
319938,
98756,
278980,
319945,
278986,
319947,
278990,
278994,
188895,
172512,
287202,
279010,
279015,
172520,
319978,
172526,
311791,
279023,
172529,
279027,
319989,
172534,
180727,
164343,
311804,
287230,
279040,
303617,
287234,
172550,
303623,
172552,
320007,
287238,
279051,
172558,
303632,
279058,
303637,
279063,
279067,
172572,
279072,
172577,
295459,
172581,
295461,
279082,
311850,
279084,
172591,
172598,
279095,
172607,
172612,
377413,
172614,
172618,
303690,
33357,
287309,
303696,
279124,
172634,
262752,
172644,
311911,
295533,
172655,
172656,
352880,
295538,
172660,
287349,
287355,
287360,
295553,
172675,
295557,
311942,
287365,
303751,
352905,
311946,
279178,
287371,
311951,
287377,
172691,
287381,
311957,
221850,
287386,
230045,
172702,
303773,
164509,
172705,
287394,
172707,
303780,
287390,
287398,
205479,
279208,
287400,
172714,
295595,
279212,
189102,
172721,
287409,
66227,
303797,
189114,
287419,
303804,
328381,
287423,
328384,
172737,
279231,
287427,
312006,
172748,
287436,
107212,
172751,
287440,
295633,
172755,
303827,
279255,
172760,
287450,
303835,
279258,
189149,
303838,
213724,
312035,
279267,
295654,
279272,
230128,
312048,
312050,
230131,
205564,
230146,
328453,
295685,
230154,
312077,
295695,
230169,
369433,
295707,
328476,
295710,
230175,
295720,
303914,
279340,
205613,
279353,
230202,
312124,
328508,
222018,
295755,
377676,
148302,
287569,
303959,
230237,
230241,
279394,
303976,
336744,
303985,
303987,
328563,
279413,
303991,
303997,
295806,
295808,
295813,
304005,
320391,
304007,
304009,
213895,
304011,
230284,
304013,
295822,
279438,
189329,
295825,
304019,
189331,
58262,
304027,
279452,
410526,
279461,
304042,
213931,
230327,
304055,
287675,
230334,
304063,
304065,
213954,
295873,
156612,
189378,
213963,
197580,
312272,
304084,
304090,
320481,
304106,
320490,
312302,
328687,
320496,
304114,
295928,
312321,
295945,
230413,
197645,
295949,
320528,
140312,
295961,
238620,
197663,
304164,
304170,
304175,
238641,
312374,
238652,
238655,
230465,
238658,
336964,
296004,
320584,
238666,
296021,
402518,
336987,
230497,
296036,
296040,
361576,
205931,
164973,
312432,
279669,
337018,
304258,
222340,
205968,
296084,
238745,
304285,
238756,
205991,
222377,
337067,
165035,
238766,
165038,
230576,
238770,
304311,
230592,
312518,
279750,
230600,
230607,
148690,
320727,
279769,
304348,
279777,
304354,
296163,
320740,
279781,
304360,
320748,
279788,
279790,
304370,
320771,
312585,
296202,
296205,
230674,
320786,
230677,
296213,
296215,
320792,
230681,
230689,
173350,
312622,
296243,
312630,
222522,
296253,
230718,
296255,
312639,
378181,
230727,
238919,
296264,
320840,
296267,
296271,
222545,
230739,
312663,
222556,
337244,
312676,
230760,
173418,
148843,
230763,
230768,
296305,
312692,
230773,
304505,
304506,
181631,
148865,
312711,
296331,
288140,
288144,
230800,
304533,
288154,
337306,
288160,
288162,
279975,
304555,
370092,
279983,
173488,
288176,
312755,
296373,
312759,
279991,
288185,
337335,
222652,
312766,
173507,
296389,
222665,
230860,
312783,
288208,
230865,
370130,
148946,
222676,
288210,
280021,
288212,
288214,
239064,
288217,
288218,
329177,
288220,
239070,
288224,
280034,
288226,
280036,
288229,
280038,
288230,
288232,
320998,
288234,
370146,
288238,
288240,
288242,
296435,
288244,
288250,
296446,
321022,
402942,
148990,
296450,
206336,
230916,
230919,
214535,
230923,
304651,
304653,
230940,
222752,
108066,
296486,
296488,
157229,
230961,
157236,
288320,
288325,
124489,
280140,
280145,
288338,
280149,
288344,
280152,
239194,
181854,
280158,
370272,
403039,
239202,
312938,
280183,
280185,
280188,
280191,
116354,
280194,
280208,
280211,
288408,
280218,
280222,
190118,
321195,
296622,
321200,
337585,
296634,
296637,
280260,
206536,
280264,
313044,
280276,
321239,
280283,
313052,
288478,
313055,
321252,
313066,
288494,
280302,
280304,
313073,
321266,
288499,
419570,
288502,
288510,
124671,
67330,
280324,
198405,
198416,
280337,
296723,
321304,
329498,
296731,
321311,
313121,
313123,
304932,
321316,
280363,
141101,
165678,
321336,
296767,
288576,
345921,
304968,
280393,
280402,
173907,
313171,
313176,
280419,
321381,
296809,
296812,
313201,
1920,
255873,
305028,
247688,
280464,
124817,
239510,
280473,
124827,
214940,
247709,
214944,
280487,
313258,
321458,
296883,
124853,
214966,
296890,
10170,
288700,
296894,
190403,
296900,
280515,
337862,
165831,
280521,
296921,
239586,
313320,
231404,
124913,
165876,
321528,
239612,
313340,
288764,
239617,
313347,
288773,
313358,
305176,
313371,
354338,
305191,
223273,
313386,
354348,
124978,
215090,
124980,
288824,
288826,
321595,
313406,
288831,
288836,
67654,
280651,
354382,
288848,
215123,
354390,
288859,
280669,
149599,
223327,
149601,
321634,
149603,
280671,
329830,
280681,
313451,
280687,
149618,
215154,
313458,
280691,
313464,
329850,
321659,
280702,
288895,
321670,
215175,
141446,
141455,
141459,
280725,
313498,
100520,
288936,
280747,
288940,
288947,
321717,
280764,
280769,
280771,
280774,
313548,
321740,
280783,
280786,
313557,
280793,
280796,
338147,
280804,
280807,
157930,
280811,
280817,
125171,
157940,
280825,
280827,
280830,
280831,
125187,
280835,
125191,
125207,
125209,
321817,
125218,
321842,
223539,
125239,
280888,
289087,
280897,
305480,
239944,
239947,
305485,
305489,
379218,
280919,
354653,
313700,
280937,
190832,
280946,
223606,
313720,
280956,
280959,
313731,
199051,
240011,
289166,
240017,
297363,
190868,
240021,
297365,
297368,
297372,
141725,
297377,
289186,
297391,
289201,
240052,
289207,
289210,
305594,
281024,
289218,
289221,
289227,
281045,
281047,
166378,
305647,
281075,
174580,
240124,
281084,
305662,
305664,
240129,
305666,
305668,
223749,
240132,
281095,
223752,
150025,
338440,
223757,
281102,
223765,
281113,
322074,
281116,
281121,
182819,
281127,
150066,
158262,
158266,
289342,
281154,
322115,
281163,
281179,
338528,
281190,
199273,
281196,
19053,
158317,
313973,
297594,
281210,
158347,
133776,
314003,
117398,
314007,
289436,
174754,
330404,
289448,
174764,
314029,
314033,
240309,
133817,
314045,
314047,
314051,
199364,
297671,
158409,
289493,
363234,
289513,
289522,
289525,
289532,
322303,
289537,
322310,
264969,
322314,
322318,
281372,
322341,
215850,
281388,
281401,
289601,
281410,
281413,
281414,
240458,
281420,
240468,
281430,
322393,
297818,
281435,
281438,
281442,
174955,
224110,
207733,
207737,
158596,
183172,
338823,
322440,
314249,
240519,
183184,
289687,
240535,
289694,
289696,
289700,
289724,
52163,
281567,
289762,
322534,
297961,
183277,
322550,
134142,
322563,
314372,
175134,
322599,
322610,
314421,
281654,
314427,
314433,
207937,
314441,
207949,
322642,
314456,
281691,
314461,
281702,
281704,
314474,
281708,
281711,
248995,
306341,
306344,
306347,
322734,
306354,
142531,
199877,
289991,
306377,
289997,
249045,
363742,
363745,
298216,
330988,
126190,
216303,
322801,
257302,
363802,
199976,
199978,
298292,
298294,
257334,
216376,
380226,
298306,
224584,
224587,
224594,
216404,
306517,
150870,
314714,
224603,
314718,
265568,
314723,
281960,
150890,
306539,
314732,
314736,
290161,
216436,
306549,
298358,
314743,
306552,
290171,
314747,
306555,
290174,
298365,
224641,
281987,
298372,
314756,
265604,
224647,
281990,
298377,
314763,
142733,
298381,
314768,
224657,
306581,
314773,
314779,
314785,
314793,
282025,
282027,
241068,
241070,
241072,
282034,
241077,
150966,
298424,
306618,
282044,
323015,
306635,
306640,
290263,
290270,
290275,
339431,
282089,
191985,
282098,
290291,
282101,
241142,
191992,
290298,
151036,
290302,
282111,
290305,
175621,
306694,
192008,
323084,
257550,
290321,
282130,
323090,
290325,
282133,
241175,
290328,
282137,
290332,
241181,
282144,
290344,
306731,
290349,
290351,
290356,
224849,
282195,
282199,
282201,
306778,
159330,
314979,
298598,
323176,
224875,
241260,
323181,
257658,
315016,
282249,
290445,
282261,
298651,
282269,
323229,
298655,
323231,
61092,
282277,
306856,
282295,
282300,
323260,
323266,
282310,
323273,
282319,
306897,
241362,
306904,
282328,
298714,
52959,
216801,
282337,
241380,
216806,
323304,
282345,
12011,
282356,
323318,
282364,
282367,
306945,
241412,
323333,
282376,
216842,
323345,
282388,
323349,
282392,
184090,
315167,
315169,
282402,
315174,
323367,
241448,
315176,
241450,
282410,
306991,
315184,
323376,
315190,
241464,
159545,
282425,
298811,
118593,
307009,
413506,
307012,
241475,
315211,
282446,
307027,
315221,
323414,
315223,
241496,
241498,
307035,
307040,
110433,
241509,
110438,
298860,
110445,
282478,
315249,
282481,
110450,
315251,
315253,
315255,
339838,
315267,
282499,
315269,
241544,
282505,
241546,
241548,
298896,
298898,
282514,
241556,
298901,
241560,
241563,
241565,
241567,
241569,
241574,
282537,
298922,
36779,
241581,
282542,
241583,
323504,
241586,
290739,
241588,
282547,
241590,
241592,
241598,
290751,
241600,
241605,
151495,
241610,
298975,
241632,
298984,
241640,
241643,
298988,
241646,
241649,
241652,
323574,
290807,
299003,
241661,
299006,
282623,
315396,
241669,
315397,
282632,
282639,
290835,
282645,
241693,
282654,
102438,
217127,
282669,
323630,
282681,
290877,
282687,
159811,
315463,
315466,
192589,
192596,
176213,
307287,
307290,
217179,
315482,
192605,
315483,
233567,
299105,
200801,
217188,
299109,
307303,
356457,
45163,
307307,
315502,
192624,
307314,
323700,
299126,
233591,
299136,
307329,
307338,
233613,
241813,
307352,
299164,
299167,
315552,
315557,
184486,
307370,
307372,
184492,
307374,
307376,
323763,
184503,
176311,
307385,
307386,
258235,
307388,
176316,
307390,
299200,
184512,
307394,
299204,
307396,
184518,
307399,
323784,
233679,
307409,
307411,
176343,
299225,
233701,
307432,
184572,
184579,
282893,
291089,
282906,
291104,
233766,
176435,
315701,
332086,
307510,
168245,
307515,
307518,
282942,
323917,
282957,
110926,
233808,
323921,
315733,
323926,
233815,
315739,
323932,
299357,
242018,
242024,
299373,
315757,
250231,
242043,
315771,
299388,
299391,
291202,
299398,
242057,
291212,
299405,
291222,
315801,
283033,
242075,
61855,
291231,
283042,
291238,
291241,
127403,
127405,
291247,
299440,
127407,
127413,
291254,
127417,
291260,
127421,
127424,
299457,
127429,
127434,
315856,
315860,
176597,
127447,
299481,
176605,
242143,
127457,
291299,
127463,
242152,
291305,
127466,
176620,
127469,
127474,
291314,
291317,
127480,
135672,
291323,
233979,
127485,
291330,
127494,
283142,
127497,
233994,
135689,
127500,
291341,
233998,
127506,
234003,
234006,
127511,
152087,
234010,
135707,
135710,
242206,
242208,
291361,
242220,
291378,
152118,
234038,
234041,
315961,
70213,
111193,
242275,
299620,
242279,
168562,
184952,
135805,
135808,
291456,
299655,
373383,
316051,
225941,
316054,
299672,
135834,
373404,
225948,
135839,
299680,
225954,
299684,
135844,
242343,
242345,
373421,
135870,
135873,
135876,
135879,
299720,
299723,
299726,
225998,
226002,
226005,
226008,
299740,
242396,
201444,
299750,
283368,
234219,
283372,
226037,
283382,
316151,
234231,
234236,
242431,
209665,
299778,
234242,
242436,
234246,
226056,
234248,
291593,
242443,
242445,
234254,
291601,
234258,
242450,
242452,
201496,
234264,
234266,
234269,
234272,
234274,
152355,
299814,
234278,
283432,
234281,
234284,
234287,
283440,
185138,
242483,
234292,
234296,
160572,
283452,
234302,
234307,
242499,
234309,
316233,
234313,
316235,
234316,
283468,
234319,
242511,
234321,
234324,
185173,
201557,
234329,
234333,
308063,
234336,
242530,
349027,
234338,
234344,
177004,
234350,
324464,
234353,
152435,
177011,
234356,
234358,
234362,
291711,
234368,
291714,
201603,
291716,
234373,
234370,
226182,
234375,
226185,
324490,
308105,
234384,
234388,
234390,
324504,
226200,
234393,
308123,
234396,
324508,
291742,
234401,
291747,
291748,
234405,
291750,
324518,
324520,
234407,
324522,
291754,
291756,
226220,
234414,
324527,
291760,
201650,
324531,
226230,
234422,
324536,
275384,
234428,
291773,
242623,
324544,
226239,
234434,
324546,
324548,
234431,
226245,
234437,
234439,
234443,
291788,
193486,
234446,
193488,
234449,
275406,
234452,
234455,
234459,
234461,
234464,
234467,
234470,
168935,
5096,
324585,
234478,
316400,
234481,
316403,
234484,
234485,
234487,
234493,
316416,
234496,
234501,
308231,
234504,
234507,
234515,
300054,
316439,
234520,
234519,
234523,
234526,
234528,
300066,
234532,
300069,
234535,
234537,
234540,
234543,
234546,
275508,
300085,
234549,
300088,
234553,
234558,
316479,
234561,
316483,
160835,
234563,
308291,
234568,
234570,
316491,
234572,
300108,
234574,
300115,
234580,
234581,
234585,
242777,
275545,
234593,
234595,
234597,
300133,
300139,
234605,
160879,
234607,
275569,
234610,
316530,
300148,
234614,
144506,
234618,
234620,
275579,
234623,
226433,
234627,
275588,
234634,
234636,
177293,
234640,
275602,
234643,
308373,
324757,
234647,
226453,
275606,
234650,
308379,
234648,
300189,
324766,
119967,
324768,
275608,
234653,
283805,
242852,
300197,
234657,
275626,
234667,
316596,
308414,
234687,
300226,
308418,
234692,
300229,
308420,
308422,
283844,
300234,
283850,
300238,
300241,
316625,
300243,
300245,
316630,
300248,
300253,
300256,
300258,
300260,
234726,
300263,
300265,
300267,
161003,
300270,
300272,
120053,
300278,
275703,
316663,
300284,
275710,
300287,
292097,
300289,
300292,
300294,
275719,
234760,
177419,
300299,
242957,
300301,
275725,
283917,
177424,
349464,
283939,
259367,
283951,
300344,
226617,
243003,
226628,
300357,
177482,
283983,
316758,
357722,
316766,
292192,
316768,
218464,
292197,
316774,
243046,
218473,
136562,
275834,
333178,
275836,
275840,
316803,
316806,
226696,
316811,
226699,
316814,
300433,
234899,
300436,
357783,
316824,
316826,
300448,
144810,
144812,
144814,
144820,
374196,
284084,
292279,
284087,
144826,
144828,
144830,
144832,
144835,
144837,
144839,
144841,
144844,
144847,
144852,
144855,
103899,
300507,
333280,
218597,
292329,
300523,
259565,
300527,
308720,
259567,
292338,
316917,
292343,
308727,
300537,
316933,
316947,
308757,
308762,
284194,
284196,
235045,
284199,
284204,
284206,
284209,
284211,
194101,
284213,
316983,
194103,
284215,
308790,
284218,
226877,
292414,
284223,
284226,
284228,
292421,
226886,
284231,
284234,
276043,
317004,
366155,
284238,
226895,
284241,
194130,
284243,
300628,
284245,
292433,
284247,
276053,
284249,
317015,
243290,
284253,
243293,
284255,
300638,
284258,
292452,
292454,
177766,
292458,
284267,
292461,
284272,
284274,
284278,
292470,
276086,
292473,
284283,
276093,
284286,
292479,
284288,
292481,
284290,
325250,
284292,
292485,
276098,
284297,
317066,
284299,
317068,
284301,
284303,
284306,
276114,
284308,
284312,
284314,
284316,
276127,
284320,
284322,
284327,
284329,
317098,
284331,
276137,
284333,
284335,
284337,
284339,
300726,
284343,
284346,
284350,
358080,
276160,
284354,
358083,
284358,
358089,
284362,
276170,
284365,
276175,
284368,
276177,
284370,
358098,
284372,
317138,
284377,
358114,
358116,
276197,
358119,
325353,
358122,
358126,
276206,
358128,
358133,
358135,
276216,
358138,
300795,
358140,
284413,
358142,
358146,
284418,
317187,
317189,
317191,
284428,
300816,
300819,
317207,
300828,
300830,
276255,
300832,
325408,
317221,
227109,
358183,
186151,
276268,
243504,
300850,
284469,
276280,
325436,
358206,
276291,
366406,
276295,
300872,
292681,
153417,
358224,
284499,
276308,
178006,
317271,
284502,
276315,
292700,
317279,
284511,
227175,
292715,
292721,
284529,
300915,
284533,
292729,
317306,
284540,
292734,
325512,
169868,
317332,
358292,
350106,
284572,
276386,
284579,
276388,
358312,
317353,
292776,
284585,
276395,
276402,
358326,
161718,
358330,
276411,
276425,
301009,
301011,
301013,
292823,
358360,
301017,
301015,
292828,
153568,
292839,
292843,
178161,
227314,
325624,
317435,
317446,
292876,
317456,
276496,
317458,
178195,
243733,
243740,
317468,
317472,
325666,
243751,
292904,
276528,
243762,
309298,
325685,
325689,
235579,
325692,
235581,
178238,
276539,
325700,
292934,
243785,
350293,
350295,
309337,
227418,
350302,
227423,
350304,
178273,
309346,
227426,
194660,
350308,
309350,
309348,
292968,
309352,
350313,
309354,
301163,
350316,
227430,
301167,
276586,
350321,
227440,
284786,
276595,
350325,
252022,
350328,
292985,
301178,
350332,
292989,
301185,
292993,
350339,
317573,
350342,
350345,
350349,
301199,
317584,
325777,
350354,
350357,
350359,
350362,
350366,
276638,
153765,
284837,
350375,
350379,
350381,
350383,
350385,
350387,
350389,
350395,
350397,
350399,
227520,
350402,
227522,
301252,
350406,
227529,
301258,
276685,
309455,
276689,
301272,
276699,
194780,
309468,
309471,
301283,
317672,
317674,
325867,
243948,
194801,
309494,
243960,
227583,
276735,
276739,
211204,
276742,
227596,
325910,
309530,
342298,
211232,
317729,
211241,
325937,
325943,
211260,
260421,
285002,
276811,
235853,
276816,
235858,
276829,
276833,
391523,
276836,
293227,
276843,
293232,
276848,
186744,
211324,
317833,
178572,
285070,
178583,
227738,
317853,
317858,
342434,
285093,
317864,
285098,
276907,
235955,
293304,
293307,
293314,
309707,
293325,
317910,
293336,
235996,
317917,
293343,
358880,
276961,
293346,
276964,
293352,
236013,
293364,
301562,
293370,
317951,
309764,
301575,
293387,
236043,
342541,
317963,
113167,
55822,
309779,
317971,
309781,
55837,
227879,
293417,
227882,
309804,
293421,
105007,
236082,
285236,
23094,
277054,
244288,
301636,
318020,
301639,
301643,
285265,
309844,
277080,
309849,
285277,
285282,
326244,
318055,
277100,
121458,
170618,
170619,
309885,
309888,
277122,
227975,
277128,
285320,
301706,
318092,
326285,
334476,
318094,
277136,
277139,
227992,
318108,
285340,
318110,
227998,
137889,
383658,
285357,
318128,
277170,
293555,
154292,
277173,
342707,
277177,
277181,
318144,
277187,
277191,
277194,
277196,
277201,
137946,
113378,
203491,
228069,
277223,
342760,
56041,
285417,
56043,
277232,
228081,
56059,
310015,
310020,
310029,
228113,
285459,
277273,
293659,
326430,
285474,
293666,
228135,
318248,
277291,
318253,
293677,
285489,
301876,
293685,
285494,
301880,
285499,
301884,
293696,
310080,
277317,
277329,
162643,
310100,
301911,
277337,
301921,
400236,
236397,
162671,
326514,
236408,
15224,
277368,
416639,
416640,
113538,
310147,
416648,
39817,
187274,
277385,
301972,
424853,
310179,
293798,
293802,
236460,
276579,
293811,
293817,
293820,
203715,
326603,
293849,
293861,
228327,
228328,
318442,
326638,
277486,
318450,
293876,
293877,
285686,
302073,
121850,
293882,
302075,
293887,
277504,
277507,
277511,
293899,
277519,
293908,
302105,
293917,
293939,
318516,
277561,
277564,
310336,
7232,
293956,
277573,
228422,
293960,
277577,
310344,
277583,
203857,
293971,
310355,
310359,
236632,
277594,
138332,
277598,
203872,
277601,
285792,
310374,
203879,
310376,
228460,
318573,
203886,
187509,
285815,
367737,
285817,
302205,
392326,
294026,
285835,
302218,
162964,
384148,
187542,
302231,
285849,
302233,
285852,
302237,
285854,
285856,
302241,
285862,
277671,
302248,
64682,
277678,
294063,
294065,
302258,
294072,
318651,
277695,
318657,
244930,
302275,
130244,
302282,
310476,
302285,
302288,
310481,
302290,
203987,
302292,
302294,
310486,
302296,
384222,
310498,
285927,
318698,
302315,
228592,
294132,
138485,
204026,
228606,
204031,
64768,
310531,
138505,
228617,
318742,
204067,
277801,
277804,
285997,
285999,
277807,
113969,
277811,
318773,
318776,
277816,
286010,
277819,
294204,
417086,
277822,
302403,
294211,
277832,
277836,
294221,
294223,
326991,
277839,
277842,
277847,
277850,
179547,
277853,
277857,
277860,
302436,
294246,
327015,
310632,
327017,
351594,
277864,
277869,
277872,
351607,
310648,
277880,
310651,
277884,
277888,
310657,
351619,
294276,
310659,
277892,
277894,
253320,
310665,
318858,
327046,
277898,
277903,
310672,
277905,
351633,
277908,
277917,
310689,
277921,
130468,
277928,
277932,
310703,
277937,
310710,
130486,
310712,
277944,
277947,
310715,
302526,
228799,
277950,
277953,
302534,
310727,
245191,
64966,
277959,
277963,
302541,
277966,
302543,
310737,
277971,
228825,
277978,
310749,
277981,
277984,
310755,
277989,
277991,
277995,
310764,
286188,
278000,
228851,
310772,
278003,
278006,
40440,
212472,
278009,
40443,
286203,
40448,
228864,
286214,
302603,
302614,
286233,
302621,
286240,
146977,
187939,
40484,
294435,
40486,
286246,
294440,
40488,
294439,
294443,
40491,
294445,
286248,
310831,
40499,
40502,
212538,
40507,
40511,
40513,
327240,
40521,
286283,
40525,
40527,
212560,
400976,
228944,
40533,
40537,
40539,
40541,
278109,
40544,
40548,
40550,
40552,
286313,
40554,
310892,
40557,
40560,
188022,
122488,
294521,
343679,
294537,
310925,
286354,
278163,
302740,
278168,
179870,
327333,
229030,
212648,
278188,
302764,
319153,
278196,
302781,
319171,
302789,
294599,
278216,
294601,
302793,
343757,
212690,
319187,
229076,
286425,
319194,
229086,
286432,
294625,
294634,
302838,
319226,
286460,
302852,
302854,
294664,
311048,
319243,
311053,
302862,
319251,
294682,
278306,
188199,
294701,
278320,
319280,
319290,
229192,
302925,
188247,
188252,
237409,
360317,
294785,
327554,
40840,
40851,
294803,
188312,
294811,
237470,
319390,
40865,
319394,
294817,
294821,
311209,
180142,
343983,
188340,
40886,
319419,
294844,
294847,
393177,
294876,
294879,
294883,
294890,
311279,
278513,
237555,
311283,
278516,
237562
] |
5bf2ca47e59207643fa38c8e500a1951bde5f000
|
2d7eb652f65441f54ab82df6f7cd39e4aaf9462a
|
/Yelpify/AppDelegate.swift
|
6ede0d5bfdc430100954a883b6530b427512bda7
|
[] |
no_license
|
manderson-productions/Yelpify
|
c5c7f605e76c7fb906ecde9e78a76463474552a2
|
9d7dacfa095040c535da9c55a7ec2f7931d8ee37
|
refs/heads/master
| 2021-01-10T07:11:58.375101 | 2016-02-23T16:08:33 | 2016-02-23T16:08:33 | 52,300,459 | 0 | 0 | null | 2016-02-23T16:08:33 | 2016-02-22T19:43:56 |
Objective-C
|
UTF-8
|
Swift
| false | false | 2,148 |
swift
|
//
// AppDelegate.swift
// Yelpify
//
// Created by Mark Anderson on 2/21/16.
// Copyright © 2016 markmakingmusic. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
return true
}
func applicationWillResignActive(application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}
func applicationDidEnterBackground(application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(application: UIApplication) {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
}
|
[
229380,
229383,
229385,
278539,
294924,
229388,
278542,
229391,
327695,
278545,
229394,
278548,
229397,
229399,
229402,
278556,
352284,
229405,
278559,
229408,
278564,
294950,
229415,
229417,
237613,
229422,
360496,
229426,
237618,
229428,
286774,
204856,
229432,
286776,
319544,
286791,
237640,
278605,
286797,
311375,
163920,
237646,
196692,
319573,
311383,
278623,
278626,
319590,
311400,
278635,
303212,
278639,
131192,
278648,
237693,
327814,
131209,
417930,
303241,
303244,
311436,
319633,
286873,
286876,
311460,
311469,
32944,
327862,
286906,
327866,
180413,
286910,
131264,
286916,
286922,
286924,
286926,
319694,
286928,
131281,
278743,
278747,
295133,
155872,
319716,
278760,
237807,
303345,
286962,
131314,
229622,
327930,
278781,
278783,
278785,
237826,
319751,
278792,
286987,
319757,
311569,
286999,
319770,
287003,
287006,
287009,
287012,
287014,
287016,
287019,
311598,
287023,
262448,
311601,
287032,
155966,
278849,
319809,
319810,
319814,
311623,
319818,
311628,
229709,
287054,
319822,
278865,
229717,
196963,
196969,
139638,
213367,
106872,
319872,
311683,
311693,
65943,
319898,
311719,
278952,
139689,
278957,
311728,
278967,
180668,
311741,
278975,
319938,
278980,
98756,
278983,
319945,
278986,
319947,
278990,
278994,
311767,
279003,
279006,
188895,
172512,
279010,
287202,
279015,
172520,
319978,
279020,
172526,
279023,
311791,
172529,
279027,
319989,
164343,
180727,
279035,
311804,
287230,
279040,
303617,
287234,
279045,
287238,
172550,
172552,
303623,
320007,
279051,
172558,
279055,
303632,
279058,
303637,
279063,
279067,
172572,
279072,
172577,
295459,
172581,
295461,
279082,
311850,
279084,
172591,
172598,
279095,
172607,
172609,
172612,
377413,
172614,
172618,
303690,
33357,
287309,
279124,
172634,
262752,
172644,
311911,
189034,
295533,
189039,
189040,
352880,
295538,
172655,
189044,
287349,
172656,
172660,
287355,
287360,
295553,
287365,
311942,
303751,
295557,
352905,
279178,
311946,
287371,
311951,
287377,
172691,
287381,
311957,
221850,
287386,
303773,
164509,
295583,
172702,
230045,
287390,
172705,
287394,
172707,
303780,
287398,
279208,
287400,
172714,
295595,
279212,
189102,
172721,
287409,
66227,
303797,
189114,
287419,
303804,
328381,
279231,
287423,
328384,
287427,
312006,
107208,
279241,
172748,
287436,
107212,
172751,
287440,
295633,
303827,
172755,
279255,
172760,
279258,
287450,
213724,
303835,
189149,
303838,
279267,
312035,
295654,
279272,
230128,
312048,
312050,
230131,
205564,
303871,
230146,
295685,
230154,
33548,
312077,
295695,
295701,
369433,
230169,
295707,
328476,
295710,
230175,
303914,
279340,
205613,
279353,
230202,
312124,
222018,
295755,
377676,
148302,
287569,
279383,
303959,
230237,
279390,
230241,
279394,
303976,
336744,
303985,
328563,
303987,
279413,
303991,
303997,
295806,
295808,
304005,
295813,
213895,
320391,
304007,
304009,
304011,
230284,
304013,
213902,
279438,
295822,
189329,
295825,
304019,
189331,
279445,
58262,
279452,
410526,
279461,
279462,
304042,
213931,
230327,
304055,
287675,
304063,
238528,
304065,
189378,
213954,
156612,
295873,
213963,
312272,
304084,
304090,
320481,
304106,
320490,
312302,
328687,
320496,
304114,
295928,
320505,
312321,
295945,
197645,
295949,
230413,
320528,
140312,
295961,
238620,
197663,
304164,
189479,
304170,
238641,
312374,
238652,
238655,
230465,
238658,
296004,
336964,
205895,
320584,
238666,
296021,
402518,
336987,
230497,
296036,
296040,
361576,
205931,
296044,
164973,
279661,
205934,
312432,
279669,
337018,
189562,
279679,
279683,
222340,
205968,
296084,
238745,
304285,
238756,
205991,
222377,
165035,
337067,
238766,
165038,
230576,
304311,
230592,
279750,
312518,
230600,
230607,
148690,
320727,
279769,
304348,
279777,
304354,
296163,
320740,
279781,
304360,
279788,
320748,
279790,
304370,
296189,
320771,
312585,
296202,
296205,
230674,
320786,
230677,
296213,
296215,
320792,
230681,
230679,
214294,
304416,
230689,
173350,
312622,
296243,
312630,
222522,
222525,
296253,
296255,
312639,
230718,
296259,
378181,
238919,
296264,
320840,
230727,
296267,
296271,
222545,
230739,
312663,
222556,
337244,
230752,
312676,
230760,
173418,
410987,
230763,
230768,
296305,
312692,
230773,
279929,
304505,
304506,
181626,
181631,
312711,
296331,
288140,
288144,
230800,
304533,
337306,
288154,
288160,
173472,
288162,
288164,
279975,
304555,
370092,
279983,
288176,
279985,
173488,
312755,
296373,
279991,
312759,
288185,
337335,
222652,
312766,
173507,
296389,
222665,
230860,
312783,
288208,
230865,
370130,
288210,
288212,
280021,
288214,
222676,
239064,
288217,
288218,
280027,
288220,
329177,
239070,
288224,
370146,
288226,
280036,
280034,
280038,
288230,
288229,
288232,
288234,
320998,
288236,
288238,
288240,
288242,
296435,
288244,
296439,
288250,
148990,
296446,
402942,
206336,
296450,
321022,
230916,
230919,
214535,
370187,
304651,
304653,
230940,
222752,
108066,
296486,
296488,
157229,
230961,
288320,
288325,
124489,
280140,
280145,
288338,
280149,
288344,
280152,
239194,
280158,
403039,
370272,
181854,
239202,
312938,
280183,
280185,
280188,
280191,
280194,
116354,
280208,
280211,
288408,
280218,
280222,
190118,
321195,
296622,
321200,
337585,
296626,
296634,
296637,
280260,
280264,
206536,
206539,
206541,
206543,
280276,
313044,
321239,
280283,
288478,
313055,
321252,
313066,
280302,
288494,
280304,
313073,
419570,
288499,
288502,
280314,
288510,
124671,
67330,
280324,
280331,
198416,
280337,
296723,
116503,
321304,
329498,
296731,
321311,
313121,
313123,
321316,
304932,
280363,
141101,
165678,
280375,
321336,
296767,
288576,
345921,
280388,
304968,
280393,
280402,
313176,
42842,
280419,
321381,
296812,
313201,
1920,
255873,
305028,
280454,
247688,
280458,
280464,
124817,
280468,
239510,
280473,
124827,
214940,
247709,
280487,
313258,
321458,
296883,
124853,
214966,
296890,
10170,
288700,
296894,
280515,
190403,
296900,
337862,
165831,
280521,
231379,
296921,
239586,
313320,
231404,
124913,
165876,
321528,
313340,
288764,
239612,
239617,
313347,
288773,
313358,
305176,
313371,
354338,
305191,
223273,
313386,
354348,
124978,
215090,
124980,
288824,
288826,
321595,
378941,
313406,
288831,
288836,
67654,
223303,
280651,
354382,
288848,
280658,
215123,
354390,
288855,
288859,
280669,
313438,
223327,
149599,
280671,
149601,
149603,
321634,
329830,
280681,
313451,
223341,
280687,
313458,
280691,
215154,
313464,
321659,
280702,
288895,
321670,
215175,
141446,
141455,
141459,
280725,
313498,
288936,
100520,
280747,
288940,
280755,
288947,
321717,
280759,
280764,
280769,
280771,
280774,
280776,
313548,
321740,
280783,
280786,
280788,
313557,
280793,
280796,
280798,
338147,
280804,
280807,
157930,
280811,
280817,
280819,
157940,
182517,
125171,
280823,
280825,
280827,
280830,
280831,
280833,
280835,
125187,
125191,
125207,
125209,
321817,
125218,
321842,
223539,
125239,
280888,
280891,
289087,
280897,
280900,
305480,
239944,
280906,
239947,
305485,
305489,
379218,
280919,
354653,
313700,
280937,
313705,
280940,
190832,
280946,
223606,
313720,
280956,
280959,
313731,
199051,
240011,
289166,
240017,
297363,
190868,
297365,
240021,
297368,
297372,
141725,
297377,
289186,
297391,
289201,
240052,
289207,
305594,
289210,
281024,
289218,
289221,
289227,
281045,
281047,
215526,
166378,
305647,
281075,
174580,
281084,
240124,
305662,
305664,
240129,
305666,
240132,
223749,
305668,
281095,
223752,
150025,
338440,
223757,
281102,
223763,
223765,
281113,
322074,
281116,
281121,
182819,
281127,
281135,
150066,
158262,
158266,
289342,
281154,
322115,
158283,
281163,
281179,
199262,
338528,
338532,
281190,
199273,
281196,
158317,
19053,
313973,
281210,
297594,
158347,
133776,
314003,
117398,
314007,
289436,
174754,
330404,
289448,
133801,
174764,
314029,
314033,
240309,
133817,
314045,
314047,
314051,
199364,
297671,
199367,
158409,
289493,
363234,
289513,
289522,
289525,
289532,
322303,
289537,
322310,
264969,
322314,
322318,
281361,
281372,
322341,
215850,
281388,
281401,
289593,
289601,
281410,
281413,
281414,
240458,
281420,
240468,
281430,
322393,
297818,
281435,
281438,
281442,
174955,
224110,
207733,
207737,
183172,
158596,
338823,
322440,
314249,
240519,
183184,
240535,
289687,
289694,
289696,
289700,
289712,
281529,
289724,
52163,
183260,
281567,
289762,
322534,
297961,
281581,
183277,
322550,
134142,
322563,
175134,
322599,
322610,
314421,
281654,
314427,
314433,
207937,
314441,
207949,
322642,
314456,
281691,
314461,
281702,
281704,
314474,
281708,
281711,
289912,
248995,
306341,
306344,
306347,
306354,
142531,
199877,
289991,
306377,
289997,
249045,
363742,
363745,
298216,
330988,
126190,
216303,
322801,
388350,
257302,
363802,
199976,
199978,
314671,
298292,
298294,
257334,
216376,
298306,
380226,
224584,
224587,
224594,
216404,
306517,
150870,
314714,
224603,
159068,
314718,
265568,
314723,
281960,
150890,
306539,
314732,
314736,
290161,
216436,
306549,
298358,
314743,
306552,
290171,
306555,
314747,
290174,
298365,
224641,
281987,
298372,
314756,
281990,
224647,
265604,
298377,
314763,
142733,
298381,
224657,
306581,
314779,
314785,
282025,
282027,
241068,
241070,
241072,
282034,
241077,
150966,
298424,
306618,
282044,
323015,
306635,
306640,
290263,
290270,
290275,
339431,
282089,
191985,
282098,
290291,
282101,
241142,
191992,
290298,
151036,
290302,
282111,
290305,
175621,
192008,
323084,
257550,
282127,
290321,
282130,
323090,
282133,
290325,
241175,
290328,
282137,
290332,
241181,
282142,
282144,
290344,
306731,
290349,
290351,
290356,
282186,
224849,
282195,
282199,
282201,
306778,
159324,
159330,
314979,
298598,
323176,
224875,
241260,
323181,
257658,
315016,
282249,
290445,
282261,
298651,
323229,
282269,
298655,
323231,
61092,
282277,
306856,
282295,
282300,
323260,
323266,
282310,
323273,
282319,
306897,
241362,
282328,
298714,
52959,
216801,
282337,
241380,
216806,
323304,
282345,
12011,
282356,
323318,
282364,
282367,
306945,
241412,
323333,
282376,
216842,
323345,
282388,
323349,
282392,
184090,
315167,
315169,
282402,
315174,
323367,
241448,
315176,
282410,
241450,
306988,
306991,
315184,
323376,
315190,
241464,
282425,
159545,
298811,
307009,
413506,
241475,
307012,
148946,
315211,
282446,
307027,
315221,
282454,
315223,
241496,
323414,
241498,
307035,
307040,
282465,
110433,
241509,
110438,
298860,
110445,
282478,
315249,
110450,
282481,
315251,
315253,
315255,
339838,
282499,
315267,
315269,
241544,
282505,
241546,
241548,
298896,
282514,
298898,
241556,
44948,
298901,
282520,
241560,
241563,
241565,
241567,
241569,
282531,
241574,
282537,
298922,
178273,
36779,
241581,
282542,
241583,
323504,
241586,
282547,
241588,
290739,
241590,
241592,
241598,
290751,
241600,
241605,
151495,
241610,
298975,
241632,
298984,
241640,
241643,
298988,
241646,
241649,
241652,
323574,
290807,
299006,
282623,
315396,
241669,
315397,
282632,
282639,
290835,
282645,
241693,
282654,
102438,
217127,
282669,
323630,
282681,
290877,
282687,
159811,
315463,
315466,
192589,
307278,
192596,
176213,
307287,
315482,
315483,
217179,
192605,
233567,
200801,
299105,
217188,
299109,
307303,
315495,
356457,
307307,
45163,
315502,
192624,
307314,
323700,
299126,
233591,
299136,
307329,
307338,
233613,
241813,
307352,
299164,
184479,
299167,
184481,
315557,
184486,
307370,
307372,
184492,
307374,
307376,
323763,
176311,
184503,
307385,
307386,
258235,
176316,
307388,
307390,
299200,
184512,
307394,
307396,
299204,
184518,
307399,
323784,
307409,
307411,
176343,
299225,
233701,
307432,
184572,
282881,
184579,
282893,
291089,
282906,
291104,
233766,
176435,
307508,
315701,
307510,
332086,
151864,
168245,
307515,
282942,
307518,
151874,
282947,
282957,
323917,
110926,
233808,
323921,
315733,
323926,
233815,
315739,
323932,
299357,
242018,
242024,
299373,
315757,
250231,
242043,
315771,
299388,
299391,
291202,
299398,
242057,
291212,
299405,
291222,
283033,
291226,
242075,
291231,
61855,
283042,
291238,
291241,
127403,
127405,
291247,
127407,
299440,
299444,
127413,
283062,
291254,
194660,
127417,
291260,
283069,
127421,
127424,
127429,
127431,
283080,
315856,
176592,
315860,
176597,
127447,
283095,
299481,
176605,
242143,
291299,
127463,
242152,
291305,
127466,
176620,
291314,
291317,
135672,
233979,
291323,
291330,
283142,
127497,
135689,
233994,
291341,
233998,
234003,
234006,
127511,
152087,
283161,
234010,
135707,
242202,
135710,
242206,
242208,
291361,
242220,
291378,
234038,
152118,
234041,
70213,
111193,
242275,
299620,
242279,
168562,
184952,
135805,
291456,
135808,
299655,
373383,
135820,
316051,
225941,
316054,
299672,
135834,
373404,
299677,
225948,
135839,
299680,
225954,
299684,
242343,
209576,
242345,
373421,
135870,
135873,
135876,
135879,
299720,
299723,
225998,
299726,
226002,
226005,
119509,
226008,
242396,
299740,
201444,
299750,
283368,
234219,
283372,
381677,
226037,
283382,
234231,
316151,
234236,
226045,
234239,
242431,
209665,
234242,
242436,
234246,
226056,
234248,
291593,
242443,
234252,
242445,
234254,
291601,
234258,
242450,
242452,
234261,
348950,
234264,
201496,
234266,
283421,
234269,
234272,
234274,
152355,
234278,
299814,
283432,
234281,
234284,
234287,
283440,
185138,
242483,
234292,
234296,
234298,
283452,
160572,
234302,
234307,
242499,
234309,
292433,
234313,
316233,
316235,
234316,
283468,
234319,
242511,
234321,
234324,
201557,
234329,
234333,
308063,
234336,
234338,
242530,
349027,
234341,
234344,
234347,
177004,
234350,
324464,
234353,
152435,
177011,
234356,
234358,
234362,
226171,
291711,
234368,
234370,
291714,
291716,
234373,
226182,
234375,
226185,
308105,
234379,
234384,
234388,
234390,
226200,
234393,
209818,
324504,
234396,
324508,
234398,
291742,
308123,
234401,
291747,
291748,
234405,
291750,
234407,
324518,
324520,
234410,
291754,
226220,
324522,
234414,
324527,
291760,
234417,
201650,
324531,
291756,
226230,
234422,
275384,
324536,
234428,
291773,
226239,
234431,
242623,
234434,
324544,
324546,
226245,
234437,
234439,
324548,
234443,
291788,
275406,
234446,
193486,
193488,
234449,
234452,
234455,
234459,
234461,
234464,
234467,
234470,
168935,
5096,
324585,
234475,
234478,
316400,
234481,
316403,
234484,
234485,
234487,
324599,
234490,
234493,
234496,
316416,
234501,
275462,
308231,
234504,
234507,
234510,
234515,
300054,
234519,
316439,
234520,
234523,
234526,
234528,
300066,
234532,
300069,
234535,
234537,
234540,
144430,
234543,
234546,
275508,
234549,
300085,
300088,
234553,
234556,
234558,
316479,
234561,
234563,
316483,
308291,
234568,
234570,
316491,
234572,
300108,
234574,
300115,
234580,
234581,
275545,
234585,
242777,
234590,
234593,
234595,
234597,
300133,
234601,
300139,
234605,
234607,
160879,
275569,
234610,
300148,
234614,
398455,
234618,
275579,
144506,
234620,
234623,
226433,
234627,
275588,
234629,
234634,
234636,
177293,
234640,
275602,
234643,
226453,
275606,
308373,
275608,
234647,
234648,
234650,
308379,
283805,
324757,
234653,
300189,
234657,
324766,
324768,
119967,
283813,
234661,
300197,
234664,
242852,
275626,
234667,
316596,
308414,
234687,
300226,
308418,
226500,
234692,
283844,
300229,
308420,
283850,
300234,
300238,
300241,
316625,
300243,
300245,
316630,
300248,
300253,
300256,
300258,
300260,
234726,
300263,
300265,
161003,
300267,
300270,
300272,
120053,
300278,
275703,
316663,
300284,
275710,
300287,
283904,
292097,
300289,
300292,
300294,
275719,
300299,
177419,
283917,
242957,
275725,
177424,
300301,
349464,
283939,
259367,
283951,
292143,
300344,
226617,
283963,
243003,
226628,
283973,
300357,
177482,
283983,
316758,
357722,
316766,
316768,
218464,
292192,
292197,
316774,
243046,
218473,
284010,
136562,
324978,
275834,
333178,
275836,
275840,
316803,
316806,
226696,
316811,
226699,
316814,
226703,
300433,
234899,
226709,
357783,
316824,
316826,
144796,
300448,
144807,
144810,
284076,
144812,
144814,
284084,
144820,
284087,
292279,
144826,
144828,
144830,
144832,
144835,
284099,
144837,
38342,
144839,
144841,
144844,
144847,
144852,
144855,
103899,
300507,
333280,
226787,
218597,
292329,
300523,
259565,
300527,
308720,
259567,
226802,
316917,
292343,
308727,
300537,
316947,
308757,
308762,
284191,
284194,
284196,
235045,
284199,
284204,
284206,
284209,
284211,
284213,
194101,
284215,
194103,
284218,
226877,
284223,
284226,
243268,
284228,
226886,
284231,
128584,
292421,
284234,
276043,
317004,
366155,
284238,
226895,
284241,
194130,
284243,
276052,
276053,
284245,
284247,
300628,
235097,
243290,
284251,
284249,
284253,
317015,
284255,
300638,
243293,
284258,
292452,
292454,
284263,
177766,
284265,
292458,
284267,
292461,
284272,
284274,
276086,
292470,
284278,
292473,
284283,
276093,
284286,
276095,
292479,
284288,
276098,
325250,
284290,
292485,
284292,
292481,
284297,
317066,
284299,
317068,
276109,
284301,
284303,
276114,
284306,
284308,
284312,
284314,
284316,
276127,
284320,
284322,
284327,
276137,
284329,
284331,
317098,
284333,
284335,
276144,
284337,
284339,
300726,
284343,
284346,
284350,
276160,
358080,
284354,
358083,
276166,
284358,
358089,
276170,
284362,
276175,
284368,
276177,
317138,
358098,
284370,
284372,
284377,
276187,
284379,
284381,
284384,
284386,
358116,
276197,
317158,
284392,
325353,
284394,
358122,
284397,
276206,
284399,
358128,
358126,
358133,
358135,
276216,
358138,
300795,
358140,
284413,
358142,
284418,
317187,
358146,
317189,
317191,
284428,
300816,
300819,
317207,
284440,
186139,
300828,
300830,
276255,
300832,
284449,
325408,
300834,
227109,
317221,
358183,
186151,
276268,
300845,
194351,
243504,
300850,
284469,
276280,
325436,
358206,
276291,
366406,
276295,
300872,
153417,
284499,
276308,
284502,
317271,
178006,
276315,
292700,
284511,
227175,
292715,
300912,
284529,
292721,
300915,
284533,
292729,
317306,
284540,
292734,
325512,
169868,
276365,
284564,
358292,
284566,
350106,
284572,
276386,
284579,
276388,
358312,
284585,
317353,
276395,
292776,
292784,
276402,
358326,
161718,
276410,
358330,
276411,
276418,
276425,
301009,
301011,
301013,
292823,
301015,
301017,
358360,
292828,
276446,
153568,
276448,
276452,
276455,
292839,
292843,
276460,
276464,
178161,
227314,
276466,
276472,
325624,
317435,
276476,
276479,
276482,
276485,
276490,
292876,
276496,
317456,
317458,
243733,
243740,
317468,
317472,
325666,
243751,
292904,
276528,
243762,
309298,
325685,
325689,
276539,
235579,
235581,
325692,
178238,
276544,
284739,
292934,
276553,
243785,
350293,
350295,
194649,
227418,
309337,
194654,
227423,
350302,
194657,
227426,
276579,
309346,
309348,
227430,
276583,
350308,
309350,
276586,
309352,
350313,
350316,
276590,
301167,
227440,
350321,
284786,
276595,
301163,
350325,
350328,
292985,
301178,
292989,
301185,
317570,
350339,
292993,
317573,
350342,
227463,
350345,
350349,
301199,
317584,
325777,
350354,
350357,
350359,
350362,
276638,
350366,
284837,
153765,
350375,
350379,
350381,
350383,
129200,
350385,
350387,
350389,
350395,
350397,
350399,
227520,
350402,
227522,
301252,
350406,
227529,
301258,
309450,
276685,
276689,
227540,
309462,
301272,
276699,
309468,
194780,
309471,
301283,
317672,
276713,
317674,
325867,
243948,
194801,
227571,
309491,
276725,
309494,
243960,
276735,
227583,
227587,
276739,
211204,
276742,
227593,
227596,
325910,
309530,
342298,
276766,
211232,
317729,
276775,
211241,
325937,
276789,
325943,
211260,
260421,
276809,
285002,
276811,
235853,
276816,
235858,
276829,
276833,
391523,
276836,
276843,
293227,
276848,
293232,
186744,
285051,
211324,
227709,
285061,
317833,
178572,
285070,
285077,
178583,
227738,
317853,
276896,
317858,
342434,
285093,
285098,
276907,
235955,
276917,
293304,
293307,
293314,
309707,
293325,
317910,
293336,
235996,
317917,
293343,
358880,
276961,
227810,
293346,
276964,
293352,
236013,
293364,
301562,
317951,
309764,
301575,
121352,
236043,
317963,
342541,
55822,
113167,
277011,
309779,
317971,
309781,
55837,
227877,
227879,
293417,
227882,
293421,
105007,
236082,
285236,
23094,
277054,
244288,
129603,
301636,
318020,
301639,
301643,
277071,
285265,
399955,
309844,
277080,
309849,
285277,
285282,
326244,
318055,
277100,
277106,
121458,
170618,
170619,
309885,
309888,
277122,
227975,
277128,
285320,
301706,
334476,
326285,
318094,
318092,
277136,
277139,
227992,
285340,
318108,
227998,
318110,
137889,
383658,
285357,
318128,
277170,
342707,
154292,
277173,
293555,
318132,
285368,
277177,
277181,
318144,
277187,
277191,
277194,
277196,
277201,
137946,
113378,
203491,
228069,
277223,
342760,
285417,
56041,
56043,
277232,
228081,
56059,
310015,
285441,
310020,
285448,
310029,
285453,
228113,
285459,
277273,
293659,
326430,
228128,
293666,
285474,
228135,
318248,
277291,
293677,
318253,
285489,
293685,
285494,
301880,
285499,
301884,
293696,
310080,
277314,
277317,
277322,
277329,
162643,
310100,
301911,
277337,
301913,
301921,
400236,
236397,
162671,
326514,
310134,
277368,
236408,
15224,
416639,
416640,
113538,
310147,
416648,
277385,
39817,
187274,
301972,
424853,
277405,
277411,
310179,
293798,
293802,
236460,
277426,
293811,
293817,
293820,
203715,
326603,
293849,
293861,
228327,
228328,
228330,
318442,
228332,
277486,
326638,
318450,
293876,
293877,
285686,
302073,
285690,
121850,
302075,
244731,
293882,
293887,
277504,
277507,
277511,
277519,
293908,
293917,
293939,
318516,
277561,
277564,
7232,
310336,
293956,
277573,
228422,
293960,
277577,
310344,
277583,
203857,
293971,
310355,
310359,
236632,
277594,
138332,
277598,
285792,
203872,
277601,
310374,
203879,
310376,
228460,
318573,
203886,
187509,
285815,
285817,
367737,
285821,
302205,
285824,
392326,
285831,
253064,
302218,
285835,
294026,
384148,
162964,
187542,
302231,
285849,
302233,
285852,
302237,
285854,
285856,
285862,
277671,
302248,
64682,
277678,
228526,
294063,
294065,
302258,
277687,
294072,
318651,
294076,
277695,
318657,
244930,
302275,
130244,
302277,
228550,
302282,
310476,
302285,
302288,
310481,
302290,
203987,
302292,
302294,
302296,
384222,
310498,
285927,
318698,
302315,
195822,
228592,
294132,
138485,
228601,
204026,
228606,
204031,
64768,
310531,
285958,
228617,
138505,
318742,
204067,
277798,
130345,
277801,
113964,
285997,
277804,
277807,
285999,
113969,
277811,
318773,
277816,
318776,
286010,
277819,
294204,
417086,
277822,
286016,
294211,
302403,
384328,
277832,
277836,
294221,
294223,
326991,
277839,
277842,
277847,
277850,
179547,
277853,
146784,
277857,
302436,
277860,
294246,
327015,
310632,
327017,
351594,
277864,
277869,
277872,
351607,
310648,
277880,
310651,
277884,
277888,
310657,
310659,
294276,
351619,
277892,
327046,
253320,
310665,
318858,
277898,
277894,
277903,
310672,
351633,
277905,
277908,
277917,
310689,
277921,
277923,
130468,
228776,
277928,
277932,
310703,
277937,
130486,
310710,
310712,
277944,
310715,
277947,
302526,
228799,
277950,
277953,
64966,
302534,
163272,
245191,
310727,
277959,
292968,
302541,
277966,
302543,
277963,
310737,
277971,
277975,
228825,
163290,
277978,
310749,
277981,
277984,
310755,
277989,
277991,
187880,
277995,
286188,
310764,
278000,
278003,
310772,
228851,
278006,
40440,
278009,
212472,
286203,
40443,
228864,
40448,
286214,
228871,
302603,
65038,
302614,
286233,
302617,
302621,
286240,
146977,
187939,
294435,
40484,
40486,
294439,
294440,
40488,
286246,
294443,
278057,
294445,
286248,
40491,
310831,
40499,
40502,
212538,
40507,
40511,
40513,
228933,
40521,
286283,
40525,
40527,
228944,
400976,
212560,
40533,
147032,
40537,
278109,
40541,
40544,
40548,
40550,
286312,
286313,
40552,
40554,
310892,
40557,
40560,
188022,
122488,
294521,
343679,
310925,
286354,
278163,
302740,
122517,
278168,
327333,
229030,
212648,
278188,
302764,
278192,
319153,
278196,
302781,
319171,
302789,
294599,
278216,
294601,
302793,
278227,
229076,
286420,
319187,
286425,
319194,
278235,
229086,
278238,
286432,
294625,
294634,
302838,
319226,
286460,
171774,
278274,
302852,
278277,
302854,
294664,
311048,
352008,
319243,
311053,
302862,
319251,
294682,
278306,
188199,
294701,
278320,
319280,
319290,
229192,
302925,
188247,
237409,
294776,
360317,
294785,
327554,
40840,
40851,
294803,
188312,
294811,
319390,
294817,
40865,
319394,
294821,
180142,
294831,
188340,
40886,
319419,
294844,
294847,
309354,
393177,
294876,
294879,
294883,
294890,
311279,
278513,
237555,
278516,
311283,
278519,
237562
] |
0a0b19a67b2c6305be83f422d22c8f89183c7094
|
4dc379ae7a977a9b2bb6c29110ebf6f5702e26c7
|
/car-reservation/TabBarController.swift
|
19dc292fc8295e3d563ddabeabf416f5f1f5c924
|
[] |
no_license
|
chipple-ups/car-reservation
|
96dbb1b5383e5b9119e0685e5c96ec92eae46b5b
|
dff500204a0aa8fcfe3df4ed2b45dd9465d8c0af
|
refs/heads/main
| 2023-05-06T05:28:17.206483 | 2021-05-24T12:59:23 | 2021-05-24T12:59:23 | 364,937,908 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,239 |
swift
|
//
// TabBarController.swift
// car-reservation
//
// Created by 岡澤宏 on 2021/05/03.
//
import UIKit
import Firebase
class TabBarController: UITabBarController, UITabBarControllerDelegate {
override func viewDidLoad() {
super.viewDidLoad()
//タブアイコンの色
self.tabBar.tintColor = UIColor(red: 1.0, green: 0.44, blue: 0.11, alpha: 1)
//タブバーの背景色
self.tabBar.barTintColor = UIColor(red: 0.96, green: 0.91, blue: 0.87, alpha: 1)
//UITabBarControllerDelegateプロトコルのメソッドをこのクラスで処理する
self.delegate = self
///func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool {
///if viewController is ReserveViewController {
// ImageSelectViewControllerは、タブ切り替えではなくモーダル画面遷移する
///let imageSelectViewController = storyboard!.instantiateViewController(withIdentifier: "Reserve")
///present(imageSelectViewController, animated: true)
///return false
///} else {
// その他のViewControllerは通常のタブ切り替えを実施
///return true
///}
///}
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
// currentUserがnilならログインしていない
if Auth.auth().currentUser == nil {
// ログインしていないときの処理
let loginViewController = self.storyboard?.instantiateViewController(withIdentifier: "Login")
self.present(loginViewController!, animated: true, completion: nil)
}
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/
}
|
[
-1
] |
331ca6ee7b337eb4e4ecdcae709cc92ba3c0a1c4
|
3a569e634e75c843cb023b78d7274f37c3e6abcf
|
/MemeMe2.0/MemeEditorViewController.swift
|
99cfc12b58e21947f83903424cd4fa5156a062a1
|
[] |
no_license
|
tjmasterson/MemeMe_2.0
|
9130ba3f5cbb073fcb721088d6eff39f30112cb1
|
dedfb12f95912aafcb5cbb9e41a1131385deb300
|
refs/heads/master
| 2021-01-01T18:44:48.286299 | 2017-08-22T09:47:25 | 2017-08-22T09:47:25 | 98,423,045 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 7,664 |
swift
|
//
// MemeEditorViewController.swift
// MemeMe2.0
//
// Created by Taylor Masterson on 7/25/17.
// Copyright © 2017 Taylor Masterson. All rights reserved.
//
import UIKit
class MemeEditorViewController: UIViewController, UINavigationControllerDelegate {
let myTextAttributes:[String:Any] = [
NSStrokeColorAttributeName: UIColor.black,
NSForegroundColorAttributeName: UIColor.white,
NSFontAttributeName: UIFont(name: "HelveticaNeue-CondensedBlack", size: 40)!,
NSStrokeWidthAttributeName: -3.0]
@IBOutlet weak var cancelButton: UIBarButtonItem!
@IBOutlet weak var shareButton: UIBarButtonItem!
@IBOutlet weak var albumButton: UIBarButtonItem!
@IBOutlet weak var cameraButton: UIBarButtonItem!
@IBOutlet weak var topTextField: UITextField!
@IBOutlet weak var bottomTextField: UITextField!
@IBOutlet weak var imageView: UIImageView!
@IBOutlet weak var topToolbar: UIToolbar!
@IBOutlet weak var bottomToolbar: UIToolbar!
@IBAction func pickImage(_ sender: UIBarButtonItem) {
if sender == albumButton {
presentImagePickerWith(sourceType: .photoLibrary)
} else {
presentImagePickerWith(sourceType: .camera)
}
}
@IBAction func cancelMemeCreation(_ sender: Any) {
topTextField.text = "TOP"
bottomTextField.text = "BOTTOM"
imageView.image = nil
shareButton.isEnabled = false
dismiss(animated: true, completion: nil)
}
@IBAction func shareMeme(_ sender: Any) {
let meme = generateMemeImage()
let activityViewController = UIActivityViewController(activityItems: [meme], applicationActivities: nil)
activityViewController.completionWithItemsHandler = {
(activityType: UIActivityType?, completed: Bool, returnedItems: [Any]?, activityError: Error?) in
if completed {
self.save(memeImage: meme)
activityViewController.dismiss(animated: true, completion: nil)
self.dismiss(animated: true, completion: nil)
}
}
self.present(activityViewController, animated: true, completion: nil)
}
override func viewDidLoad() {
super.viewDidLoad()
configureTextField(textField: topTextField, text: "TOP")
configureTextField(textField: bottomTextField, text: "BOTTOM")
shareButton.isEnabled = false
}
override func viewWillAppear(_ animated: Bool) {
subscribeToKeyboardNotifications()
cameraButton.isEnabled = UIImagePickerController.isSourceTypeAvailable(.camera)
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
unsubscribeToKeyboardNotifications()
}
// MARK: - Top and Botom Text Field Attributes
func configureTextField(textField: UITextField, text: String) {
textField.delegate = self
textField.text = text
textField.defaultTextAttributes = Constants.MemeEditorVCTextAttributes
textField.textAlignment = .center
}
// MARK: - Keyboard Presentation and Notification Setup
func getKeyboardHeight(_ notification:Notification) -> CGFloat {
let userInfo = notification.userInfo
let keyboardSize = userInfo![UIKeyboardFrameEndUserInfoKey] as! NSValue
return keyboardSize.cgRectValue.height
}
func keyboardWillShow(_ notification: Notification){
if bottomTextField.isFirstResponder {
view.frame.origin.y = 0 - getKeyboardHeight(notification)
}
}
func keyboardWillHide(_ notification: Notification) {
view.frame.origin.y = 0
}
func subscribeToKeyboardNotifications() {
NotificationCenter.default.addObserver(self,
selector: #selector(keyboardWillShow(_:)),
name: .UIKeyboardWillShow,
object: nil)
NotificationCenter.default.addObserver(self,
selector: #selector(keyboardWillHide(_:)),
name: .UIKeyboardWillHide,
object: nil)
}
func unsubscribeToKeyboardNotifications() {
NotificationCenter.default.removeObserver(self, name: .UIKeyboardWillShow, object: nil)
NotificationCenter.default.removeObserver(self, name: .UIKeyboardWillHide, object: nil)
}
// MARK: - Create and Save Meme Object
func setToolbars(visible: Bool) {
topToolbar.isHidden = !visible
bottomToolbar.isHidden = !visible
}
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
view.endEditing(true)
}
func generateMemeImage() -> UIImage {
// hide toolbars temporarily to capture image from view
setToolbars(visible: false)
view.endEditing(true)
// get the size of the view and build an image from whats on the screen
UIGraphicsBeginImageContext(self.view.frame.size)
view.drawHierarchy(in: self.view.frame, afterScreenUpdates: true)
let memeImg: UIImage = UIGraphicsGetImageFromCurrentImageContext()!
UIGraphicsEndImageContext()
// give toolbars back to user
setToolbars(visible: true)
return memeImg
}
func save(memeImage: UIImage) {
// Create the meme
if imageView.image != nil && topTextField.text != nil && bottomTextField.text != nil {
let meme = Meme(topText: topTextField.text!,
bottomText: bottomTextField.text!,
originalImage: imageView.image,
memeImage: memeImage)
// Add it to the memes array in the Application Delegate
let appDelegate = UIApplication.shared.delegate as! AppDelegate
appDelegate.memes.append(meme)
} else {
print("nope")
}
}
}
extension MemeEditorViewController: UITextFieldDelegate {
// MARK: - Text Field Delegate
func textFieldDidEndEditing(_ textField: UITextField) {
textField.resignFirstResponder()
}
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
textField.resignFirstResponder()
return true
}
}
extension MemeEditorViewController: UIImagePickerControllerDelegate {
// MARK: - Image Picker Delegate and Presentation
func presentImagePickerWith(sourceType: UIImagePickerControllerSourceType) {
let imagePicker = UIImagePickerController()
imagePicker.delegate = self
imagePicker.sourceType = sourceType
present(imagePicker, animated: true, completion: nil)
}
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
if let image = info[UIImagePickerControllerOriginalImage] as? UIImage {
imageView.image = image
shareButton.isEnabled = true
}
dismiss(animated: true, completion: nil)
}
func imagePickerControllerDidCancel(_ picker: UIImagePickerController) {
if imageView.image == nil {
shareButton.isEnabled = false
}
shareButton.isEnabled = true
dismiss(animated: true, completion: nil)
}
}
|
[
-1
] |
7631d6220b03e65efefdf1a8c746329b88dd6a3f
|
3f9cae8a9a140c0006644a2207dfd73e68fe535d
|
/MercadoPagoSDK/MercadoPagoSDK/MercadoPagoContext.swift
|
f338caef34115b4186f3189163a714b957230ff4
|
[
"MIT"
] |
permissive
|
champo/px-ios
|
0b0f634e8cca6a13b25f4dd3ade15c9f5af2ea1b
|
fe033ffd8f17694969ea5b58ee9e0c9386db9b1b
|
refs/heads/development
| 2021-06-09T17:16:58.733608 | 2016-11-30T19:13:56 | 2016-11-30T19:13:56 | 75,658,401 | 0 | 2 | null | 2016-12-05T19:22:50 | 2016-12-05T19:22:50 | null |
UTF-8
|
Swift
| false | false | 8,940 |
swift
|
//
// MercadoPagoContext.swift
// MercadoPagoSDK
//
// Created by Demian Tejo on 1/7/16.
// Copyright © 2016 MercadoPago. All rights reserved.
//
import Foundation
import UIKit
open class MercadoPagoContext : NSObject, MPTrackerDelegate {
static let sharedInstance = MercadoPagoContext()
var public_key: String = ""
var payer_access_token: String = ""
var base_url: String = ""
var customer_uri: String = ""
var merchant_access_token: String = ""
var initialFlavor: Flavor?
var preference_uri: String = ""
var payment_uri: String = ""
var payment_key : String = ""
var site : Site!
var language : String!
var termsAndConditionsSite : String!
var currency : Currency!
open class var PUBLIC_KEY : String {
return "public_key"
}
open class var PRIVATE_KEY : String {
return "private_key"
}
open class func isAuthenticatedUser() -> Bool{
return !sharedInstance.payer_access_token.isEmpty
}
public func flavor() -> Flavor!{
if (initialFlavor == nil){
return Flavor.Flavor_3
}else{
return initialFlavor
}
}
open func framework() -> String!{
return "iOS"
}
open func sdkVersion() -> String!{
return "2.0.5"
}
static let siteIdsSettings : [String : NSDictionary] = [
"MLA" : ["language" : "es", "currency" : "ARS","termsconditions" : "https://www.mercadopago.com.ar/ayuda/terminos-y-condiciones_299"],
"MLB" : ["language" : "pt", "currency" : "BRL","termsconditions" : "https://www.mercadopago.com.br/ajuda/termos-e-condicoes_300"],
"MLC" : ["language" : "es", "currency" : "CLP","termsconditions" : "https://www.mercadopago.com.co/ayuda/terminos-y-condiciones_299"],
"MLM" : ["language" : "es", "currency" : "MXN","termsconditions" : "https://www.mercadopago.com.mx/ayuda/terminos-y-condiciones_715"]
]
public enum Site : String {
case MLA = "MLA"
case MLB = "MLB"
case MLM = "MLM"
case MLV = "MLV"
case MLU = "MLU"
case MPE = "MPE"
case MLC = "MLC"
case MCO = "MCO"
}
open func siteId() -> String! {
return site.rawValue
}
fileprivate func setSite(_ site : Site) {
let siteConfig = MercadoPagoContext.siteIdsSettings[site.rawValue]
if siteConfig != nil {
self.site = site
self.language = siteConfig!["language"] as! String
self.termsAndConditionsSite = siteConfig!["termsconditions"] as! String
let currency = CurrenciesUtil.getCurrencyFor(siteConfig!["currency"] as? String)
if currency != nil {
self.currency = currency!
}
}
}
open class func setSite(_ site : Site) {
MercadoPagoContext.sharedInstance.setSite(site)
}
open class func setSiteID(_ siteId : String) {
let site = Site(rawValue: siteId)
if site != nil {
MercadoPagoContext.setSite(site!)
}
}
open static func getLanguage() -> String {
return sharedInstance.language
}
open static func getTermsAndConditionsSite() -> String {
return sharedInstance.termsAndConditionsSite
}
open static func getCurrency() -> Currency {
return sharedInstance.currency
}
open func publicKey() -> String!{
return self.public_key
}
fileprivate static var primaryColor : UIColor = UIColor.mpDefaultColor()
fileprivate static var complementaryColor : UIColor = UIColor.blueMercadoPago()
fileprivate static var textColor : UIColor = UIColor.white()
open static func setupPrimaryColor(_ color: UIColor, complementaryColor: UIColor? = nil){
MercadoPagoContext.primaryColor = color
if (complementaryColor != nil){
MercadoPagoContext.setupComplementaryColor(complementaryColor!)
}else{
if (color == UIColor.mpDefaultColor()){
MercadoPagoContext.setupComplementaryColor(UIColor.blueMercadoPago())
}else{
MercadoPagoContext.setupComplementaryColor(color.lighter())
}
}
}
open static func setupComplementaryColor(_ color: UIColor){
MercadoPagoContext.complementaryColor = color
}
internal static func getPrimaryColor() -> UIColor {
return primaryColor
}
internal static func getComplementaryColor() -> UIColor {
return complementaryColor
}
internal static func getTextColor() -> UIColor {
return textColor
}
open static func setDarkTextColor(){
textColor = UIColor.black
}
open static func setLightTextColor(){
textColor = UIColor.white()
}
fileprivate override init() {
super.init()
MercadoPagoUIViewController.loadFont(MercadoPago.DEFAULT_FONT_NAME)
self.setSite(Site.MLA)
}
open class func setPayerAccessToken(_ payerAccessToken : String){
sharedInstance.payer_access_token = payerAccessToken
_ = CardFrontView()
_ = CardBackView()
}
open class func setPublicKey(_ public_key : String){
sharedInstance.public_key = public_key
_ = CardFrontView()
_ = CardBackView()
}
public class func initFlavor1(){
if (MercadoPagoContext.sharedInstance.initialFlavor != nil){
return
}
MercadoPagoContext.sharedInstance.initialFlavor = Flavor.Flavor_1
}
public class func initFlavor2(){
if (MercadoPagoContext.sharedInstance.initialFlavor != nil){
return
}
MercadoPagoContext.sharedInstance.initialFlavor = Flavor.Flavor_2
}
public class func initFlavor3(){
if (MercadoPagoContext.sharedInstance.initialFlavor != nil){
return
}
MercadoPagoContext.sharedInstance.initialFlavor = Flavor.Flavor_3
}
open class func setBaseURL(_ base_url : String){
sharedInstance.base_url = base_url
}
open class func setCustomerURI(_ customer_uri : String){
sharedInstance.customer_uri = customer_uri
}
open class func setPreferenceURI(_ preference_uri : String){
sharedInstance.preference_uri = preference_uri
}
open class func setPaymentURI(_ payment_uri : String){
sharedInstance.payment_uri = payment_uri
}
open class func setMerchantAccessToken(_ merchant_access_token : String){
sharedInstance.merchant_access_token = merchant_access_token
}
open class func merchantAccessToken() -> String {
return sharedInstance.merchant_access_token
}
open class func publicKey() -> String {
return sharedInstance.public_key
}
open class func payerAccessToken() -> String {
return sharedInstance.payer_access_token
}
open class func baseURL() -> String {
return sharedInstance.base_url
}
open class func customerURI() -> String {
return sharedInstance.customer_uri
}
open class func preferenceURI() -> String {
return sharedInstance.preference_uri
}
open class func paymentURI() -> String {
return sharedInstance.payment_uri
}
open class func isCustomerInfoAvailable() -> Bool {
return (self.sharedInstance.base_url.characters.count > 0 && self.sharedInstance.customer_uri.characters.count > 0 && self.sharedInstance.merchant_access_token.characters.count > 0)
}
open class func paymentKey() -> String {
if sharedInstance.payment_key == "" {
sharedInstance.payment_key = String(arc4random()) + String(Date().timeIntervalSince1970)
}
return sharedInstance.payment_key
}
open class func clearPaymentKey(){
sharedInstance.payment_key = ""
}
open class func keyType() -> String{
if(MercadoPagoContext.isAuthenticatedUser()){
return MercadoPagoContext.PRIVATE_KEY
}else{
return MercadoPagoContext.PUBLIC_KEY
}
}
open class func keyValue(_ forcingPublic : Bool = true) -> String{
if forcingPublic {
return MercadoPagoContext.publicKey()
}
if(MercadoPagoContext.isAuthenticatedUser()){
return MercadoPagoContext.payerAccessToken()
}else{
return MercadoPagoContext.publicKey()
}
}
}
|
[
-1
] |
0e61db3ce33f85f024171cad9ec78858a90b9ad0
|
a2c3ff25b034605ea2f8ca83a6a7de70da6d6e28
|
/Extended/Classes/Map.swift
|
d0b6e0b5d6d8ae43f5e28ee3bbe9a0a0e8e02d32
|
[
"MIT"
] |
permissive
|
carabina/Extended
|
9528c8ff388ce56d24c5f62613a8dbac6631238f
|
a22d986ed3cdd7ee0fdfbfe95aaec045af992117
|
refs/heads/master
| 2020-03-29T07:44:13.136194 | 2018-09-20T00:28:41 | 2018-09-20T00:28:41 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 966 |
swift
|
//
// Map.swift
// Extended
//
// Created by Amir Shayegh on 2018-09-19.
//
import Foundation
import MapKit
import CoreLocation
extension MKMapView {
public func clearPins() {
let pins = self.pins()
self.removeAnnotations(pins)
}
public func pins() -> [MKAnnotation] {
return self.annotations
}
public func dropPin(at location: CLLocation, name: String) {
let myAnnotation: MKPointAnnotation = MKPointAnnotation()
myAnnotation.coordinate = CLLocationCoordinate2DMake(location.coordinate.latitude, location.coordinate.longitude);
myAnnotation.title = name
self.addAnnotation(myAnnotation)
}
// move map center to specified location
public func focusOn(location: CLLocation, radius: Double) {
let coordinateRegion = MKCoordinateRegionMakeWithDistance(location.coordinate,radius * 2.0, radius * 2.0)
self.setRegion(coordinateRegion, animated: true)
}
}
|
[
-1
] |
05389c932c5a94f38aadd22b96a75ed249ef952b
|
738dfd9472ddba26a4975727dc9cb1aa782a28ed
|
/ArApp_byArkit/AppDelegate.swift
|
45add9235a7ec77356cf14c8b23b5fbcdc834173
|
[] |
no_license
|
dmaulikr/AR-TrySizeInRealWorld
|
ac20070b40c5ce51349a2a5ab40d2e94cea12b0f
|
d8dd9b722422a639502467be9e51fe59d5626edb
|
refs/heads/master
| 2021-01-16T17:55:15.365536 | 2017-06-25T02:56:49 | 2017-06-25T02:56:49 | 100,023,512 | 1 | 0 | null | 2017-08-11T11:07:53 | 2017-08-11T11:07:53 | null |
UTF-8
|
Swift
| false | false | 2,173 |
swift
|
//
// AppDelegate.swift
// ArApp_byArkit
//
// Created by 孟高乐 on 6/24/17.
// Copyright © 2017 GaoleMeng. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
}
|
[
229380,
229383,
229385,
278539,
294924,
229388,
278542,
229391,
327695,
229394,
278548,
229397,
229399,
229402,
352284,
229405,
278556,
278559,
229408,
278564,
294950,
229415,
229417,
327722,
237613,
229422,
229426,
237618,
229428,
311349,
286774,
286776,
319544,
286778,
229432,
204856,
286791,
237640,
286797,
278605,
311375,
163920,
237646,
196692,
319573,
311383,
278623,
278626,
319590,
311400,
278635,
303212,
278639,
131192,
278648,
237693,
303230,
327814,
303241,
131209,
417930,
303244,
311436,
319633,
286873,
286876,
311460,
311469,
32944,
327862,
286906,
327866,
180413,
286910,
131264,
286916,
295110,
286922,
286924,
286926,
319694,
286928,
131281,
278743,
278747,
295133,
155872,
319716,
237807,
303345,
286962,
131314,
229622,
327930,
278781,
278783,
278785,
237826,
319751,
278792,
286987,
319757,
311569,
286999,
319770,
287003,
287006,
287009,
287012,
287014,
287016,
287019,
311598,
287023,
262448,
311601,
295220,
287032,
155966,
319809,
319810,
278849,
319814,
311623,
319818,
311628,
229709,
319822,
287054,
278865,
229717,
196963,
196969,
139638,
213367,
106872,
319872,
311683,
319879,
311693,
65943,
319898,
311719,
278952,
139689,
278957,
311728,
278967,
180668,
311741,
278975,
319938,
278980,
98756,
278983,
319945,
278986,
319947,
278990,
278994,
311767,
279003,
279006,
188895,
172512,
287202,
279010,
279015,
172520,
319978,
279020,
172526,
311791,
279023,
172529,
279027,
319989,
172534,
180727,
164343,
279035,
311804,
287230,
279040,
303617,
287234,
279045,
172550,
303623,
172552,
287238,
320007,
279051,
172558,
279055,
303632,
279058,
303637,
279063,
279067,
172572,
279072,
172577,
295459,
172581,
295461,
279082,
311850,
279084,
172591,
172598,
279095,
172607,
172609,
172612,
377413,
172614,
172618,
303690,
33357,
287309,
303696,
279124,
172634,
262752,
172644,
311911,
189034,
295533,
172655,
172656,
352880,
295538,
189039,
172660,
287349,
189040,
189044,
287355,
287360,
295553,
172675,
295557,
287365,
311942,
303751,
352905,
279178,
287371,
311946,
311951,
287377,
172691,
287381,
311957,
221850,
287386,
230045,
172702,
164509,
303773,
172705,
287394,
172707,
303780,
287390,
287398,
205479,
279208,
287400,
172714,
295595,
279212,
189102,
172721,
287409,
66227,
303797,
189114,
287419,
303804,
328381,
287423,
328384,
172737,
279231,
287427,
312005,
312006,
107208,
172748,
287436,
107212,
172751,
287440,
295633,
172755,
303827,
279255,
172760,
287450,
303835,
279258,
189149,
303838,
213724,
312035,
279267,
295654,
279272,
230128,
312048,
312050,
230131,
205564,
303871,
230146,
328453,
295685,
230154,
33548,
312077,
295695,
295701,
230169,
369433,
295707,
328476,
295710,
230175,
295720,
303914,
279340,
205613,
279353,
230202,
312124,
328508,
222018,
295755,
377676,
148302,
287569,
303959,
230237,
279390,
230241,
279394,
303976,
336744,
303985,
328563,
303987,
279413,
303991,
303997,
295806,
295808,
295813,
304005,
320391,
213895,
304007,
304009,
304011,
230284,
304013,
295822,
279438,
213902,
189329,
295825,
304019,
189331,
58262,
304023,
304027,
279452,
410526,
279461,
279462,
304042,
213931,
230327,
304055,
287675,
230334,
304063,
238528,
304065,
213954,
189378,
156612,
295873,
213963,
197580,
312272,
304084,
304090,
320481,
304106,
320490,
312302,
328687,
320496,
304114,
295928,
320505,
312321,
295945,
230413,
295949,
197645,
320528,
140312,
295961,
238620,
197663,
304164,
304170,
304175,
238641,
312374,
238652,
238655,
230465,
238658,
336964,
296004,
205895,
320584,
238666,
296021,
402518,
336987,
230497,
296036,
296040,
361576,
205931,
296044,
279661,
205934,
164973,
312432,
279669,
337018,
189562,
279679,
304258,
279683,
222340,
205968,
296084,
238745,
304285,
238756,
205991,
222377,
165035,
337067,
238766,
165038,
230576,
238770,
304311,
230592,
312518,
279750,
230600,
230607,
148690,
320727,
279769,
304348,
279777,
304354,
296163,
320740,
279781,
304360,
320748,
279788,
279790,
304370,
296189,
320771,
312585,
296202,
296205,
230674,
320786,
230677,
296213,
296215,
320792,
230681,
214294,
304416,
230689,
173350,
312622,
296243,
312630,
222522,
296253,
222525,
296255,
312639,
230718,
296259,
378181,
296262,
230727,
238919,
296264,
320840,
296267,
296271,
222545,
230739,
312663,
222556,
337244,
230752,
312676,
230760,
173418,
148843,
410987,
230763,
230768,
296305,
312692,
230773,
304505,
304506,
279929,
181626,
181631,
148865,
312711,
312712,
296331,
288140,
288144,
230800,
304533,
337306,
288154,
288160,
173472,
288162,
288164,
279975,
304555,
370092,
279983,
173488,
288176,
279985,
312755,
296373,
312759,
279991,
288185,
337335,
222652,
312766,
173507,
296389,
222665,
230860,
312783,
288208,
230865,
288210,
370130,
222676,
288212,
288214,
280021,
239064,
288217,
329177,
280027,
288220,
288218,
239070,
288224,
280034,
288226,
280036,
288229,
280038,
288230,
288232,
370146,
288234,
320998,
288236,
288238,
288240,
288242,
296435,
288244,
288250,
296446,
321022,
402942,
148990,
296450,
206336,
230916,
230919,
214535,
230923,
304651,
304653,
370187,
230940,
222752,
108066,
296486,
296488,
157229,
239152,
230961,
157236,
288320,
288325,
124489,
280140,
280145,
288338,
280149,
288344,
280152,
239194,
280158,
403039,
370272,
181854,
239202,
312938,
280183,
280185,
280188,
280191,
116354,
280194,
280208,
280211,
288408,
280218,
280222,
190118,
198310,
321195,
296622,
321200,
337585,
296626,
296634,
296637,
313027,
280260,
206536,
280264,
206539,
206541,
206543,
313044,
280276,
321239,
280283,
313052,
18140,
288478,
313055,
321252,
313066,
288494,
280302,
280304,
313073,
321266,
288499,
419570,
288502,
280314,
288510,
124671,
67330,
280324,
198405,
288519,
280331,
198416,
280337,
296723,
116503,
321304,
329498,
296731,
321311,
313121,
313123,
304932,
321316,
280363,
141101,
165678,
280375,
321336,
296767,
288576,
345921,
280388,
337732,
304968,
280393,
280402,
173907,
313171,
313176,
42842,
280419,
321381,
296809,
296812,
313201,
1920,
255873,
305028,
280454,
247688,
280464,
124817,
280468,
239510,
280473,
124827,
214940,
247709,
214944,
280487,
313258,
321458,
296883,
124853,
214966,
296890,
10170,
288700,
296894,
190403,
296900,
280515,
337862,
165831,
280521,
231379,
296921,
239586,
313320,
231404,
124913,
165876,
321528,
239612,
313340,
288764,
239617,
313347,
288773,
313358,
305176,
321560,
313371,
354338,
305191,
223273,
313386,
354348,
124978,
215090,
124980,
288824,
288826,
321595,
378941,
313406,
288831,
288836,
67654,
280651,
354382,
288848,
280658,
215123,
354390,
288855,
288859,
280669,
313438,
149599,
280671,
149601,
321634,
149603,
223327,
329830,
280681,
313451,
223341,
280687,
149618,
215154,
313458,
280691,
313464,
329850,
321659,
280702,
288895,
321670,
215175,
141446,
141455,
141459,
280725,
313498,
100520,
288936,
280747,
288940,
288947,
280755,
321717,
280759,
280764,
280769,
280771,
280774,
280776,
313548,
321740,
280783,
280786,
280788,
313557,
280793,
280796,
280798,
338147,
280804,
280807,
157930,
280811,
280817,
125171,
157940,
280819,
182517,
280823,
280825,
280827,
280830,
280831,
280833,
125187,
280835,
125191,
125207,
125209,
321817,
125218,
321842,
223539,
125239,
305464,
280888,
280891,
289087,
108865,
280897,
280900,
305480,
239944,
280906,
239947,
305485,
305489,
379218,
280919,
354653,
313700,
280937,
313705,
190832,
280946,
223606,
313720,
280956,
239997,
280959,
313731,
199051,
240011,
289166,
240017,
297363,
190868,
240021,
297365,
297368,
297372,
141725,
297377,
289186,
297391,
289201,
240052,
289207,
289210,
305594,
281024,
289218,
289221,
289227,
281045,
281047,
215526,
166378,
305647,
281075,
174580,
240124,
281084,
305662,
305664,
240129,
305666,
305668,
223749,
240132,
281095,
223752,
150025,
338440,
330244,
223757,
281102,
223763,
223765,
281113,
322074,
281116,
281121,
182819,
281127,
281135,
150066,
158262,
158266,
289342,
281154,
322115,
158283,
281163,
281179,
338528,
338532,
281190,
199273,
281196,
19053,
158317,
313973,
297594,
281210,
158347,
182926,
133776,
314003,
117398,
314007,
289436,
174754,
330404,
289448,
133801,
174764,
314029,
314033,
240309,
133817,
314045,
314047,
314051,
199364,
297671,
158409,
289493,
363234,
289513,
289522,
289525,
289532,
322303,
289537,
322310,
264969,
322314,
322318,
281361,
281372,
322341,
215850,
281388,
289593,
281401,
289601,
281410,
281413,
281414,
240458,
281420,
240468,
281430,
322393,
297818,
281435,
281438,
281442,
174955,
224110,
207733,
207737,
158596,
183172,
240519,
322440,
314249,
338823,
183184,
142226,
289687,
240535,
297883,
289694,
289696,
289700,
289712,
281529,
289724,
52163,
183260,
281567,
289762,
322534,
297961,
183277,
281581,
322550,
134142,
322563,
314372,
330764,
175134,
322599,
322610,
314421,
281654,
314427,
314433,
207937,
314441,
207949,
322642,
314456,
281691,
314461,
281702,
281704,
314474,
281708,
281711,
289912,
248995,
306341,
306344,
306347,
322734,
306354,
142531,
199877,
289991,
306377,
289997,
249045,
363742,
363745,
298216,
330988,
126190,
216303,
322801,
388350,
257302,
363802,
199976,
199978,
314671,
298292,
298294,
257334,
216376,
380226,
298306,
224584,
224587,
224594,
216404,
306517,
150870,
314714,
224603,
159068,
314718,
265568,
314723,
281960,
150890,
306539,
314732,
314736,
290161,
216436,
306549,
298358,
314743,
306552,
290171,
314747,
306555,
290174,
298365,
224641,
281987,
298372,
314756,
281990,
224647,
265604,
298377,
314763,
142733,
298381,
314768,
224657,
306581,
314773,
314779,
314785,
314793,
282025,
282027,
241068,
241070,
241072,
282034,
241077,
150966,
298424,
306618,
282044,
323015,
306635,
306640,
290263,
290270,
290275,
339431,
282089,
191985,
282098,
290291,
282101,
241142,
191992,
290298,
151036,
290302,
282111,
290305,
175621,
306694,
192008,
323084,
257550,
282127,
290321,
282130,
323090,
290325,
282133,
241175,
290328,
282137,
290332,
241181,
282142,
282144,
290344,
306731,
290349,
290351,
290356,
282186,
224849,
282195,
282199,
282201,
306778,
159324,
159330,
314979,
298598,
323176,
224875,
241260,
323181,
257658,
315016,
282249,
290445,
324757,
282261,
175770,
298651,
282269,
323229,
298655,
323231,
61092,
282277,
306856,
196133,
282295,
282300,
323260,
323266,
282310,
323273,
282319,
306897,
241362,
306904,
282328,
298714,
52959,
216801,
282337,
241380,
216806,
323304,
282345,
12011,
282356,
323318,
282364,
282367,
306945,
241412,
323333,
282376,
216842,
323345,
282388,
323349,
282392,
184090,
315167,
315169,
282402,
315174,
323367,
241448,
315176,
241450,
282410,
306988,
306991,
315184,
323376,
315190,
241464,
159545,
282425,
298811,
118593,
307009,
413506,
307012,
241475,
148946,
315211,
282446,
307027,
315221,
323414,
315223,
241496,
241498,
307035,
307040,
110433,
282465,
241509,
110438,
298860,
110445,
282478,
315249,
110450,
315251,
282481,
315253,
315255,
339838,
315267,
282499,
315269,
241544,
282505,
241546,
241548,
298896,
298898,
282514,
241556,
44948,
298901,
241560,
282520,
241563,
241565,
241567,
241569,
282531,
241574,
282537,
298922,
36779,
241581,
282542,
241583,
323504,
241586,
290739,
241588,
282547,
241590,
241592,
241598,
290751,
241600,
241605,
151495,
241610,
298975,
241632,
298984,
241640,
241643,
298988,
241646,
241649,
241652,
323574,
290807,
299003,
241661,
299006,
282623,
315396,
241669,
315397,
282632,
307211,
282639,
290835,
282645,
241693,
282654,
241701,
102438,
217127,
282669,
323630,
282681,
290877,
282687,
159811,
315463,
315466,
192589,
307278,
192596,
176213,
307287,
307290,
217179,
315482,
192605,
315483,
233567,
299105,
200801,
217188,
299109,
307303,
315495,
356457,
45163,
307307,
315502,
192624,
307314,
323700,
299126,
233591,
299136,
307329,
307338,
233613,
241813,
307352,
299164,
299167,
315552,
184479,
184481,
315557,
184486,
307370,
307372,
184492,
307374,
307376,
299185,
323763,
184503,
299191,
176311,
307385,
307386,
307388,
258235,
307390,
176316,
299200,
184512,
307394,
299204,
307396,
184518,
307399,
323784,
233679,
307409,
307411,
176343,
299225,
233701,
307432,
184572,
282881,
184579,
184586,
282893,
291089,
282906,
291104,
233766,
299304,
295583,
176435,
307508,
315701,
332086,
307510,
307512,
168245,
307515,
307518,
282942,
282947,
323917,
110926,
282957,
233808,
323921,
315733,
323926,
233815,
315739,
323932,
299357,
242018,
242024,
299373,
315757,
250231,
242043,
315771,
299388,
299391,
291202,
299398,
242057,
291212,
299405,
291222,
315801,
291226,
242075,
283033,
194654,
61855,
291231,
283042,
291238,
291241,
127403,
127405,
291247,
299440,
127407,
299444,
127413,
291254,
283062,
127417,
291260,
127421,
283069,
127424,
299457,
127429,
127431,
127434,
315856,
127440,
176592,
315860,
176597,
127447,
283095,
299481,
127449,
176605,
242143,
127455,
127457,
291299,
340454,
127463,
242152,
291305,
127466,
176620,
127469,
127474,
291314,
291317,
127480,
135672,
291323,
233979,
127485,
291330,
127490,
127494,
283142,
127497,
233994,
135689,
127500,
291341,
233998,
127506,
234003,
127509,
234006,
127511,
152087,
283161,
242202,
234010,
135707,
242206,
135710,
242208,
291361,
242220,
291378,
234038,
152118,
234041,
315961,
70213,
242250,
111193,
242275,
299620,
242279,
168562,
184952,
135805,
291456,
135808,
373383,
299655,
135820,
316051,
225941,
316054,
299672,
135834,
373404,
299677,
225948,
135839,
299680,
225954,
299684,
135844,
242343,
209576,
242345,
373421,
299706,
135870,
135873,
135876,
135879,
299720,
299723,
299726,
225998,
226002,
119509,
226005,
226008,
299740,
242396,
201444,
299750,
283368,
234219,
283372,
226037,
283382,
316151,
234231,
234236,
226045,
242431,
234239,
209665,
234242,
299778,
242436,
226053,
234246,
226056,
291593,
234248,
242443,
234252,
242445,
234254,
291601,
234258,
242450,
242452,
234261,
348950,
201496,
234264,
234266,
234269,
283421,
234272,
234274,
152355,
299814,
234278,
283432,
234281,
234284,
234287,
283440,
185138,
242483,
234292,
234296,
234298,
160572,
283452,
234302,
234307,
242499,
234309,
292433,
316233,
234313,
316235,
234316,
283468,
234319,
242511,
234321,
234324,
185173,
201557,
234329,
234333,
308063,
234336,
242530,
349027,
234338,
234341,
234344,
234347,
177004,
234350,
324464,
234353,
152435,
177011,
234356,
234358,
234362,
226171,
291711,
234368,
291714,
234370,
291716,
234373,
201603,
226182,
234375,
308105,
226185,
234379,
324490,
234384,
234388,
234390,
324504,
234393,
209818,
308123,
234396,
324508,
291742,
226200,
234398,
234401,
291747,
291748,
234405,
291750,
234407,
324520,
324518,
324522,
234410,
291756,
226220,
291754,
324527,
291760,
234417,
201650,
324531,
234414,
234422,
226230,
275384,
324536,
234428,
291773,
242623,
324544,
234431,
234434,
324546,
324548,
226245,
234437,
234439,
226239,
234443,
291788,
234446,
275406,
193486,
234449,
316370,
193488,
234452,
234455,
234459,
234461,
234464,
234467,
234470,
168935,
5096,
324585,
234475,
234478,
316400,
234481,
316403,
234484,
234485,
234487,
324599,
234490,
234493,
316416,
234496,
308226,
234501,
275462,
308231,
234504,
234507,
234510,
234515,
300054,
316439,
234520,
234519,
234523,
234526,
234528,
300066,
234532,
300069,
234535,
234537,
234540,
144430,
234543,
234546,
275508,
300085,
234549,
300088,
234553,
234556,
234558,
316479,
234561,
316483,
160835,
234563,
308291,
234568,
234570,
316491,
234572,
300108,
234574,
300115,
234580,
234581,
242777,
234585,
275545,
234590,
234593,
234595,
234597,
300133,
234601,
300139,
234605,
160879,
234607,
275569,
234610,
316530,
300148,
234614,
398455,
144506,
234618,
234620,
275579,
234623,
226433,
234627,
275588,
234629,
242822,
234634,
234636,
177293,
234640,
275602,
234643,
308373,
226453,
234647,
234648,
275606,
234650,
275608,
308379,
300189,
324766,
119967,
234653,
283805,
234657,
324768,
242852,
300197,
234661,
283813,
234664,
275626,
234667,
316596,
308414,
234687,
300223,
300226,
308418,
234692,
300229,
308420,
308422,
226500,
283844,
300234,
283850,
300238,
300241,
316625,
300243,
300245,
316630,
300248,
300253,
300256,
300258,
300260,
234726,
300263,
300265,
300267,
161003,
300270,
300272,
120053,
300278,
275703,
316663,
300284,
275710,
300287,
292097,
300289,
161027,
300292,
300294,
275719,
234760,
177419,
300299,
242957,
300301,
283917,
177424,
275725,
349464,
283939,
259367,
292143,
283951,
300344,
226617,
243003,
283963,
226628,
300357,
283973,
177482,
283983,
316758,
357722,
316766,
292192,
316768,
218464,
292197,
316774,
243046,
218473,
284010,
136562,
324978,
275834,
333178,
275836,
275840,
316803,
316806,
226696,
316811,
226699,
316814,
226703,
300433,
234899,
300436,
226709,
357783,
316824,
316826,
144796,
300448,
144807,
144810,
144812,
284076,
144814,
144820,
374196,
284084,
292279,
284087,
144826,
144828,
144830,
144832,
144835,
144837,
38342,
144839,
144841,
144844,
144847,
144852,
144855,
103899,
300507,
333280,
226787,
218597,
292329,
300523,
259565,
300527,
308720,
259567,
292338,
226802,
227440,
316917,
308727,
292343,
300537,
316933,
316947,
308757,
308762,
284191,
284194,
284196,
235045,
284199,
284204,
284206,
284209,
284211,
194101,
284213,
316983,
194103,
284215,
308790,
284218,
226877,
292414,
284223,
284226,
284228,
292421,
226886,
284231,
128584,
243268,
284234,
276043,
317004,
366155,
284238,
226895,
284241,
194130,
284243,
300628,
284245,
276053,
284247,
317015,
284249,
243290,
284251,
276052,
284253,
300638,
284255,
235097,
243293,
284258,
292452,
292454,
284263,
177766,
284265,
292458,
284267,
292461,
284272,
284274,
284278,
292470,
276086,
292473,
284283,
276093,
284286,
292479,
284288,
292481,
284290,
325250,
284292,
292485,
276095,
276098,
284297,
317066,
284299,
317068,
284301,
276109,
284303,
284306,
276114,
284308,
284312,
284314,
284316,
276127,
284320,
284322,
284327,
284329,
317098,
284331,
276137,
284333,
284335,
276144,
284337,
284339,
300726,
284343,
284346,
284350,
276160,
358080,
284354,
358083,
284358,
276166,
358089,
284362,
276170,
284365,
276175,
284368,
276177,
284370,
358098,
284372,
317138,
284377,
276187,
284379,
284381,
284384,
358114,
284386,
358116,
276197,
317158,
358119,
284392,
325353,
358122,
284394,
284397,
358126,
284399,
358128,
276206,
358133,
358135,
276216,
358138,
300795,
358140,
284413,
358142,
358146,
317187,
284418,
317189,
317191,
284428,
300816,
300819,
317207,
284440,
300828,
300830,
276255,
300832,
325408,
300834,
317221,
227109,
358183,
186151,
276268,
300845,
243504,
300850,
284469,
276280,
325436,
358206,
276291,
366406,
276295,
300872,
292681,
153417,
358224,
284499,
276308,
284502,
317271,
178006,
276315,
292700,
317279,
284511,
227175,
292715,
300912,
292721,
284529,
300915,
284533,
292729,
317306,
284540,
292734,
325512,
169868,
276365,
317332,
358292,
284564,
284566,
350106,
284572,
276386,
284579,
276388,
358312,
317353,
292776,
284585,
276395,
292784,
276402,
358326,
161718,
358330,
276410,
276411,
276418,
276425,
301009,
301011,
301013,
292823,
358360,
301017,
301015,
292828,
276446,
153568,
276448,
276452,
292839,
276455,
292843,
276460,
292845,
276464,
178161,
227314,
276466,
325624,
276472,
317435,
276476,
276479,
276482,
276485,
317446,
276490,
292876,
317456,
276496,
317458,
178195,
243733,
243740,
317468,
317472,
325666,
243751,
292904,
276528,
243762,
309298,
325685,
325689,
235579,
325692,
235581,
178238,
276539,
276544,
284739,
325700,
243779,
292934,
243785,
276553,
350293,
350295,
309337,
194649,
227418,
350299,
350302,
227423,
350304,
178273,
309346,
194657,
194660,
350308,
309350,
309348,
292968,
309352,
227426,
276579,
227430,
276583,
309354,
301167,
276590,
350321,
350313,
350316,
284786,
350325,
252022,
276595,
350328,
292985,
301178,
350332,
292989,
301185,
292993,
350339,
317570,
317573,
350342,
350345,
350349,
301199,
317584,
325777,
350354,
350357,
350359,
350362,
350366,
276638,
284837,
153765,
350375,
350379,
350381,
350383,
129200,
350385,
350387,
350389,
350395,
350397,
350399,
227520,
350402,
227522,
301252,
350406,
227529,
301258,
309450,
276685,
309455,
276689,
309462,
301272,
276699,
194780,
309468,
309471,
301283,
317672,
317674,
325867,
243948,
194801,
227571,
309491,
309494,
243960,
276735,
227583,
227587,
276739,
211204,
276742,
227593,
227596,
325910,
309530,
342298,
211232,
317729,
276775,
211241,
325937,
325943,
211260,
260421,
276809,
285002,
276811,
235853,
276816,
235858,
276829,
276833,
391523,
276836,
293227,
276843,
293232,
276848,
186744,
211324,
227709,
285061,
317833,
178572,
285070,
285077,
178583,
227738,
317853,
276896,
317858,
342434,
285093,
317864,
285098,
276907,
235955,
276917,
293304,
293307,
293314,
309707,
293325,
317910,
293336,
235996,
317917,
293343,
358880,
276961,
227810,
293346,
276964,
293352,
236013,
293364,
301562,
293370,
317951,
309764,
301575,
121352,
293387,
236043,
342541,
317963,
113167,
55822,
309779,
317971,
309781,
277011,
55837,
227877,
227879,
293417,
227882,
309804,
293421,
105007,
236082,
285236,
23094,
277054,
244288,
129603,
301636,
318020,
301639,
301643,
277071,
285265,
399955,
309844,
277080,
309849,
285277,
285282,
326244,
318055,
277100,
121458,
277106,
170618,
170619,
309885,
309888,
277122,
227975,
277128,
285320,
301706,
318092,
326285,
334476,
318094,
277136,
277139,
227992,
334488,
318108,
285340,
318110,
227998,
137889,
383658,
285357,
318128,
277170,
293555,
342707,
154292,
277173,
318132,
277177,
277181,
318144,
277187,
277191,
277194,
277196,
277201,
137946,
113378,
203491,
228069,
277223,
342760,
285417,
56041,
56043,
277232,
228081,
56059,
310015,
285441,
310020,
285448,
310029,
228113,
285459,
277273,
293659,
326430,
228128,
285474,
293666,
228135,
318248,
277291,
318253,
293677,
285489,
301876,
293685,
285494,
301880,
285499,
301884,
293696,
310080,
277317,
277322,
277329,
162643,
310100,
301911,
301913,
277337,
301921,
400236,
236397,
162671,
326514,
310134,
236408,
15224,
277368,
416639,
416640,
113538,
310147,
416648,
39817,
187274,
277385,
301972,
424853,
277405,
277411,
310179,
293798,
293802,
236460,
277426,
293811,
293817,
293820,
203715,
326603,
276586,
293849,
293861,
228327,
228328,
318442,
228330,
228332,
326638,
277486,
318450,
293876,
293877,
285686,
302073,
121850,
293882,
302075,
244731,
285690,
293887,
277504,
277507,
277511,
293899,
277519,
293908,
302105,
293917,
293939,
318516,
277561,
277564,
310336,
7232,
293956,
277573,
228422,
293960,
310344,
277577,
277583,
203857,
293971,
310355,
310359,
236632,
277594,
138332,
277598,
203872,
277601,
285792,
310374,
203879,
310376,
228460,
318573,
203886,
187509,
285815,
367737,
285817,
302205,
285821,
392326,
285831,
253064,
294026,
302218,
285835,
162964,
384148,
187542,
302231,
285849,
302233,
285852,
302237,
285854,
285856,
302241,
285862,
277671,
302248,
64682,
277678,
294063,
294065,
302258,
277687,
294072,
318651,
294076,
277695,
318657,
244930,
302275,
130244,
302277,
228550,
302282,
310476,
302285,
302288,
310481,
302290,
203987,
302292,
302294,
310486,
302296,
384222,
310498,
285927,
318698,
302315,
195822,
228592,
294132,
138485,
228601,
204026,
228606,
204031,
64768,
310531,
285958,
138505,
228617,
318742,
204067,
277798,
130345,
277801,
113964,
285997,
277804,
285999,
277807,
113969,
277811,
318773,
318776,
277816,
286010,
277819,
294204,
417086,
277822,
286016,
302403,
294211,
384328,
277832,
277836,
294221,
294223,
326991,
277839,
277842,
277847,
277850,
179547,
277853,
146784,
277857,
302436,
277860,
294246,
327015,
310632,
327017,
351594,
277864,
277869,
277872,
351607,
310648,
277880,
310651,
277884,
277888,
310657,
351619,
294276,
310659,
327046,
277892,
253320,
310665,
318858,
277894,
277898,
277903,
310672,
351633,
277905,
277908,
277917,
310689,
277921,
130468,
228776,
277928,
277932,
310703,
277937,
310710,
130486,
310712,
277944,
310715,
277947,
302526,
228799,
277950,
277953,
302534,
310727,
64966,
245191,
163272,
277959,
277963,
302541,
277966,
302543,
310737,
277971,
228825,
163290,
277978,
310749,
277981,
277984,
310755,
277989,
277991,
187880,
277995,
310764,
286188,
278000,
228851,
310772,
278003,
278006,
40440,
212472,
278009,
40443,
286203,
40448,
228864,
286214,
228871,
302603,
65038,
302614,
286233,
302617,
302621,
286240,
146977,
187939,
40484,
294435,
40486,
286246,
294440,
40488,
294439,
294443,
40491,
294445,
278057,
310831,
245288,
286248,
40499,
40502,
212538,
40507,
40511,
40513,
228933,
327240,
40521,
286283,
40525,
40527,
212560,
400976,
228944,
40533,
147032,
40537,
40539,
40541,
278109,
40544,
40548,
40550,
40552,
286313,
40554,
286312,
310892,
40557,
40560,
188022,
122488,
294521,
343679,
294537,
310925,
286354,
278163,
302740,
122517,
278168,
179870,
327333,
229030,
212648,
278188,
302764,
278192,
319153,
278196,
302781,
319171,
302789,
294599,
278216,
294601,
302793,
343757,
212690,
319187,
278227,
286420,
229076,
286425,
319194,
278235,
301163,
278238,
229086,
286432,
294625,
294634,
302838,
319226,
286460,
278274,
302852,
278277,
302854,
294664,
311048,
352008,
319243,
311053,
302862,
319251,
294682,
278306,
188199,
294701,
278320,
319280,
319290,
229192,
302925,
188247,
188252,
237409,
229233,
294776,
360317,
294785,
327554,
40840,
40851,
294803,
188312,
294811,
237470,
319390,
40865,
319394,
294817,
294821,
311209,
180142,
343983,
294831,
188340,
40886,
319419,
294844,
294847,
393177,
294876,
294879,
294883,
294890,
311279,
278513,
237555,
278516,
311283,
278519,
237562
] |
70076b09bc34fe30271e51a1ca6db84cb9d6c594
|
4883a2a91fcd950c639a8f36d01a2d25c2633de7
|
/VerificationProjectUITests/VerificationProjectUITests.swift
|
bf01236d79e2e8f1603157c3e61b998509c775ff
|
[] |
no_license
|
MahmoudElsayed92/ValidationProject3
|
e1023219907488eeae4e24d40bce44875e039e71
|
25a310ae5424e8ed2efc93d52555bc46f017c4ed
|
refs/heads/master
| 2023-01-18T22:40:06.105432 | 2020-12-02T19:35:59 | 2020-12-02T19:35:59 | 317,974,006 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,444 |
swift
|
//
// VerificationProjectUITests.swift
// VerificationProjectUITests
//
// Created by nour on 29/11/2020.
//
import XCTest
class VerificationProjectUITests: XCTestCase {
override func setUpWithError() throws {
// Put setup code here. This method is called before the invocation of each test method in the class.
// In UI tests it is usually best to stop immediately when a failure occurs.
continueAfterFailure = false
// In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
}
override func tearDownWithError() throws {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}
func testExample() throws {
// UI tests must launch the application that they test.
let app = XCUIApplication()
app.launch()
// Use recording to get started writing UI tests.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
func testLaunchPerformance() throws {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, *) {
// This measures how long it takes to launch your application.
measure(metrics: [XCTApplicationLaunchMetric()]) {
XCUIApplication().launch()
}
}
}
}
|
[
360463,
155665,
376853,
344106,
253996,
385078,
163894,
180279,
319543,
352314,
213051,
376892,
32829,
286787,
352324,
237638,
352327,
385095,
393291,
163916,
368717,
311373,
196687,
278607,
311377,
254039,
426074,
368732,
180317,
32871,
352359,
221292,
278637,
385135,
319599,
376945,
131190,
385147,
131199,
426124,
196758,
49308,
65698,
311459,
49317,
377008,
377010,
180409,
295099,
377025,
377033,
164043,
417996,
254157,
368849,
368850,
139478,
229591,
385240,
254171,
147679,
147680,
311520,
205034,
254189,
286957,
254193,
344312,
336121,
262403,
147716,
385291,
368908,
180494,
262419,
368915,
254228,
319764,
278805,
377116,
254250,
311596,
131374,
418095,
336177,
368949,
180534,
155968,
287040,
311622,
270663,
319816,
368969,
254285,
180559,
377168,
344402,
229716,
368982,
270703,
139641,
385407,
385409,
270733,
106893,
385423,
385433,
213402,
385437,
254373,
156069,
385448,
385449,
311723,
115116,
385463,
319931,
278974,
336319,
336323,
188870,
278988,
278992,
262619,
377309,
377310,
369121,
369124,
279014,
270823,
279017,
311787,
213486,
360945,
139766,
393719,
279030,
377337,
279033,
254459,
410108,
410109,
262657,
377346,
279042,
279053,
410126,
262673,
385554,
393745,
303635,
279060,
279061,
254487,
410138,
279066,
188957,
377374,
385569,
385578,
377388,
197166,
393775,
418352,
33339,
352831,
33344,
385603,
377419,
385612,
303693,
426575,
385620,
369236,
115287,
189016,
270938,
287327,
279143,
279150,
287345,
352885,
352886,
344697,
189054,
287359,
385669,
369285,
311944,
344714,
311950,
377487,
311953,
287379,
336531,
180886,
426646,
352921,
377499,
221853,
344737,
295591,
352938,
295598,
418479,
279215,
279218,
164532,
336565,
287418,
377531,
303802,
377534,
377536,
66243,
385737,
287434,
385745,
279249,
303826,
369365,
369366,
385751,
230105,
361178,
352989,
352990,
418529,
385763,
295653,
369383,
230120,
361194,
312046,
418550,
344829,
279293,
205566,
197377,
434956,
312076,
295698,
418579,
426772,
197398,
221980,
344864,
197412,
336678,
262952,
189229,
262957,
164655,
197424,
328495,
197428,
336693,
230198,
377656,
426809,
197433,
222017,
295745,
377669,
197451,
369488,
279379,
385878,
385880,
295769,
197467,
435038,
230238,
279393,
303973,
279398,
385895,
385901,
197489,
295799,
164730,
336765,
254851,
369541,
172936,
320394,
426894,
189327,
377754,
172971,
140203,
377778,
304050,
189362,
189365,
377789,
189373,
345030,
345034,
279499,
418774,
386007,
386009,
418781,
386016,
123880,
418793,
320495,
222193,
435185,
271351,
214009,
312313,
435195,
328701,
312317,
386049,
328705,
418819,
410629,
377863,
189448,
230411,
320526,
361487,
435216,
386068,
254997,
336928,
336930,
410665,
345137,
361522,
312372,
238646,
238650,
320571,
410687,
336962,
238663,
377927,
361547,
205911,
156763,
361570,
214116,
230500,
214119,
402538,
279659,
173168,
230514,
238706,
279666,
312435,
377974,
66684,
377986,
279686,
402568,
222344,
140426,
337037,
386191,
410772,
222364,
124073,
402618,
148674,
402632,
148687,
402641,
189651,
419028,
279766,
189656,
304353,
279780,
222441,
279789,
386288,
66802,
271607,
369912,
386296,
369913,
419066,
386300,
279803,
386304,
320769,
369929,
419097,
320795,
115997,
222496,
320802,
304422,
369964,
353581,
116014,
66863,
312628,
345397,
345398,
386363,
222523,
345418,
353611,
337228,
337226,
353612,
230730,
296269,
353617,
222542,
238928,
296274,
378201,
230757,
296304,
312688,
337280,
353672,
263561,
296328,
296330,
304523,
370066,
9618,
411028,
279955,
370072,
148899,
148900,
361928,
337359,
329168,
312785,
329170,
222674,
353751,
280025,
239069,
329181,
320997,
361958,
271850,
280042,
280043,
271853,
329198,
411119,
337391,
116209,
296434,
386551,
288252,
312830,
271880,
198155,
329231,
304655,
370200,
222754,
157219,
157220,
312879,
288305,
288319,
288322,
280131,
288328,
353875,
99937,
345697,
312937,
271980,
206447,
403057,
42616,
337533,
280193,
370307,
419462,
149127,
149128,
419464,
288391,
411275,
214667,
239251,
345753,
198304,
255651,
337590,
370359,
280252,
280253,
321217,
239305,
296649,
403149,
313042,
345813,
370390,
272087,
345817,
337638,
181992,
345832,
345835,
288492,
141037,
313082,
288508,
288515,
173828,
395018,
395019,
116491,
395026,
124691,
116502,
435993,
345882,
411417,
321308,
255781,
362281,
378666,
403248,
378673,
345910,
182070,
182071,
345918,
337734,
280396,
272207,
272208,
337746,
395092,
362326,
345942,
370526,
345950,
362336,
255844,
296807,
214894,
362351,
313200,
214896,
313204,
124795,
182145,
280451,
67464,
305032,
337816,
124826,
329627,
239515,
354210,
10153,
313257,
362411,
370604,
362418,
411587,
280517,
362442,
346066,
231382,
354268,
436189,
403421,
329696,
354273,
403425,
190437,
354279,
436199,
174058,
337899,
354283,
247787,
329707,
296942,
247786,
436209,
313322,
124912,
239610,
182277,
346117,
403463,
43016,
354312,
354311,
354310,
313356,
419857,
305173,
436248,
223269,
346153,
354346,
313388,
124974,
272432,
403507,
378933,
378934,
436283,
288835,
403524,
436293,
313415,
239689,
436304,
329812,
223317,
411738,
272477,
280676,
313446,
395373,
288878,
346237,
215165,
329884,
378186,
362658,
436388,
215204,
125108,
133313,
338118,
346319,
321744,
379102,
387299,
18661,
379110,
338151,
125166,
149743,
379120,
436466,
125170,
411892,
436471,
395511,
313595,
436480,
125184,
272644,
125192,
338187,
338188,
125197,
395536,
125200,
338196,
272661,
379157,
125204,
125215,
125216,
338217,
125225,
321839,
125236,
362809,
379193,
395591,
289109,
272730,
436570,
215395,
239973,
280938,
321901,
354671,
362864,
354672,
272755,
354678,
199030,
223611,
248188,
313726,
436609,
240003,
436613,
395653,
395660,
264591,
272784,
240020,
190870,
43416,
190872,
289185,
436644,
289195,
272815,
436659,
338359,
436677,
289229,
281038,
281039,
256476,
420326,
166403,
322057,
420374,
322077,
289328,
330291,
322119,
191065,
436831,
420461,
313970,
346739,
346741,
420473,
297600,
166533,
363155,
346771,
264855,
363161,
289435,
436897,
248494,
166581,
355006,
363212,
363228,
436957,
322269,
436960,
264929,
338658,
289511,
330473,
346859,
330476,
289517,
215790,
199415,
289534,
322302,
35584,
133889,
322312,
346889,
264971,
322320,
166677,
207639,
363295,
355117,
191285,
273209,
355129,
273211,
355136,
355138,
420680,
355147,
355148,
355153,
281426,
387927,
363353,
363354,
281434,
322396,
420702,
363361,
363362,
412516,
355173,
355174,
281444,
207724,
355182,
207728,
420722,
314240,
158594,
330627,
240517,
265094,
387977,
396171,
355216,
224146,
224149,
256918,
256919,
256920,
240543,
256934,
273336,
289720,
289723,
273341,
330688,
379845,
363462,
19398,
273353,
191445,
207839,
347104,
314343,
134124,
412653,
248815,
257007,
347122,
437245,
257023,
125953,
396292,
330759,
347150,
330766,
412692,
330789,
248871,
281647,
412725,
257093,
404550,
314437,
207954,
339031,
404582,
257126,
265318,
322664,
265323,
396395,
404589,
273523,
363643,
248960,
150656,
363658,
404622,
224400,
265366,
347286,
429209,
339101,
429216,
339106,
380069,
265381,
3243,
208044,
322733,
339131,
265410,
183492,
273616,
421081,
339167,
298209,
421102,
363769,
52473,
208123,
52476,
412926,
437504,
322826,
388369,
380178,
429332,
126229,
412963,
257323,
437550,
273713,
298290,
208179,
159033,
347451,
216387,
372039,
257353,
257354,
109899,
437585,
331091,
150868,
314708,
372064,
429410,
437602,
281958,
388458,
306541,
314734,
314740,
314742,
421240,
314745,
224637,
388488,
298378,
306580,
282008,
396697,
314776,
282013,
290206,
396709,
298406,
241067,
380331,
314797,
380335,
355761,
421302,
134586,
380348,
216510,
380350,
216511,
306630,
200136,
273865,
306634,
339403,
372172,
413138,
421338,
437726,
429540,
3557,
3559,
191980,
282097,
191991,
265720,
216575,
290304,
372226,
437766,
323083,
208397,
323088,
413202,
413206,
388630,
175640,
216610,
372261,
347693,
323120,
396850,
200245,
323126,
290359,
134715,
323132,
421437,
396865,
282182,
413255,
273992,
265800,
421452,
265809,
396885,
290391,
265816,
396889,
306777,
388699,
396896,
323171,
388712,
388713,
314997,
290425,
339579,
396927,
282248,
224907,
396942,
405140,
274071,
323226,
208547,
208548,
405157,
388775,
282279,
364202,
421556,
224951,
224952,
306875,
282302,
323262,
323265,
241360,
241366,
224985,
282330,
159462,
372458,
397040,
12017,
323315,
274170,
200444,
175874,
249606,
323335,
282379,
216844,
372497,
397076,
421657,
339746,
216868,
257831,
167720,
241447,
421680,
282418,
274234,
241471,
339782,
315209,
159563,
241494,
339799,
307038,
274276,
282471,
274288,
372592,
274296,
339840,
315265,
372625,
282517,
298912,
118693,
438186,
126896,
151492,
380874,
372699,
323554,
380910,
380922,
380923,
274432,
372736,
241695,
315431,
430120,
102441,
315433,
430127,
405552,
282671,
241717,
249912,
225347,
307269,
421958,
233548,
176209,
381013,
53334,
315477,
200795,
356446,
323678,
438374,
176231,
438378,
233578,
217194,
422000,
249976,
266361,
422020,
168069,
381061,
168070,
381071,
241809,
323730,
430231,
200856,
422044,
192670,
192671,
299166,
258213,
299176,
323761,
184498,
266427,
356550,
299208,
372943,
266447,
258263,
356575,
307431,
438512,
372979,
389364,
381173,
135416,
356603,
184574,
266504,
217352,
61720,
381210,
315674,
282908,
389406,
282912,
233761,
438575,
315698,
266547,
397620,
332084,
438583,
127292,
332100,
323914,
201037,
397650,
348499,
250196,
348501,
389465,
332128,
110955,
242027,
242028,
160111,
250227,
315768,
291193,
438653,
291200,
266628,
340356,
242059,
225684,
373141,
373144,
291225,
397732,
176602,
242138,
184799,
291297,
201195,
324098,
233987,
340489,
397841,
283154,
258584,
397855,
291359,
348709,
348710,
283185,
234037,
340539,
266812,
438850,
348741,
381515,
348748,
430681,
332379,
242274,
184938,
373357,
184942,
176751,
389744,
356983,
356984,
209529,
356990,
291455,
373377,
422529,
201348,
152196,
356998,
348807,
356999,
316044,
316050,
275102,
176805,
340645,
422567,
176810,
160441,
422591,
291529,
225996,
135888,
242385,
234216,
373485,
373486,
21239,
275193,
348921,
234233,
242428,
299777,
430853,
430860,
430880,
234276,
234290,
152372,
160569,
430909,
160576,
348999,
283466,
234330,
275294,
381791,
127840,
357219,
439145,
177002,
308075,
242540,
242542,
381811,
201590,
177018,
398205,
340865,
291713,
349066,
316299,
349068,
234382,
308111,
381840,
308113,
390034,
373653,
430999,
209820,
381856,
398244,
185252,
422825,
381872,
177074,
398268,
349122,
398275,
373705,
127945,
340960,
398305,
340967,
398313,
234476,
127990,
349176,
201721,
349179,
234499,
357380,
398370,
357413,
357420,
300087,
21567,
308288,
398405,
349254,
218187,
250955,
300109,
234578,
250965,
439391,
250982,
398444,
62574,
357487,
300147,
119925,
349304,
234626,
349315,
349317,
234635,
373902,
177297,
324761,
234655,
234662,
373937,
373939,
324790,
300215,
218301,
283841,
283846,
259275,
316628,
259285,
357594,
414956,
251124,
316661,
292092,
439550,
439563,
242955,
414989,
259346,
349458,
259347,
382243,
382246,
382257,
292145,
382264,
333115,
193853,
193858,
251212,
406862,
234830,
259408,
283990,
357720,
300378,
300379,
316764,
374110,
234864,
259449,
382329,
357758,
243073,
357763,
112019,
398740,
234902,
333224,
374189,
251314,
284086,
259513,
54719,
292291,
300490,
300526,
259569,
251379,
300539,
398844,
210429,
366081,
316951,
374297,
153115,
431646,
349727,
431662,
374327,
210489,
235069,
349764,
292424,
292426,
128589,
333389,
333394,
349780,
128600,
235096,
300643,
300645,
415334,
54895,
366198,
210558,
210559,
415360,
325246,
333438,
415369,
431754,
210569,
267916,
415376,
259741,
153252,
399014,
210601,
202413,
317102,
415419,
259780,
333508,
267978,
333522,
325345,
333543,
325357,
431861,
284410,
161539,
284425,
300812,
284430,
366358,
169751,
431901,
341791,
325411,
186148,
186149,
333609,
284460,
202541,
431918,
399148,
153392,
431935,
415555,
325444,
153416,
325449,
341837,
415566,
431955,
325460,
317268,
341846,
300893,
259937,
382820,
276326,
415592,
292713,
292719,
325491,
341878,
276343,
350072,
333687,
317305,
112510,
325508,
333700,
243590,
325514,
350091,
350092,
350102,
350108,
333727,
219046,
284584,
292783,
300983,
128955,
219102,
292835,
6116,
317416,
432114,
325620,
415740,
268286,
415744,
333827,
243720,
399372,
153618,
358418,
178215,
325675,
243763,
358455,
325695,
399433,
333902,
104534,
194667,
260206,
284789,
374913,
374914,
415883,
333968,
153752,
333990,
104633,
260285,
227517,
268479,
374984,
301270,
301271,
334049,
325857,
268515,
383208,
317676,
260337,
260338,
432373,
375040,
309504,
432387,
260355,
375052,
194832,
325904,
391448,
334104,
268570,
178459,
186660,
268581,
334121,
358698,
317738,
260396,
325930,
432435,
358707,
178485,
358710,
14654,
268609,
227655,
383309,
383327,
391521,
366948,
416101,
416103,
383338,
432503,
432511,
211327,
227721,
285074,
252309,
39323,
285083,
317851,
285089,
375211,
334259,
129461,
342454,
358844,
293309,
317889,
326083,
416201,
129484,
154061,
416206,
326093,
432608,
285152,
195044,
391654,
334315,
375281,
293368,
317949,
334345,
309770,
342537,
342549,
342560,
416288,
350758,
350759,
358951,
358952,
293420,
219694,
219695,
375345,
432694,
244279,
309831,
375369,
375373,
416334,
301647,
416340,
244311,
416353,
260705,
375396,
268901,
244326,
244345,
334473,
375438,
326288,
285348,
293552,
342705,
285362,
383668,
342714,
39616,
383708,
342757,
432883,
203511,
342775,
383740,
416509,
359166,
162559,
375552,
432894,
228099,
285443,
285450,
383755,
326413,
285467,
326428,
318247,
342827,
391980,
318251,
375610,
301883,
342846,
416577,
416591,
244569,
375644,
252766,
293729,
351078,
342888,
392057,
211835,
269179,
392065,
260995,
400262,
392071,
424842,
236427,
252812,
400271,
392080,
400282,
7070,
211871,
359332,
359333,
293801,
326571,
252848,
326580,
261046,
326586,
359365,
211913,
326602,
342990,
252878,
433104,
56270,
359380,
433112,
433116,
359391,
187372,
343020,
383980,
203758,
383994,
171009,
384004,
433166,
384015,
433173,
293911,
326684,
252959,
384031,
375848,
318515,
203829,
261191,
375902,
375903,
392288,
253028,
351343,
187505,
138354,
187508,
384120,
302202,
285819,
392317,
343166,
384127,
392320,
285823,
285833,
285834,
318602,
228492,
253074,
326803,
187539,
359574,
285850,
351389,
302239,
253098,
302251,
367791,
367792,
367798,
64699,
294075,
228541,
343230,
367809,
253124,
113863,
351445,
310496,
195809,
253168,
351475,
351489,
367897,
367898,
245018,
130342,
130344,
130347,
261426,
212282,
294210,
359747,
359748,
146760,
146763,
114022,
253288,
425327,
425331,
163190,
327030,
384379,
253316,
294278,
384391,
318860,
253339,
253340,
318876,
343457,
245160,
359860,
359861,
343480,
310714,
228796,
228804,
425417,
310731,
327122,
425434,
310747,
310758,
253431,
359931,
187900,
343552,
245249,
228868,
409095,
359949,
294413,
253456,
302613,
253462,
146976,
245290,
245291,
343606,
163385,
425534,
138817,
147011,
147020,
179800,
196184,
343646,
212574,
204386,
155238,
204394,
138862,
310896,
188021,
294517,
286351,
188049,
425624,
229021,
245413,
286387,
384693,
376502,
286392,
302778,
409277,
286400,
319176,
409289,
425682,
286419,
294621,
245471,
155360,
294629,
212721,
163575,
286457,
286463,
319232,
360194,
409355,
155408,
417556,
294699,
204600,
319289,
384826,
409404,
360253,
409416,
376661,
237397,
368471,
425820,
368486,
384871,
409446,
368489,
40809,
425832,
417648,
417658,
360315,
253828,
327556,
311183,
425875,
294806,
294808,
253851,
376733,
204702,
319393,
294820,
253868,
204722,
188349,
98240,
212947,
212953,
360416,
294887,
253930,
327666,
385011
] |
b716fcf7cb2ccfc3be112cabcf216ca47b1f326b
|
bc17b85683d64ad7ed53541cd8796965757bd9c9
|
/ThreeSixtyVUZ/Constants.swift
|
53a517a46aa1a3287c96286c167467758eab1474
|
[] |
no_license
|
thejeraldo/ThreeSixtyVUZ
|
7106301ba537a3b25255c6c26e01319f7c099376
|
d6d6989d2258c331d0e2c8cee7a18ade870634ef
|
refs/heads/master
| 2021-04-28T07:59:56.424050 | 2018-03-11T13:13:20 | 2018-03-11T13:13:20 | 122,238,676 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 378 |
swift
|
//
// Constants.swift
// ThreeSixtyVUZ
//
// Created by Jerald Abille on 2/20/18.
// Copyright © 2018 Jeraldo Abille. All rights reserved.
//
import Foundation
struct Constants {
static let userId = "194306"
}
enum Color {
static let primaryDark = "PrimaryDark"
static let primaryLight = "PrimaryLight"
}
enum Font {
static let monofonto = "Monofonto-Regular"
}
|
[
-1
] |
be3512f1fac84684691e0e9d6ec0e3c038e05478
|
c2f805c43bc53f32f461094f23641168b5636213
|
/ios tableview navbar controlTests/ios_tableview_navbar_controlTests.swift
|
edbfbf1e30c36da6ce4e1a1370b777166e6b6ad9
|
[
"MIT"
] |
permissive
|
Harrison1/ios-tableview-navbar-control
|
253c4d0c43cd78482bd01220346928dc6a4106e8
|
e866ab478676089118f3b72acadb661ca6e46625
|
refs/heads/master
| 2021-01-19T02:44:18.204174 | 2016-07-13T04:05:09 | 2016-07-13T04:05:09 | 62,600,729 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,064 |
swift
|
//
// ios_tableview_navbar_controlTests.swift
// ios tableview navbar controlTests
//
// Created by Harrison McGuire on 7/5/16.
// Copyright © 2016 severallevels. All rights reserved.
//
import XCTest
@testable import ios_tableview_navbar_control
class ios_tableview_navbar_controlTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
func testExample() {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
func testPerformanceExample() {
// This is an example of a performance test case.
self.measureBlock {
// Put the code you want to measure the time of here.
}
}
}
|
[
333828,
282633,
313357,
182296,
317467,
241692,
98333,
16419,
102437,
229413,
354343,
292902,
204840,
227370,
278570,
354345,
223274,
344107,
233517,
124975,
253999,
346162,
229424,
229430,
319542,
124984,
358456,
288828,
288833,
288834,
352326,
254027,
311372,
354385,
196691,
315476,
280661,
329814,
278615,
338007,
307289,
200794,
354393,
180311,
180312,
237663,
309345,
280675,
307299,
280677,
329829,
313447,
131178,
278634,
315498,
278638,
319598,
288879,
352368,
299121,
284788,
233589,
280694,
333940,
237689,
288889,
215164,
313469,
215166,
278655,
292992,
333955,
280712,
215178,
278670,
241808,
323729,
325776,
317587,
278677,
284826,
278685,
346271,
311458,
278691,
49316,
233636,
333991,
333992,
284841,
284842,
32941,
278704,
239793,
323762,
299187,
278708,
125109,
131256,
227513,
278714,
280762,
182456,
184505,
299198,
379071,
299203,
227524,
301251,
309444,
338119,
282831,
321745,
254170,
280795,
227548,
356576,
317664,
338150,
176362,
321772,
286958,
125169,
338164,
327929,
184570,
243962,
125183,
309503,
125188,
313608,
125193,
375051,
180493,
125198,
325905,
254226,
125203,
319763,
125208,
325912,
309529,
299293,
278816,
125217,
233762,
211235,
217380,
305440,
227616,
282919,
151847,
211238,
98610,
125235,
332085,
280887,
125240,
332089,
278842,
282939,
315706,
287041,
241986,
260418,
332101,
227654,
182598,
323916,
319821,
254286,
348492,
250192,
6481,
323920,
344401,
348500,
278869,
366929,
155990,
366930,
6489,
272729,
379225,
289110,
106847,
323935,
391520,
321894,
280939,
242029,
246127,
354676,
139640,
246136,
246137,
291192,
362881,
248194,
225670,
395659,
227725,
395661,
240016,
178582,
291224,
293274,
285084,
317852,
283038,
61857,
285090,
61859,
246178,
289189,
375207,
289194,
108972,
340398,
377264,
61873,
283064,
61880,
278970,
319930,
336317,
293310,
278978,
283075,
127427,
127428,
291267,
188871,
324039,
317901,
373197,
281040,
278993,
326100,
278999,
328152,
176601,
242139,
369116,
285150,
287198,
279008,
342498,
242148,
195045,
279013,
279018,
281072,
279029,
279032,
233978,
279039,
342536,
287241,
279050,
340490,
279057,
283153,
279062,
289304,
279065,
342553,
291358,
182817,
375333,
377386,
283182,
283184,
23092,
234036,
279094,
315960,
338490,
352829,
301638,
348742,
322120,
55881,
348749,
281166,
281171,
244310,
354911,
436832,
295519,
66150,
279144,
111208,
279146,
344680,
191082,
313966,
281199,
287346,
279164,
189057,
311941,
348806,
279177,
369289,
152203,
330379,
344715,
184973,
311949,
330387,
330388,
352917,
227990,
117397,
295576,
230040,
271000,
342682,
221852,
279206,
295590,
287404,
205487,
295599,
279217,
285361,
342706,
303793,
299699,
299700,
164533,
338613,
314040,
287417,
158394,
342713,
285373,
287422,
66242,
363211,
242386,
279252,
287452,
318173,
289502,
363230,
295652,
279269,
338662,
285415,
346858,
330474,
289518,
279280,
199414,
230134,
154359,
221948,
279294,
35583,
205568,
162561,
299776,
363263,
285444,
242433,
291585,
322319,
295697,
285458,
166676,
207640,
285466,
283419,
326429,
336671,
326433,
344865,
234277,
279336,
318250,
295724,
152365,
312108,
318252,
353069,
285487,
328499,
242485,
234294,
353078,
230199,
353079,
285497,
336702,
420677,
353094,
353095,
299849,
283467,
293711,
281427,
353109,
281433,
230234,
234331,
301918,
279392,
242529,
293730,
303972,
351077,
275303,
342887,
230248,
201577,
242541,
246641,
330609,
228215,
246648,
209785,
269178,
177019,
279417,
361337,
209783,
291712,
254850,
359298,
240518,
287622,
228233,
228234,
308107,
56208,
295824,
234386,
308112,
293781,
209817,
324506,
277403,
324507,
318364,
289698,
189348,
324517,
289703,
279464,
353195,
140204,
353197,
189374,
353216,
349121,
363458,
213960,
279498,
316364,
338899,
340955,
248797,
207838,
50143,
130016,
340961,
64485,
314342,
234472,
123881,
324586,
52200,
203757,
289774,
304110,
320494,
340974,
277492,
316405,
240630,
295927,
201720,
304122,
314362,
320507,
328700,
293886,
328706,
234500,
277509,
320516,
230410,
330763,
320527,
146448,
324625,
277524,
316437,
418837,
320536,
197657,
281626,
201755,
336929,
189474,
300068,
357414,
248872,
345132,
238639,
252980,
300084,
322612,
359478,
324666,
238651,
302139,
21569,
359495,
238664,
300111,
314448,
234577,
341073,
353367,
234587,
156764,
156765,
314467,
281700,
250981,
322663,
300136,
316520,
228458,
207979,
300135,
316526,
357486,
144496,
187506,
353397,
291959,
160891,
285820,
341115,
363644,
187521,
150657,
248961,
285828,
279685,
285830,
349316,
349318,
222343,
330888,
228491,
228493,
285838,
169104,
162961,
177296,
308372,
185493,
326804,
296086,
119962,
300187,
296092,
300188,
339102,
302240,
330913,
343203,
234663,
300201,
300202,
281771,
253099,
238765,
279728,
367799,
339130,
208058,
64700,
322749,
228542,
283840,
343234,
279747,
367810,
259268,
283847,
353479,
62665,
353481,
353482,
244940,
283852,
283853,
279760,
290000,
228563,
316627,
279765,
296153,
357595,
279774,
298212,
304356,
290022,
330984,
228588,
234733,
253167,
279792,
353523,
298228,
228600,
216315,
208124,
316669,
363771,
388349,
228609,
234755,
279814,
322824,
242954,
292107,
312587,
328971,
251153,
245019,
320796,
126237,
130338,
130343,
279854,
351537,
298291,
345396,
300343,
116026,
222524,
333117,
286018,
279875,
193859,
230729,
224586,
372043,
177484,
251213,
238927,
296273,
120148,
318805,
283991,
222559,
314720,
234850,
292195,
230756,
294243,
333160,
134506,
230765,
284014,
296303,
243056,
279920,
312689,
314739,
116084,
327025,
327024,
327031,
306559,
179587,
378244,
298374,
314758,
314760,
388487,
142729,
368011,
314766,
296335,
112017,
112018,
234898,
306579,
9619,
282007,
357786,
318875,
290207,
314783,
333220,
314789,
279974,
282024,
241066,
316842,
286129,
173491,
279989,
210358,
284089,
228795,
292283,
302529,
302531,
163268,
380357,
415171,
300487,
296392,
361927,
300489,
370123,
148940,
280013,
310732,
64975,
312782,
327121,
222675,
366037,
210390,
210391,
353750,
210393,
212442,
228827,
286172,
329173,
280032,
310757,
187878,
316902,
280041,
361963,
54765,
191981,
321009,
251378,
333300,
343542,
280055,
300536,
288249,
343543,
191990,
333303,
286205,
290301,
286202,
210433,
282114,
228867,
366083,
323080,
230921,
329225,
253452,
323087,
304656,
329232,
316946,
146964,
398869,
308756,
282136,
308764,
349726,
333343,
230943,
282146,
306723,
286244,
245287,
245292,
349741,
286254,
169518,
230959,
288309,
290358,
235070,
288318,
280130,
349763,
124485,
56902,
288326,
288327,
292425,
243274,
128587,
333388,
286288,
333393,
280147,
290390,
235095,
300630,
306776,
196187,
343647,
333408,
286306,
374372,
282213,
323178,
54893,
138863,
222832,
314998,
247416,
366203,
175741,
325245,
337535,
294529,
224901,
282246,
282245,
288392,
229001,
286343,
310923,
188048,
323217,
239250,
282259,
345752,
229020,
282271,
282273,
255649,
245412,
40613,
40614,
40615,
229029,
282280,
298661,
323236,
321207,
296632,
319162,
280251,
282303,
286399,
280257,
218819,
321219,
282312,
306890,
280267,
212685,
333517,
282318,
333520,
241361,
245457,
302802,
333521,
333523,
280278,
241365,
280280,
298712,
18138,
278234,
286423,
294622,
321247,
278240,
282339,
12010,
280300,
282348,
212716,
212717,
284401,
282358,
313081,
286459,
325371,
124669,
194303,
278272,
175873,
319233,
323331,
323332,
288512,
216839,
280327,
280329,
284429,
284431,
278291,
278293,
294678,
321302,
366360,
116505,
284442,
249626,
325404,
321310,
282400,
241441,
325410,
339745,
341796,
247590,
257830,
333610,
284459,
317232,
282417,
296755,
280372,
321337,
282427,
360252,
325439,
282434,
315202,
307011,
282438,
280392,
345929,
341836,
323406,
325457,
18262,
280410,
284507,
370522,
188251,
345951,
284512,
362337,
284514,
345955,
296806,
276327,
292712,
282474,
288619,
325484,
280430,
296814,
282480,
292720,
362352,
313203,
325492,
300918,
241528,
317304,
194429,
124798,
325503,
182144,
305026,
241540,
253829,
333701,
67463,
282504,
243591,
325515,
243597,
325518,
110480,
282518,
282519,
124824,
294809,
214937,
329622,
294807,
118685,
294814,
298909,
319392,
292771,
354212,
294823,
333735,
284587,
124852,
282549,
243637,
288697,
290746,
214977,
163781,
280519,
284619,
247757,
344013,
212946,
24532,
280541,
219101,
329695,
292836,
298980,
294886,
337895,
247785,
253929,
327661,
278512,
362480,
325619,
282612,
333817,
313339
] |
8c932465298cd18554b5263f3fc719e50fba94da
|
95c00a4f553659b1b34d8b1d07809275309f2b5b
|
/BitDateJSM/ProfileViewController.swift
|
a78e7ab97e9d768c74c8b22f7d43add52bd06a31
|
[] |
no_license
|
jaredMermey/bitdatejsm
|
d45f4f2a10a63a49e134693e406ed36f40302d76
|
76802263366197046418c94b5a3257ae13f505e7
|
refs/heads/master
| 2021-01-22T23:53:29.639440 | 2015-04-22T02:22:39 | 2015-04-22T02:22:39 | 33,901,378 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,644 |
swift
|
//
// ProfileViewController.swift
// BitDateJSM
//
// Created by Jared Mermey on 4/14/15.
// Copyright (c) 2015 Jared Mermey. All rights reserved.
//
import UIKit
class ProfileViewController: UIViewController {
@IBOutlet weak var imageView: UIImageView!
@IBOutlet weak var nameLabel: UILabel!
override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated)
//creates title that sits in the middle of the nav bar. Instead of words we are using an icon called "profile-header"
navigationItem.titleView = UIImageView(image: UIImage(named: "profile-header"))
//creates right bar button item on the navigation with image "nav-back-button" that will call goToCards function
let rightBarButtonItem = UIBarButtonItem(image: UIImage(named: "nav-back-button"), style: UIBarButtonItemStyle.Plain, target: self, action: "goToCards:")
navigationItem.setRightBarButtonItem(rightBarButtonItem, animated: true)
}
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
nameLabel.text = currentUser()?.name
currentUser()?.getPhoto({
image in
self.imageView.layer.masksToBounds = true
self.imageView.contentMode = .ScaleAspectFill
self.imageView.image = image
})
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
func goToCards(button: UIBarButtonItem){
pageController.goToNextVC()
}
}
|
[
-1
] |
cc4403f9026d94a9472665af1cb21d2d3a74d8f5
|
6b7d6245e817a0baca2df8e136f51964b479109b
|
/WatchOS_02/WatchOS_02 WatchKit Extension/InterfaceController.swift
|
66696ecd4b8cfbfcf3f1e98a51afbba4dc579e02
|
[
"MIT"
] |
permissive
|
XYGDeveloper/WatchOS
|
6acba1208717435e99b8c76dd09fc8a5ff36df49
|
44636ed13813ed9ffb34c5ce975a37b8aa56bd39
|
refs/heads/master
| 2020-06-01T09:20:20.184611 | 2019-06-07T11:15:07 | 2019-06-07T11:15:07 | 190,728,767 | 1 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,135 |
swift
|
//
// InterfaceController.swift
// WatchOS_02 WatchKit Extension
//
// Created by ll on 2019/6/7.
// Copyright © 2019 ll. All rights reserved.
//
import WatchKit
import Foundation
class InterfaceController: WKInterfaceController {
@IBOutlet weak var ModelJump: WKInterfaceButton!
@IBOutlet weak var Push: WKInterfaceButton!
@IBAction func toModelAction() {
presentController(withName: "SecondInterfaceController", context: "传个数据吧")
}
@IBAction func toPushAction() {
pushController(withName: "SecondInterfaceController", context: "传个数据吧")
}
override func awake(withContext context: Any?) {
super.awake(withContext: context)
// Configure interface objects here.
}
override func willActivate() {
// This method is called when watch view controller is about to be visible to user
super.willActivate()
}
override func didDeactivate() {
// This method is called when watch view controller is no longer visible
super.didDeactivate()
}
}
|
[
108913,
276334
] |
117c8eda1db57978a068356dc3eebb578e1229f1
|
280b2481037dc28668e53c875e68d9a91fdf6c43
|
/Project1/ViewController.swift
|
c38e6b8ee5086aa14f6ed2f2963ecfd75de2e710
|
[] |
no_license
|
naoyuki-kushida/Project1-table
|
735b3c665b41a3c426ebc7dc9966346175ddfe1d
|
20005838ad1561da348de3a7760c2d32a8afa97a
|
refs/heads/main
| 2023-08-18T05:45:50.470778 | 2021-10-13T07:40:58 | 2021-10-13T07:40:58 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,662 |
swift
|
//
// ViewController.swift
// Project1
//
// Created by Owner on 2021/10/12.
//
import UIKit
class ViewController: UITableViewController {
var pictures = [String]()
override func viewDidLoad() {
super.viewDidLoad()
title = "Tennma Mitsuru"
navigationController?.navigationBar.prefersLargeTitles = true
let fm = FileManager.default
let path = Bundle.main.resourcePath!
let items = try! fm.contentsOfDirectory(atPath: path)
for item in items {
if item.hasPrefix("nssl"){
// this is a picture to load!
pictures.append(item)
pictures.sort()
}
}
print(pictures)
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return pictures.count
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "Picture", for: indexPath)
cell.textLabel?.text = pictures[indexPath.row]
return cell
}
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if let vc = storyboard?.instantiateViewController(withIdentifier: "Detail") as? DetailViewController{
vc.selectedImage = pictures[indexPath.row]
vc.selectedPictureNumber = indexPath.row
vc.totalPictures = pictures.count
navigationController?.pushViewController(vc, animated: true)
}
}
}
|
[
264624
] |
18c1fb53fa57210d432d3e44fa51cb918233d4fe
|
91540fb80deea7b6fdb9454b3b466d9dd6c1e0c3
|
/ExponeaSDK/ExponeaSDK/Classes/Tracking/TrackingManager.swift
|
7769000b147891291c54607a058fa3f822cb8f89
|
[
"Apache-2.0",
"MIT"
] |
permissive
|
rugaru/exponea-ios-sdk
|
35a6f1277b0976662b731d6b4b7c330b548de8a7
|
eaa0b2e530861df2f0e5091941d003fa779026b7
|
refs/heads/master
| 2020-07-30T23:04:25.557760 | 2019-09-23T15:37:01 | 2019-09-23T15:37:01 | 210,390,538 | 0 | 0 |
MIT
| 2019-09-23T15:32:21 | 2019-09-23T15:32:21 | null |
UTF-8
|
Swift
| false | false | 29,999 |
swift
|
//
// TrackingManager.swift
// ExponeaSDK
//
// Created by Dominik Hádl on 11/04/2018.
// Copyright © 2018 Exponea. All rights reserved.
//
import Foundation
/// The Tracking Manager class is responsible to manage the automatic tracking events when
/// it's enable and persist the data according to each event type.
open class TrackingManager {
let database: DatabaseManagerType
let repository: RepositoryType
let device: DeviceProperties
/// The identifiers of the the current customer.
var customerIds: [String: JSONValue] {
return database.customer.ids
}
/// Returns the push token of the current customer if there is any.
var customerPushToken: String? {
return database.customer.pushToken
}
/// Payment manager responsible to track all in app payments.
internal var paymentManager: PaymentManagerType {
didSet {
paymentManager.delegate = self
paymentManager.startObservingPayments()
}
}
internal let reachability: Reachability
/// The manager for automatic push registration and delivery tracking
internal var notificationsManager: PushNotificationManagerType?
/// Used for periodic data flushing.
internal var flushingTimer: Timer?
/// User defaults used to store basic data and flags.
internal let userDefaults: UserDefaults
internal var isFlushingData: Bool = false
// Background task, if there is any - used to track sessions and flush data.
internal var backgroundTask: UIBackgroundTaskIdentifier = UIBackgroundTaskIdentifier.invalid {
didSet {
if backgroundTask == UIBackgroundTaskIdentifier.invalid && backgroundWorkItem != nil {
Exponea.logger.log(.verbose, message: "Background task ended, stopping background work item.")
backgroundWorkItem?.cancel()
backgroundWorkItem = nil
}
}
}
internal var backgroundWorkItem: DispatchWorkItem? {
didSet {
// Stop background taks if work item is done
if backgroundWorkItem == nil && backgroundTask != UIBackgroundTaskIdentifier.invalid {
Exponea.logger.log(.verbose, message: "Stopping background task after work item done/cancelled.")
UIApplication.shared.endBackgroundTask(backgroundTask)
backgroundTask = UIBackgroundTaskIdentifier.invalid
}
}
}
/// Flushing mode specifies how often and if should data be automatically flushed to Exponea.
/// See `FlushingMode` for available values.
public var flushingMode: FlushingMode = .immediate {
didSet {
Exponea.logger.log(.verbose, message: "Flushing mode updated to: \(flushingMode).")
updateFlushingMode()
}
}
init(repository: RepositoryType,
database: DatabaseManagerType,
device: DeviceProperties = DeviceProperties(),
paymentManager: PaymentManagerType = PaymentManager(),
userDefaults: UserDefaults) {
self.repository = repository
self.database = database
self.device = device
self.paymentManager = paymentManager
self.userDefaults = userDefaults
// Start reachability
self.reachability = Reachability(hostname: repository.configuration.hostname)!
try? self.reachability.startNotifier()
initialSetup()
}
deinit {
Exponea.logger.log(.verbose, message: "TrackingManager deallocated.")
}
func initialSetup() {
// Track initial install event if necessary.
trackInstallEvent()
/// Add the observers when the automatic session tracking is true.
if repository.configuration.automaticSessionTracking {
do {
try triggerInitialSession()
} catch {
Exponea.logger.log(.error, message: "Session start tracking error: \(error.localizedDescription)")
}
}
/// Add the observers when the automatic push notification tracking is true.
if repository.configuration.automaticPushNotificationTracking {
notificationsManager = PushNotificationManager(
trackingManager: self,
appGroup: repository.configuration.appGroup,
tokenTrackFrequency: repository.configuration.tokenTrackFrequency,
currentPushToken: database.customer.pushToken,
lastTokenTrackDate: database.customer.lastTokenTrackDate
)
}
// First remove all observing
NotificationCenter.default.removeObserver(self)
// Always track when we become active, enter background or terminate (used for both sessions and data flushing)
NotificationCenter.default.addObserver(self,
selector: #selector(applicationDidBecomeActive),
name: UIApplication.didBecomeActiveNotification,
object: nil)
NotificationCenter.default.addObserver(self,
selector: #selector(applicationDidEnterBackground),
name: UIApplication.didEnterBackgroundNotification,
object: nil)
}
/// Installation event is fired only once for the whole lifetime of the app on one
/// device when the app is launched for the first time.
internal func trackInstallEvent() {
/// Checking if the APP was launched before.
/// If the key value is false, means that the event was not fired before.
let key = Constants.Keys.installTracked + (database.customer.uuid?.uuidString ?? "")
guard userDefaults.bool(forKey: key) == false else {
Exponea.logger.log(.verbose, message: "Install event was already tracked, skipping.")
return
}
/// In case the event was not fired, we call the track manager
/// passing the install event type.
do {
// Get depdencies and track install event
try track(.install, with: [.properties(device.properties),
.timestamp(Date().timeIntervalSince1970)])
/// Set the value to true if event was executed successfully
userDefaults.set(true, forKey: key)
} catch {
Exponea.logger.log(.error, message: error.localizedDescription)
}
}
}
// MARK: -
extension TrackingManager: TrackingManagerType {
open func track(_ type: EventType, with data: [DataType]?) throws {
/// Get token mapping or fail if no token provided.
let tokens = repository.configuration.tokens(for: type)
if tokens.isEmpty {
throw TrackingManagerError.unknownError("No project tokens provided.")
}
Exponea.logger.log(.verbose, message: "Tracking event of type: \(type).")
/// For each project token we have, track the data.
for projectToken in tokens {
let payload: [DataType] = [.projectToken(projectToken)] + (data ?? [])
switch type {
case .install: try trackInstall(with: payload)
case .sessionStart: try trackStartSession(with: payload)
case .sessionEnd: try trackEndSession(with: payload)
case .customEvent: try trackEvent(with: payload)
case .identifyCustomer: try identifyCustomer(with: payload)
case .payment: try trackPayment(with: payload)
case .registerPushToken: try trackPushToken(with: payload)
case .pushOpened: try trackPushOpened(with: payload)
case .pushDelivered: try trackPushDelivered(with: payload)
}
}
// If we have immediate flushing mode, flush after tracking
if case .immediate = flushingMode {
flushData()
}
}
open func identifyCustomer(with data: [DataType]) throws {
try database.identifyCustomer(with: data)
}
open func trackInstall(with data: [DataType]) throws {
try database.trackEvent(with: data + [.eventType(Constants.EventTypes.installation)])
}
open func trackEvent(with data: [DataType]) throws {
try database.trackEvent(with: data)
}
open func trackPayment(with data: [DataType]) throws {
try database.trackEvent(with: data + [.eventType(Constants.EventTypes.payment)])
}
open func trackPushToken(with data: [DataType]) throws {
try database.identifyCustomer(with: data)
}
open func trackPushOpened(with data: [DataType]) throws {
try database.trackEvent(with: data + [.eventType(Constants.EventTypes.pushOpen)])
}
open func trackPushDelivered(with data: [DataType]) throws {
try database.trackEvent(with: data + [.eventType(Constants.EventTypes.pushDelivered)])
}
open func trackStartSession(with data: [DataType]) throws {
try database.trackEvent(with: data + [.eventType(Constants.EventTypes.sessionStart)])
}
open func trackEndSession(with data: [DataType]) throws {
try database.trackEvent(with: data + [.eventType(Constants.EventTypes.sessionEnd)])
}
}
// MARK: - Sessions
extension TrackingManager {
internal var sessionStartTime: Double {
get {
return userDefaults.double(forKey: Constants.Keys.sessionStarted)
}
set {
userDefaults.set(newValue, forKey: Constants.Keys.sessionStarted)
}
}
internal var sessionEndTime: Double {
get {
return userDefaults.double(forKey: Constants.Keys.sessionEnded)
}
set {
userDefaults.set(newValue, forKey: Constants.Keys.sessionEnded)
}
}
internal var sessionBackgroundTime: Double {
get {
return userDefaults.double(forKey: Constants.Keys.sessionBackgrounded)
}
set {
userDefaults.set(newValue, forKey: Constants.Keys.sessionBackgrounded)
}
}
internal func triggerInitialSession() throws {
// If we have a previously started session and a last session background time,
// but no end time then we can assume that the app was terminated and we can use
// the last background time as a session end.
if sessionStartTime != 0 && sessionEndTime == 0 && sessionBackgroundTime != 0 {
sessionEndTime = sessionBackgroundTime
sessionBackgroundTime = 0
}
try triggerSessionStart()
}
open func triggerSessionStart() throws {
// If session end time is set, app was terminated
if sessionStartTime != 0 && sessionEndTime != 0 {
Exponea.logger.log(.verbose, message: "App was terminated previously, first tracking previous session end.")
try triggerSessionEnd()
}
// Track previous session if we are past session timeout
if shouldTrackCurrentSession {
Exponea.logger.log(.verbose, message: "We're past session timeout, first tracking previous session end.")
try triggerSessionEnd()
} else if sessionStartTime != 0 {
Exponea.logger.log(.verbose, message: "Continuing current session as we're within session timeout.")
return
}
// Start the session with current date
sessionStartTime = Date().timeIntervalSince1970
// Track session start
try track(.sessionStart, with: [.properties(device.properties),
.timestamp(sessionStartTime)])
Exponea.logger.log(.verbose, message: Constants.SuccessMessages.sessionStart)
}
open func triggerSessionEnd() throws {
guard sessionStartTime != 0 else {
Exponea.logger.log(.error, message: "Can't end session as no session was started.")
return
}
// Set the session end to the time when session end is triggered or if it was set previously
// (for example after app has been terminated)
sessionEndTime = sessionEndTime == 0 ? Date().timeIntervalSince1970 : sessionEndTime
// Prepare data to persist into coredata.
var properties = device.properties
// Calculate the duration of the session and add to properties.
let duration = sessionEndTime - sessionStartTime
properties["duration"] = .double(duration)
// Track session end
try track(.sessionEnd, with: [.properties(properties),
.timestamp(sessionEndTime)])
// Reset session times
sessionStartTime = 0
sessionEndTime = 0
Exponea.logger.log(.verbose, message: Constants.SuccessMessages.sessionEnd)
}
@objc internal func applicationDidBecomeActive() {
// Cancel background task if we have any
if let item = backgroundWorkItem {
item.cancel()
backgroundWorkItem = nil
}
// Let the notification manager know the app has becom active
notificationsManager?.applicationDidBecomeActive()
// Reschedule flushing timer if using periodic flushing mode
if case let .periodic(interval) = flushingMode {
flushingTimer = Timer.scheduledTimer(withTimeInterval: TimeInterval(interval),
repeats: true) { _ in
self.flushData()
}
}
// Track session start, if we are allowed to
if repository.configuration.automaticSessionTracking {
do {
try triggerSessionStart()
} catch {
Exponea.logger.log(.error, message: "Session start tracking error: \(error.localizedDescription)")
}
}
}
@objc internal func applicationDidEnterBackground() {
// Save last session background time, in case we get terminated
sessionBackgroundTime = Date().timeIntervalSince1970
// Make sure to not create a new background task, if we already have one.
guard backgroundTask == UIBackgroundTaskIdentifier.invalid else {
return
}
// Start the background task
backgroundTask = UIApplication.shared.beginBackgroundTask(expirationHandler: {
UIApplication.shared.endBackgroundTask(self.backgroundTask)
self.backgroundTask = UIBackgroundTaskIdentifier.invalid
})
// Dispatch after default session timeout
let queue = DispatchQueue.global(qos: .background)
let item = createBackgroundWorkItem()
backgroundWorkItem = item
// Schedule the task to run using delay if applicable
let shouldDelay = repository.configuration.automaticSessionTracking
let delay = shouldDelay ? Constants.Session.defaultTimeout : 0
queue.asyncAfter(deadline: .now() + delay, execute: item)
Exponea.logger.log(.verbose, message: "Started background task with delay \(delay)s.")
}
internal func createBackgroundWorkItem() -> DispatchWorkItem {
return DispatchWorkItem { [weak self] in
guard let `self` = self else { return }
// If we're cancelled, stop background task
if self.backgroundWorkItem?.isCancelled ?? false {
UIApplication.shared.endBackgroundTask(self.backgroundTask)
self.backgroundTask = UIBackgroundTaskIdentifier.invalid
return
}
// If we track sessions automatically
if self.repository.configuration.automaticSessionTracking {
do {
try self.triggerSessionEnd()
self.sessionBackgroundTime = 0
} catch {
Exponea.logger.log(.error, message: "Session end tracking error: \(error.localizedDescription)")
}
}
switch self.flushingMode {
case .periodic(_):
// Invalidate the timer
self.flushingTimer?.invalidate()
self.flushingTimer = nil
// Continue to flush data on line below
fallthrough
case .automatic, .immediate:
// Only stop background task after we upload
self.flushData(completion: { [weak self] in
guard let weakSelf = self else { return }
UIApplication.shared.endBackgroundTask(weakSelf.backgroundTask)
weakSelf.backgroundTask = UIBackgroundTaskIdentifier.invalid
})
default:
// We're done
UIApplication.shared.endBackgroundTask(self.backgroundTask)
self.backgroundTask = UIBackgroundTaskIdentifier.invalid
}
}
}
internal var shouldTrackCurrentSession: Bool {
/// Avoid tracking if session not started
guard sessionStartTime != 0 else {
return false
}
// Get current time to calculate duration
let currentTime = Date().timeIntervalSince1970
/// Calculate the session duration
let sessionDuration = sessionEndTime - currentTime
/// Session should be ended
if sessionDuration > repository.configuration.sessionTimeout {
return true
} else {
return false
}
}
}
// MARK: - Flushing -
extension TrackingManager {
@objc func flushData() {
flushData(completion: nil)
}
/// Method that flushes all data to the API.
///
/// - Parameter completion: A completion that is called after all calls succeed or fail.
func flushData(completion: (() -> Void)?) {
do {
// Check if flush is in progress
guard !isFlushingData else {
Exponea.logger.log(.warning, message: "Data flushing in progress, ignoring another flush call.")
completion?()
return
}
// Check if we have an internet connection otherwise bail
guard reachability.connection != .none else {
Exponea.logger.log(.warning, message: "Connection issues when flushing data, not flushing.")
completion?()
return
}
// Pull from db
let events = try database.fetchTrackEvent().reversed()
let customers = try database.fetchTrackCustomer().reversed()
Exponea.logger.log(.verbose, message: """
Flushing data: \(events.count + customers.count) total objects to upload, \
\(events.count) events and \(customers.count) customer updates.
""")
// Check if we have any data otherwise bail
guard !events.isEmpty || !customers.isEmpty else {
return
}
var customersDone = false
var eventsDone = false
isFlushingData = true
flushCustomerTracking(Array(customers), completion: {
customersDone = true
if eventsDone && customersDone {
self.isFlushingData = false
completion?()
}
})
flushEventTracking(Array(events), completion: {
eventsDone = true
if eventsDone && customersDone {
self.isFlushingData = false
completion?()
}
})
} catch {
Exponea.logger.log(.error, message: error.localizedDescription)
}
}
func flushCustomerTracking(_ customers: [TrackCustomer], completion: (() -> Void)? = nil) {
var counter = customers.count
for customer in customers {
repository.trackCustomer(with: customer.dataTypes, for: customerIds) { [weak self] (result) in
switch result {
case .success:
Exponea.logger.log(.verbose, message: """
Successfully uploaded customer update: \(customer.objectID).
""")
do {
try self?.database.delete(customer)
} catch {
Exponea.logger.log(.error, message: """
Failed to remove object from database: \(customer.objectID).
\(error.localizedDescription)
""")
}
case .failure(let error):
switch error {
case .connectionError, .serverError(nil):
// If server or connection error, bail here and do not increase retry count
Exponea.logger.log(.warning, message: """
Failed to upload customer event due to connection or server error. \
\(error.localizedDescription)
""")
break
default:
// Handle all other errors regularly
Exponea.logger.log(.error, message: """
Failed to upload customer update. \(error.localizedDescription)
""")
// Increase the retry count
let retries = NSNumber(integerLiteral: customer.retries.intValue + 1)
customer.retries = retries
// If we have reached the max count of retries, delete the object.
// Otherwise save changes and try again next time.
do {
let max = self?.repository.configuration.flushEventMaxRetries ?? Constants.Session.maxRetries
if customer.retries.intValue >= max {
Exponea.logger.log(.error, message: """
Maximum retry count reached, deleting customer event: \(customer.objectID)
""")
try self?.database.delete(customer)
} else {
Exponea.logger.log(.error, message: """
Increasing retry count (\(customer.retries)) for customer event: \(customer.objectID)
""")
try self?.database.save()
}
} catch {
Exponea.logger.log(.error, message: """
Failed to update retry count or remove object from database: \(customer.objectID).
\(error.localizedDescription)
""")
}
}
}
// Handle request counter, potentially call completion
counter -= 1
if counter == 0 {
completion?()
}
}
}
// If we have no customer updates, call completion
if customers.isEmpty {
completion?()
}
}
func flushEventTracking(_ events: [TrackEvent], completion: (() -> Void)? = nil) {
var counter = events.count
for event in events {
repository.trackEvent(with: event.dataTypes, for: customerIds) { [weak self] (result) in
switch result {
case .success:
Exponea.logger.log(.verbose, message: "Successfully uploaded event: \(event.objectID).")
do {
try self?.database.delete(event)
} catch {
Exponea.logger.log(.error, message: """
Failed to remove object from database: \(event.objectID). \(error.localizedDescription)
""")
}
case .failure(let error):
switch error {
case .connectionError, .serverError(_):
// If server or connection error, bail here and do not increase retry count
Exponea.logger.log(.warning, message: """
Failed to upload event due to connection or server error. \
\(error.localizedDescription)
""")
break
default:
Exponea.logger.log(.error, message: "Failed to upload event. \(error.localizedDescription)")
// Increase the retry count
let retries = NSNumber(integerLiteral: event.retries.intValue + 1)
event.retries = retries
// If we have reached the max count of retries, delete the object.
// Otherwise save changes and try again next time.
do {
let max = self?.repository.configuration.flushEventMaxRetries ?? Constants.Session.maxRetries
if event.retries.intValue >= max {
Exponea.logger.log(.error, message: """
Maximum retry count reached, deleting event: \(event.objectID)
""")
try self?.database.delete(event)
} else {
Exponea.logger.log(.error, message: """
Increasing retry count (\(event.retries)) for event: \(event.objectID)
""")
try self?.database.save()
}
} catch {
Exponea.logger.log(.error, message: """
Failed to update retry count or remove object from database: \(event.objectID).
\(error.localizedDescription)
""")
}
}
}
// Handle request counter, potentially call completion
counter -= 1
if counter == 0 {
completion?()
}
}
}
// If we have no events, call completion
if events.isEmpty {
completion?()
}
}
func updateFlushingMode() {
// Invalidate timers
flushingTimer?.invalidate()
flushingTimer = nil
// Update for new flushing mode
switch flushingMode {
case .immediate:
// Immediately flush any data we might have
flushData()
case .periodic(let interval):
// Schedule a timer for the specified interval
flushingTimer = Timer.scheduledTimer(withTimeInterval: TimeInterval(interval),
repeats: true) { _ in
self.flushData()
}
default:
// No need to do anything for manual or automatic (tracked on app events) or immediate
break
}
}
}
// MARK: - Payments -
extension TrackingManager: PaymentManagerDelegate {
public func trackPaymentEvent(with data: [DataType]) {
do {
try track(.payment, with: data)
Exponea.logger.log(.verbose, message: Constants.SuccessMessages.paymentDone)
} catch {
Exponea.logger.log(.error, message: error.localizedDescription)
}
}
}
// MARK: - Anonymize -
extension TrackingManager {
public func anonymize() throws {
func perform() throws {
// Cancel all request (in case flushing was ongoing)
repository.cancelRequests()
// Clear all database contents
try database.clear()
// Clear the session data
sessionStartTime = 0
sessionBackgroundTime = 0
sessionEndTime = 0
// Re-do initial setup
initialSetup()
}
let currentToken = customerPushToken
if let token = currentToken, let projectToken = repository.configuration.tokens(for: .registerPushToken).first {
try trackPushToken(with: [.projectToken(projectToken), .pushNotificationToken(nil)])
flushData {
do {
try perform()
try self.trackPushToken(with: [.projectToken(projectToken), .pushNotificationToken(token)])
} catch {
Exponea.logger.log(.error, message: error.localizedDescription)
}
self.flushData()
}
} else {
try perform()
}
}
}
|
[
-1
] |
13aac9a0b5ba0b25e20318e032d5ccea8696c27c
|
3f40d545b8b4ea0d47c5d394fef08a7e47b82f39
|
/Sources/x3/HotKeyManager.swift
|
760523e46c6b332a44c1ffcecc8dc36e92b5266c
|
[
"MIT"
] |
permissive
|
tmandry/x3
|
a15694abdbe09dd1611eedd99f7ea6d53abdd0d8
|
71d58408378847176dc9b72798263020d02c2e42
|
refs/heads/main
| 2022-11-12T00:52:24.494836 | 2022-10-28T17:42:40 | 2022-10-28T17:42:40 | 107,823,633 | 15 | 2 |
MIT
| 2021-10-17T04:39:43 | 2017-10-21T23:36:32 |
Swift
|
UTF-8
|
Swift
| false | false | 2,593 |
swift
|
import AppKit
import Carbon
private let hotKeySignature = fourCharCodeFrom("X3WM")
public class HotKeyManager {
private var handlers: [() -> ()] = []
public init() {}
func register(keyCode: Int, modifierKeys: Int, handler: @escaping () -> ()) {
handlers.append(handler)
var hotKeyID = EventHotKeyID()
hotKeyID.signature = hotKeySignature
hotKeyID.id = UInt32(handlers.count - 1)
var eventType = EventTypeSpec()
eventType.eventClass = OSType(kEventClassKeyboard)
eventType.eventKind = OSType(kEventHotKeyPressed)
let selfPtr = UnsafeMutableRawPointer(Unmanaged.passUnretained(self).toOpaque())
InstallEventHandler(GetApplicationEventTarget(),
{(nextHandler, event, userData) -> OSStatus in
return HotKeyManager.handleCarbonEvent(event, userData)
}, 1, &eventType, selfPtr, nil)
var hotKeyRef: EventHotKeyRef?
let _ = RegisterEventHotKey(UInt32(keyCode), UInt32(modifierKeys), hotKeyID,
GetApplicationEventTarget(), 0, &hotKeyRef)
}
static func handleCarbonEvent(_ event: EventRef?, _ userData: UnsafeMutableRawPointer?)
-> OSStatus {
guard let event = event else {
return OSStatus(eventNotHandledErr)
}
var hotKeyID = EventHotKeyID()
let err = GetEventParameter(event, UInt32(kEventParamDirectObject),
UInt32(typeEventHotKeyID), nil, MemoryLayout<EventHotKeyID>.size, nil, &hotKeyID)
if err != noErr {
return err
}
guard hotKeyID.signature == hotKeySignature else {
return OSStatus(eventNotHandledErr)
}
let self_ = Unmanaged<HotKeyManager>.fromOpaque(userData!).takeUnretainedValue()
return self_.handleHotKey(eventKind: GetEventKind(event), hotKeyID: hotKeyID)
}
private func handleHotKey(eventKind: UInt32, hotKeyID: EventHotKeyID) -> OSStatus {
log.debug("Got event: \(eventKind) \(String(describing: hotKeyID))")
switch eventKind {
case UInt32(kEventHotKeyPressed):
handlers[Int(hotKeyID.id)]()
return noErr
case UInt32(kEventHotKeyReleased):
return noErr
default:
return OSStatus(eventNotHandledErr)
}
}
}
private func fourCharCodeFrom(_ string : String) -> FourCharCode {
assert(string.count == 4, "String length must be 4")
var result : FourCharCode = 0
for char in string.utf16 {
result = (result << 8) + FourCharCode(char)
}
return result
}
|
[
-1
] |
a27b9bce57250b15175ce9a409f3b1b71922e069
|
fcdbbf1b5ce09b71d3652b6ed6b1e9c42d52e397
|
/Example/MessengerKit/CustomCollectionView.swift
|
6b9dde240dc20e0184639f4214ed2c8864fc4154
|
[
"MIT"
] |
permissive
|
smartphone-pro/MessengerKit
|
68233c23acd87c3009e9a6d625ee7d71e4a86910
|
d0d452a9d9b15c67c14a234aca46245d01066532
|
refs/heads/master
| 2022-10-11T19:35:16.835962 | 2020-06-11T15:20:59 | 2020-06-11T15:20:59 | 271,577,994 | 1 | 0 |
MIT
| 2020-06-11T15:12:02 | 2020-06-11T15:12:01 | null |
UTF-8
|
Swift
| false | false | 573 |
swift
|
//
// CustomCollectionView.swift
// MessengerKit_Example
//
// Created by Stephen Radford on 14/06/2018.
// Copyright © 2018 CocoaPods. All rights reserved.
//
import UIKit
import MessengerKit
class CustomCollectionView: MSGImessageCollectionView {
override func registerCells() {
super.registerCells()
register(UINib(nibName: "CustomOutgoingTextCell", bundle: nil), forCellWithReuseIdentifier: "outgoingText")
register(UINib(nibName: "CustomIncomingTextCell", bundle: nil), forCellWithReuseIdentifier: "incomingText")
}
}
|
[
-1
] |
2d683343cfbe680e33b76e1c21f9a862ab1045a2
|
945bf21b260a14867ce62e137ffd6f8c350727de
|
/TubeTender/Views/InsetView.swift
|
7fce70c0dc82d1df91c9177316564c480c6ae6ec
|
[] |
no_license
|
TilBlechschmidt-ProjectGraveyard/TubeTender
|
7fc7642a399fcd957e0fe867c2e5c24b62336deb
|
de1e7e68733adc02dc378237e57912b81a3ba65e
|
refs/heads/master
| 2022-01-10T21:20:09.231999 | 2019-05-07T20:48:11 | 2019-05-07T20:56:10 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 911 |
swift
|
//
// InsetView.swift
// TubeTender
//
// Created by Noah Peeters on 06.05.19.
// Copyright © 2019 Til Blechschmidt. All rights reserved.
//
import UIKit
class InsetView: UIView {
init(view: UIView, insets: UIEdgeInsets) {
super.init(frame: .zero)
addSubview(view)
view.snp.makeConstraints { make in
make.left.equalToSuperview().inset(insets.left)
make.top.equalToSuperview().inset(insets.top)
make.right.equalToSuperview().inset(insets.right)
make.bottom.equalToSuperview().inset(insets.bottom)
}
}
convenience init(view: UIView, equalInsets inset: CGFloat = Constants.uiPadding) {
self.init(view: view, insets: UIEdgeInsets(top: inset, left: inset, bottom: inset, right: inset))
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
|
[
-1
] |
78c4ddd25f64e04dc9d7e20a5005e33b231f800d
|
34022f6464aee14d10dd3376770c839b00fbc053
|
/Stats on Sight/Stats on Sight/Views/ViewController.swift
|
822440a61408c356a77745d694a7c23ded3be62e
|
[] |
no_license
|
oldboyvb/Stats-on-Sight
|
4ad3a6c6af0d9f5f3b93e582f60af3a252749bd7
|
d85e5357e15a4e471d6e59bd74eb4420df5a4a7d
|
refs/heads/master
| 2022-04-02T17:44:35.470749 | 2020-01-12T21:26:24 | 2020-01-12T21:26:24 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 10,113 |
swift
|
//
// ViewController.swift
// Stats on Sight
//
// Created by Alex Law on 2020-01-11.
// Copyright © 2020 Alex Law. All rights reserved.
//
import UIKit
import SceneKit
import ARKit
protocol ViewControllerDelegate: class {
func retrySearch()
}
class ViewController: UIViewController {
@IBOutlet var sceneView: ARSCNView!
@IBOutlet weak var messagePanel: UIView!
@IBOutlet weak var messageLabel: UILabel!
@IBOutlet weak var loadingPanel: UIView!
@IBOutlet weak var loadingIndicator: UIActivityIndicatorView!
@IBOutlet weak var buttonPanel: UIView!
@IBOutlet weak var buttonIndicator: UIButton!
@IBAction func retryButtonTapped(_ sender: Any) {
delegate?.retrySearch()
}
static var instance: ViewController?
weak var delegate: ViewControllerDelegate?
var currentFollowedGameLabelText = ""
var hasLoadedGame = false {
didSet {
stopAnimatingLoadingIndicator()
}
}
/// An object that detects rectangular shapes in the user's environment
let rectangleDetector = RectangleDetector()
/// An object that represents an augmented image that exists in the user's environment.
var gameplayImage: GameplayImage?
override func viewDidLoad() {
super.viewDidLoad()
// Set the view's delegate
sceneView.delegate = self
rectangleDetector.delegate = self
// Show statistics such as fps and timing information
sceneView.showsStatistics = false
//
// // Create a new scene
// let scene = SCNScene(named: "art.scnassets/ship.scn")!
//
// // Set the scene to the view
// sceneView.scene = scene
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
ViewController.instance = self
// Prevent the screen from being dimmed after a while.
UIApplication.shared.isIdleTimerDisabled = true
searchForNewImageToTrack()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
// Create a session configuration
let configuration = ARWorldTrackingConfiguration()
configuration.planeDetection = .vertical
// Run the view's session
sceneView.session.run(configuration)
sceneView.delegate = self
sceneView.debugOptions = [ARSCNDebugOptions.showFeaturePoints]
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
// Pause the view's session
sceneView.session.pause()
}
func searchForNewImageToTrack() {
gameplayImage?.delegate = nil
gameplayImage = nil
// Restart the session and remove any image anchors that may have been detected previously.
runWorldTrackingSession(runOptions: [.removeExistingAnchors, .resetTracking])
let messageString = hasLoadedGame ? currentFollowedGameLabelText : "Place Camera at a Live Game"
showMessage("Place Camera at a Live Game", autoHide: hasLoadedGame)
}
/// - Tag: ImageTrackingSession
private func runWorldTrackingSession(runOptions: ARSession.RunOptions = [.removeExistingAnchors]) {
print("Running world tracking session...")
let configuration = ARWorldTrackingConfiguration();
// let configuration = ARImageTrackingConfiguration()
configuration.planeDetection = .vertical
sceneView.session.run(configuration)
}
private var messageHideTimer: Timer?
func showMessage(_ message: String, autoHide: Bool = true) {
DispatchQueue.main.async {
self.messageLabel.text = message
self.setMessageHidden(false)
self.messageHideTimer?.invalidate()
if autoHide {
self.messageHideTimer = Timer.scheduledTimer(withTimeInterval: 5.0, repeats: false, block: { [weak self] _ in
self?.setMessageHidden(true)
})
}
}
}
private func setMessageHidden(_ hide: Bool) {
DispatchQueue.main.async {
UIView.animate(withDuration: 0.25, delay: 0, options: [.beginFromCurrentState], animations: {
self.messagePanel.alpha = hide ? 0 : 1
})
}
}
private func setLoadingHidden(_ hide: Bool) {
loadingPanel.isHidden = hide
DispatchQueue.main.async {
UIView.animate(withDuration: 0.25, delay: 0, options: [.beginFromCurrentState], animations: {
self.loadingPanel.alpha = hide ? 0 : 1
})
}
}
private func setRetryHidden(_ hide: Bool ) {
loadingPanel.isHidden = hide
DispatchQueue.main.async {
UIView.animate(withDuration: 0.25, delay: 0, options: [.beginFromCurrentState], animations: {
self.loadingPanel.alpha = hide ? 0 : 1
})
}
}
}
extension ViewController: ARSCNViewDelegate {
/// - Tag: ImageWasRecognized
func renderer(_ renderer: SCNSceneRenderer, didAdd node: SCNNode, for anchor: ARAnchor) {
gameplayImage?.add(anchor, node: node)
setMessageHidden(true)
}
/// - Tag: DidUpdateAnchor
func renderer(_ renderer: SCNSceneRenderer, didUpdate node: SCNNode, for anchor: ARAnchor) {
gameplayImage?.update(anchor)
}
func session(_ session: ARSession, didFailWithError error: Error) {
guard let arError = error as? ARError else { return }
if arError.code == .invalidReferenceImage {
// Restart the experience, as otherwise the AR session remains stopped.
// There's no benefit in surfacing this error to the user.
print("Error: The detected rectangle cannot be tracked.")
searchForNewImageToTrack()
return
}
let errorWithInfo = arError as NSError
let messages = [
errorWithInfo.localizedDescription,
errorWithInfo.localizedFailureReason,
errorWithInfo.localizedRecoverySuggestion
]
// Use `compactMap(_:)` to remove optional error messages.
let errorMessage = messages.compactMap({ $0 }).joined(separator: "\n")
DispatchQueue.main.async {
// Present an alert informing about the error that just occurred.
let alertController = UIAlertController(title: "The AR session failed.", message: errorMessage, preferredStyle: .alert)
let restartAction = UIAlertAction(title: "Restart Session", style: .default) { _ in
alertController.dismiss(animated: true, completion: nil)
self.searchForNewImageToTrack()
}
alertController.addAction(restartAction)
self.present(alertController, animated: true, completion: nil)
}
}
}
extension ViewController: RectangleDetectorDelegate {
/// Called when the app recognized a rectangular shape in the user's environment
func rectangleFound(rectangleContent: CIImage, _ payload: Payload) {
print("Found a rectangle")
hasLoadedGame = true
DispatchQueue.main.async {
// Ignore detected rectangles if the app is currently tracking an image.
guard self.gameplayImage == nil else {
return
}
guard let referenceImagePixelBuffer = rectangleContent.toPixelBuffer(pixelFormat: kCVPixelFormatType_32BGRA) else {
print("Error: Could not convert rectangle content into an ARReferenceImage")
return
}
let possibleReferenceImage = ARReferenceImage(referenceImagePixelBuffer, orientation: .up, physicalWidth: CGFloat(0.5))
if #available(iOS 13.0, *) {
possibleReferenceImage.validate{ [weak self] (error) in
if let error = error {
print("Reference image validation failed: \(error.localizedDescription)")
return
}
print("Creating new Gameplay image...")
// Try tracking the image that lies within the rectangle which the app just detected.
guard let newGameplayImage = GameplayImage(rectangleContent, payload) else { return }
newGameplayImage.delegate = self
self?.gameplayImage = newGameplayImage
// Start the session with the newly recognized image.
self?.runWorldTrackingSession()
}
} else {
print("Need to be iOS greater than 13.0")
}
}
}
func startAnimatingLoadingIndicator() {
DispatchQueue.main.async {
self.loadingIndicator.startAnimating()
self.setLoadingHidden(false)
}
}
func stopAnimatingLoadingIndicator() {
DispatchQueue.main.async {
self.loadingIndicator.stopAnimating()
self.setLoadingHidden(true)
}
}
func showMessage(_ string: String, autohide: Bool) {
if hasLoadedGame {
currentFollowedGameLabelText = string
}
DispatchQueue.main.async {
self.showMessage(string, autoHide: autohide)
}
}
func showButton() {
DispatchQueue.main.async {
self.setRetryHidden(false)
}
}
}
extension ViewController: GameplayImageDelegate {
func gameplayImageLostTracking(_ gamplayImage: GameplayImage) {
if !hasLoadedGame {
print("Lost tracking, looking for new image")
searchForNewImageToTrack()
}
}
func placeNodeInScene(for node: SCNNode) {
sceneView.scene.rootNode.addChildNode(node)
}
}
|
[
-1
] |
1d00eabb80df0b58b8f7137b1491a01f43b233e6
|
f645f940a4d8719c016da85358ddd63ba3e03df6
|
/RotationSample/SceneDelegate.swift
|
1a363a39852875c4d14ea0504ab4a62134048337
|
[] |
no_license
|
tnakai11/RotationSample
|
96efd42cf853ec7c8e51ac6c25253c3b8f3a3967
|
79fd4a2a5b6ad7a82fe325d4e727c7655b0688ae
|
refs/heads/main
| 2023-03-03T05:17:40.435961 | 2021-02-09T08:30:15 | 2021-02-09T08:30:15 | 337,338,858 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,453 |
swift
|
//
// SceneDelegate.swift
// RotationSample
//
// Created by Takumi Nakai on 2021/02/09.
//
import UIKit
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
guard let _ = (scene as? UIWindowScene) else { return }
window = UIWindow(windowScene: scene as! UIWindowScene)
window?.rootViewController = ViewController()
window?.makeKeyAndVisible()
}
func sceneDidDisconnect(_ scene: UIScene) {
// Called as the scene is being released by the system.
// This occurs shortly after the scene enters the background, or when its session is discarded.
// Release any resources associated with this scene that can be re-created the next time the scene connects.
// The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead).
}
func sceneDidBecomeActive(_ scene: UIScene) {
// Called when the scene has moved from an inactive state to an active state.
// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
}
func sceneWillResignActive(_ scene: UIScene) {
// Called when the scene will move from an active state to an inactive state.
// This may occur due to temporary interruptions (ex. an incoming phone call).
}
func sceneWillEnterForeground(_ scene: UIScene) {
// Called as the scene transitions from the background to the foreground.
// Use this method to undo the changes made on entering the background.
}
func sceneDidEnterBackground(_ scene: UIScene) {
// Called as the scene transitions from the foreground to the background.
// Use this method to save data, release shared resources, and store enough scene-specific state information
// to restore the scene back to its current state.
}
}
|
[
393221,
163849,
393228,
393231,
393251,
352294,
344103,
393260,
393269,
213049,
376890,
385082,
16444,
393277,
254020,
376906,
254032,
286804,
368728,
180314,
254045,
180322,
376932,
286833,
368753,
286845,
286851,
417925,
262284,
360598,
286880,
286889,
377003,
377013,
164029,
327872,
180418,
377030,
377037,
368854,
377047,
418008,
418012,
377063,
327915,
205037,
393457,
393461,
393466,
418044,
336124,
385281,
336129,
262405,
180491,
336140,
262417,
368913,
262423,
377118,
377121,
262437,
254253,
262455,
393539,
262473,
344404,
213333,
418135,
262497,
418145,
262501,
213354,
246124,
262508,
262512,
213374,
385420,
393613,
262551,
262553,
385444,
262567,
385452,
262574,
393649,
385460,
262587,
344512,
262593,
360917,
369119,
328180,
328183,
328190,
254463,
328193,
164362,
328207,
410129,
393748,
262679,
377372,
188959,
385571,
377384,
197160,
33322,
352822,
270905,
197178,
418364,
188990,
369224,
385610,
352844,
385617,
352865,
262761,
352875,
344694,
352888,
336513,
377473,
385671,
148106,
213642,
377485,
352919,
98969,
344745,
361130,
271018,
336556,
385714,
434868,
164535,
336568,
164539,
328379,
328387,
352969,
344777,
418508,
385743,
385749,
139998,
189154,
369382,
361196,
418540,
418555,
344832,
336644,
344837,
344843,
361231,
394002,
336660,
418581,
418586,
434971,
369436,
262943,
369439,
418591,
418594,
336676,
418600,
418606,
369464,
361274,
328516,
328520,
336712,
361289,
328523,
361300,
213848,
426842,
361307,
197469,
361310,
254813,
361318,
344936,
361323,
361335,
328574,
369544,
361361,
222129,
345036,
386004,
345046,
386012,
386019,
386023,
435188,
328703,
328710,
418822,
377867,
328715,
361490,
386070,
336922,
386074,
345119,
377888,
328747,
214060,
345134,
345139,
361525,
386102,
361537,
377931,
345172,
189525,
156762,
402523,
361568,
148580,
345200,
173170,
361591,
386168,
361594,
410746,
361599,
214150,
345224,
386187,
337048,
345247,
361645,
337072,
345268,
337076,
402615,
361657,
402636,
328925,
165086,
66783,
328933,
222438,
328942,
386286,
386292,
206084,
328967,
345377,
345380,
353572,
345383,
263464,
337207,
345400,
378170,
369979,
386366,
337224,
337230,
337235,
263509,
353634,
337252,
402792,
345449,
99692,
271731,
378232,
337278,
271746,
181639,
353674,
181644,
361869,
181650,
181655,
230810,
263585,
181671,
181674,
181679,
181682,
337330,
181687,
370105,
181691,
181697,
361922,
337350,
181704,
337366,
271841,
329192,
361961,
116211,
337399,
402943,
337416,
329227,
419341,
419345,
329234,
419351,
345626,
419357,
345631,
419360,
370208,
394787,
419363,
370214,
419369,
394796,
419377,
419386,
206397,
214594,
419401,
353868,
419404,
370254,
173648,
419408,
214611,
419412,
403040,
345702,
370298,
353920,
403073,
403076,
345737,
198282,
403085,
403092,
345750,
419484,
345758,
345763,
419492,
345766,
419498,
419502,
370351,
419507,
337588,
419510,
419513,
337601,
403139,
337607,
419528,
419531,
272083,
394967,
419543,
419545,
345819,
419548,
181982,
419551,
345829,
419560,
337643,
419564,
337647,
370416,
337661,
362249,
362252,
395022,
362256,
345888,
362274,
378664,
354107,
345916,
354112,
247618,
370504,
329545,
354124,
345932,
370510,
337743,
354132,
247639,
337751,
370520,
313181,
354143,
354157,
345965,
345968,
345971,
345975,
403321,
1914,
354173,
395148,
247692,
337809,
247701,
329625,
436127,
436133,
247720,
337834,
362414,
370611,
337845,
190393,
346059,
247760,
346064,
346069,
419810,
329699,
354275,
190440,
247790,
354314,
346140,
411691,
436290,
395340,
378956,
436307,
338005,
100454,
329853,
329857,
329868,
411806,
346273,
362661,
100525,
387250,
379067,
387261,
395467,
346317,
411862,
256214,
411865,
411869,
411874,
379108,
411877,
387303,
346344,
395496,
338154,
387307,
338161,
387314,
436474,
321787,
379135,
411905,
411917,
43279,
379154,
395539,
387350,
387353,
338201,
182559,
338212,
395567,
248112,
264502,
362823,
436556,
190797,
321880,
362844,
379234,
354674,
182642,
321911,
420237,
379279,
272787,
354728,
338353,
338382,
272849,
338387,
256474,
182755,
338404,
338411,
248309,
199165,
248332,
330254,
199189,
420377,
330268,
191012,
330320,
199250,
191069,
346722,
248427,
191085,
338544,
346736,
191093,
346743,
330384,
346769,
354975,
150184,
174775,
248505,
174778,
363198,
223936,
273109,
355029,
264919,
183006,
338661,
338665,
264942,
330479,
363252,
338680,
207620,
264965,
191240,
338701,
256787,
338712,
363294,
396067,
346917,
396070,
215854,
355123,
355141,
355144,
338764,
355151,
330581,
330585,
387929,
355167,
265056,
265059,
355176,
355180,
355185,
330612,
330643,
412600,
207809,
379849,
347082,
396246,
330711,
248794,
248799,
347106,
437219,
257009,
265208,
330750,
265215,
199681,
338951,
330761,
379915,
330769,
330775,
248863,
158759,
396329,
347178,
404526,
396337,
330803,
396340,
339002,
388155,
339010,
347208,
248905,
330827,
248915,
183384,
339037,
412765,
257121,
322660,
265321,
248952,
420985,
330886,
330890,
347288,
248986,
44199,
380071,
339118,
249018,
339133,
126148,
322763,
330959,
330966,
265433,
265438,
388320,
363757,
388348,
339199,
396552,
175376,
175397,
208167,
273709,
372016,
437553,
347442,
199989,
175416,
396601,
208189,
437567,
175425,
437571,
126279,
437576,
437584,
331089,
437588,
331094,
396634,
175451,
437596,
429408,
175458,
208228,
175461,
175464,
265581,
175478,
249210,
175484,
175487,
249215,
175491,
249219,
249225,
249228,
249235,
175514,
175517,
396703,
396706,
175523,
355749,
380333,
396723,
388543,
380353,
380364,
339406,
372177,
208338,
339414,
249303,
413143,
339418,
339421,
249310,
339425,
249313,
339429,
339435,
249329,
69114,
372229,
339464,
249355,
208399,
175637,
405017,
134689,
339504,
265779,
421442,
413251,
265796,
396874,
265806,
224854,
224858,
339553,
257636,
224871,
372328,
257647,
372338,
224885,
224888,
224891,
224895,
372354,
126597,
421509,
224905,
11919,
224911,
159375,
224914,
224917,
224920,
126618,
208539,
224923,
224927,
224930,
224933,
257705,
224939,
224943,
257713,
224949,
257717,
257721,
224954,
257725,
224960,
257733,
224966,
224970,
257740,
224976,
257745,
339664,
257748,
224982,
257752,
224987,
257762,
224996,
225000,
339696,
225013,
257788,
225021,
339711,
257791,
372481,
225027,
257796,
339722,
257802,
257805,
225039,
257808,
249617,
225044,
167701,
372500,
257815,
225049,
257820,
225054,
184096,
397089,
257825,
225059,
339748,
257834,
225068,
257837,
413485,
225071,
225074,
257843,
225077,
257846,
372533,
225080,
397113,
225083,
397116,
257853,
225088,
225094,
225097,
257869,
257872,
225105,
397140,
225109,
225113,
257884,
257887,
225120,
257891,
413539,
225128,
257897,
274281,
339818,
257902,
225138,
339827,
257909,
225142,
372598,
257914,
257917,
225150,
257922,
380803,
225156,
339845,
257927,
225166,
397201,
225171,
380823,
225176,
225183,
372665,
372698,
372704,
372707,
356336,
380919,
393215,
372739,
405534,
266295,
266298,
217158,
421961,
356440,
217180,
430181,
266351,
356467,
266365,
192640,
266375,
381069,
225425,
250003,
225430,
356507,
225439,
135328,
192674,
225442,
438434,
225445,
438438,
225448,
438441,
356521,
225451,
258223,
225456,
430257,
225459,
225462,
225468,
389309,
225472,
372931,
225476,
430275,
389322,
225485,
225488,
225491,
266454,
225494,
225497,
225500,
225503,
225506,
356580,
225511,
217319,
225515,
225519,
372977,
381177,
397572,
389381,
381212,
258333,
356638,
356641,
356644,
356647,
266537,
389417,
356650,
356656,
332081,
307507,
340276,
356662,
397623,
332091,
225599,
332098,
201030,
348489,
332107,
151884,
430422,
348503,
332118,
250201,
332126,
332130,
250211,
340328,
250217,
348523,
348528,
332153,
356734,
389503,
438657,
332162,
389507,
348548,
356741,
332175,
373146,
340380,
373149,
373169,
266688,
324032,
201158,
127473,
217590,
340473,
324095,
324100,
266757,
324103,
324112,
340501,
324118,
324122,
332325,
324134,
381483,
356908,
324141,
324143,
356917,
324150,
324156,
168509,
348734,
324161,
324165,
356935,
348745,
381513,
324171,
324174,
324177,
389724,
332381,
373344,
340580,
381546,
340628,
184983,
373399,
340639,
258723,
332455,
332460,
389806,
332464,
332473,
381626,
332484,
332487,
373450,
332494,
357070,
357074,
332512,
332521,
340724,
332534,
348926,
389927,
348979,
152371,
348983,
398141,
127815,
357202,
389971,
357208,
136024,
389979,
430940,
357212,
357215,
439138,
349041,
340850,
381815,
430967,
324473,
398202,
340859,
324476,
430973,
119675,
324479,
340863,
324482,
373635,
324485,
324488,
185226,
381834,
324493,
324496,
324499,
430996,
324511,
422817,
324514,
201638,
398246,
373672,
324525,
5040,
111539,
324534,
5047,
324539,
324542,
398280,
349129,
340940,
340942,
209874,
340958,
431073,
398307,
340964,
209896,
201712,
209904,
349173,
381947,
201724,
349181,
431100,
431107,
349203,
209944,
209948,
250915,
357411,
250917,
357419,
209966,
209969,
209973,
209976,
209980,
209988,
209991,
431180,
209996,
341072,
349268,
250968,
210011,
373853,
341094,
210026,
210028,
210032,
349296,
210037,
210042,
210045,
349309,
152704,
349313,
160896,
210053,
210056,
259217,
373905,
210068,
210072,
210078,
210081,
210085,
251045,
185512,
210089,
210096,
210100,
324792,
210108,
357571,
210116,
210128,
333010,
210132,
333016,
210139,
210144,
218355,
218361,
275709,
275713,
242947,
275717,
275723,
333075,
349460,
333079,
349486,
349492,
415034,
251211,
357710,
210261,
365912,
259423,
374113,
251236,
374118,
333164,
234867,
390518,
136591,
374161,
112021,
349591,
357793,
333222,
259516,
415168,
366035,
415187,
366039,
415192,
415194,
415197,
415200,
423393,
333285,
415208,
366057,
366064,
415217,
415225,
423424,
415258,
415264,
366118,
415271,
382503,
349739,
144940,
415279,
415282,
349748,
415286,
210488,
415291,
415295,
349762,
415301,
333387,
333396,
374359,
333400,
366173,
423529,
423533,
333423,
210547,
415354,
333440,
267910,
267929,
333472,
333499,
210632,
259789,
358100,
366301,
333535,
153311,
366308,
431852,
399086,
366319,
210673,
366322,
399092,
366326,
333566,
210696,
268042,
210700,
366349,
210707,
399129,
333595,
210720,
366384,
358192,
210740,
366388,
358201,
325441,
366403,
325447,
341831,
341835,
341839,
341844,
415574,
358235,
341852,
350046,
399200,
399208,
268144,
358256,
358260,
341877,
399222,
325494,
333690,
243584,
325505,
333699,
399244,
333709,
333725,
382891,
382898,
350153,
358348,
333777,
219094,
399318,
358372,
350190,
350194,
333819,
350204,
350207,
325633,
325637,
350214,
219144,
268299,
333838,
350225,
186388,
350232,
333851,
350238,
350241,
374819,
350245,
350249,
350252,
178221,
350257,
350260,
350272,
243782,
350281,
350286,
374865,
342113,
252021,
342134,
374904,
268435,
333998,
334012,
260299,
211161,
334047,
375027,
358645,
325895,
268553,
194829,
268560,
432406,
325918,
325920,
194854,
358701,
391469,
358705,
358714,
358717,
383307,
358738,
334162,
383323,
383331,
383334,
391531,
383342,
334204,
268669,
194942,
391564,
366991,
334224,
383375,
268702,
342431,
416159,
375209,
326059,
375220,
334263,
326087,
358857,
195041,
334312,
104940,
375279,
162289,
416255,
350724,
391691,
186898,
342546,
350740,
342551,
342555,
334364,
358942,
416294,
350762,
252463,
358962,
334386,
334397,
358973,
252483,
219719,
399957,
334425,
326240,
375401,
268922,
334466,
334469,
162446,
326291,
342680,
342685,
260767,
342711,
244410,
260798,
334530,
260802,
350918,
154318,
391895,
154329,
416476,
113389,
342769,
203508,
375541,
342777,
391938,
391949,
375569,
326417,
375572,
375575,
375580,
162592,
334633,
326444,
383794,
326452,
326455,
375613,
244542,
326463,
375616,
326468,
244552,
342857,
326474,
326479,
326486,
416599,
342875,
244572,
326494,
326503,
433001,
375657,
326508,
400238,
326511,
211826,
211832,
392061,
351102,
359296,
252801,
260993,
351105,
400260,
211846,
342921,
236432,
342931,
252823,
400279,
392092,
400286,
252838,
359335,
211885,
252846,
400307,
351169,
359362,
170950,
187335,
326599,
359367,
359383,
359389,
383968,
343018,
359411,
261109,
261112,
383999,
261130,
326669,
261148,
359452,
211999,
261155,
261160,
261166,
359471,
375868,
343132,
384099,
384102,
384108,
367724,
187503,
326767,
343155,
384115,
212095,
343168,
351366,
384136,
384140,
384144,
351382,
384152,
384158,
384161,
351399,
384169,
367795,
384182,
367801,
384189,
384192,
351424,
367817,
244938,
384202,
253132,
326858,
343246,
384209,
146644,
351450,
384225,
359650,
343272,
351467,
359660,
384247,
351480,
384250,
351483,
351492,
343307,
384270,
359695,
261391,
253202,
261395,
384276,
384284,
245021,
384290,
253218,
245032,
171304,
384299,
351535,
245042,
326970,
384324,
343366,
212296,
212304,
367966,
343394,
367981,
343410,
155000,
245128,
253321,
155021,
384398,
245137,
245143,
245146,
245149,
343453,
245152,
245155,
155045,
245158,
40358,
245163,
114093,
343478,
359867,
384444,
327112,
384457,
327116,
327118,
359887,
359891,
343509,
368093,
155103,
343535,
343540,
368120,
343545,
409092,
253445,
359948,
359951,
359984,
343610,
343631,
400977,
400982,
179803,
245358,
138865,
155255,
155274,
368289,
245410,
425639,
425652,
155323,
425663,
155328,
245463,
155352,
155356,
155364,
155372,
245487,
212723,
245495,
409336,
155394,
155404,
245528,
155423,
360224,
155439,
204592,
155444,
155448,
417596,
384829,
384831,
360262,
155463,
155477,
376665,
155484,
261982,
425823,
155488,
376672,
155492,
327532,
261997,
376686,
262000,
262003,
425846,
262006,
147319,
262009,
327542,
262012,
155517,
155523,
155526,
360327,
376715,
155532,
262028,
262031,
262034,
262037,
262040,
262043,
155550,
253854,
262046,
262049,
262052,
327590,
155560,
155563,
155566,
327613,
393152,
311244,
393170,
155604,
155620,
253924,
155622,
253927,
360432,
204785,
393204,
360439,
253944,
393209,
155647
] |
e440646b1e171d01244f314ba9483615ce5bc4cb
|
52266504fcb8336f5b49d1ba0c6bcf620f67cf54
|
/The Lazy SlothTests/The_Lazy_SlothTests.swift
|
1a912e3bf5240c89e0fd83d3d14478ba4f7b1538
|
[] |
no_license
|
DovahSeb/Lazy-Sloth
|
5ba0327c71e25dcc0a4b8d1c9af30cf0b5ba3818
|
53313482eea9031f91282ea7b313097902bfebbe
|
refs/heads/master
| 2020-06-19T04:15:36.923991 | 2019-07-12T10:26:04 | 2019-07-12T10:26:04 | 196,558,490 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 936 |
swift
|
//
// The_Lazy_SlothTests.swift
// The Lazy SlothTests
//
// Created by Sebastien Larue on 26/02/2019.
// Copyright © 2019 KangaGames. All rights reserved.
//
import XCTest
@testable import The_Lazy_Sloth
class The_Lazy_SlothTests: XCTestCase {
override func setUp() {
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}
func testExample() {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
func testPerformanceExample() {
// This is an example of a performance test case.
self.measure {
// Put the code you want to measure the time of here.
}
}
}
|
[
360462,
229413,
204840,
344107,
155694,
229424,
229430,
163896,
180280,
376894,
352326,
254027,
163917,
196691,
385116,
237663,
254048,
319591,
221290,
204916,
131191,
131198,
278677,
196760,
426138,
278691,
377009,
278708,
180408,
295098,
139479,
229597,
311519,
205035,
327929,
344313,
147717,
368905,
254226,
319763,
368916,
262421,
377114,
237856,
237857,
311597,
98610,
180535,
336183,
287041,
319813,
319821,
344401,
377169,
368981,
155990,
368984,
106847,
98657,
270701,
246127,
270706,
246136,
246137,
139640,
311681,
311685,
106888,
385417,
311691,
385422,
213403,
246178,
385454,
311727,
377264,
319930,
311738,
33211,
336320,
311745,
254406,
188871,
278993,
278999,
328152,
369116,
287198,
279018,
319981,
319987,
279029,
254456,
377338,
279039,
377343,
254465,
279050,
139792,
303636,
393751,
279065,
377376,
377386,
197167,
385588,
115270,
385615,
426576,
369235,
295519,
139872,
66150,
139892,
287352,
344696,
311941,
336518,
311945,
369289,
344715,
311949,
287374,
377489,
311954,
352917,
230040,
271000,
377497,
303771,
377500,
205471,
344738,
139939,
295599,
205487,
303793,
336564,
230072,
287417,
287422,
377539,
164560,
385747,
361176,
418520,
287452,
279269,
246503,
369385,
312052,
172792,
344827,
221948,
205568,
295682,
197386,
434957,
312079,
426774,
197399,
426775,
197411,
295724,
353069,
197422,
353070,
164656,
295729,
197431,
336702,
279362,
353095,
353109,
377686,
230234,
189275,
435039,
295776,
303972,
385893,
246641,
246643,
295798,
246648,
361337,
254850,
369538,
58253,
295824,
140204,
377772,
304051,
230332,
377790,
353215,
353216,
213957,
345033,
279498,
386006,
418776,
50143,
123881,
320494,
271350,
295927,
320507,
328700,
328706,
410627,
320516,
295942,
386056,
353290,
377869,
238610,
418837,
140310,
320536,
369701,
238639,
312373,
238651,
377926,
238664,
156765,
304222,
173166,
377972,
353397,
337017,
377983,
402565,
386189,
296086,
238743,
296092,
238765,
238769,
402613,
230588,
353479,
353482,
402634,
189653,
419029,
148696,
296153,
304351,
222440,
328940,
353523,
386294,
386301,
320770,
386306,
312587,
328971,
353551,
320796,
222494,
353584,
345396,
386359,
345402,
378172,
279875,
345415,
312648,
337225,
304456,
230729,
238927,
353616,
378209,
386412,
296307,
116084,
337281,
148867,
296329,
296335,
9619,
370071,
173491,
304564,
353719,
361927,
296392,
280010,
280013,
239068,
280032,
271843,
329197,
329200,
296433,
321009,
288249,
230921,
329225,
296461,
304656,
329232,
370197,
402985,
394794,
312880,
288309,
312889,
280130,
124485,
288327,
239198,
99938,
312940,
222832,
247416,
288378,
337534,
337535,
263809,
288392,
239250,
419478,
206504,
321199,
337591,
280251,
403148,
9936,
313041,
9937,
370388,
272085,
345814,
18138,
345821,
321247,
321249,
345833,
345834,
280300,
239341,
67315,
173814,
124669,
288512,
288516,
280327,
321302,
345879,
321310,
255776,
247590,
362283,
378668,
296755,
321337,
345919,
436031,
403267,
345929,
18262,
362327,
280410,
345951,
362337,
345955,
296806,
280430,
214895,
313199,
362352,
182144,
305026,
329622,
337815,
436131,
436137,
362417,
124852,
362431,
280514,
214984,
321480,
362443,
329695,
436191,
313319,
296941,
436205,
329712,
43014,
354316,
313357,
239650,
354343,
354345,
223274,
124975,
346162,
124984,
288828,
436285,
288833,
288834,
436292,
403525,
313416,
436301,
354385,
338001,
338003,
280661,
329814,
354393,
280675,
329829,
280677,
43110,
321637,
436329,
288879,
288889,
215164,
313469,
215166,
280712,
346271,
436383,
362659,
239793,
125109,
182456,
280762,
379071,
280768,
149703,
346314,
321745,
387296,
280802,
379106,
346346,
321772,
436470,
125183,
149760,
411906,
125188,
313608,
125193,
272658,
125203,
338197,
125208,
125217,
338218,
321840,
379186,
125235,
125240,
321860,
280902,
289110,
215385,
354655,
354676,
436608,
362881,
248194,
240002,
436611,
240016,
108944,
190871,
149916,
420253,
141728,
289189,
108972,
272813,
338356,
436661,
289232,
256477,
281072,
174593,
240131,
420369,
207393,
289332,
174648,
338489,
338490,
297560,
436832,
436834,
420463,
346737,
313971,
346740,
420471,
330379,
117396,
346772,
264856,
289434,
346779,
166582,
314040,
363211,
363230,
264928,
330474,
289518,
322291,
191235,
322316,
117517,
322319,
166676,
207640,
281377,
289576,
191283,
273207,
289598,
322395,
330609,
207732,
158593,
240518,
224145,
355217,
256922,
289690,
240544,
289698,
420773,
289703,
363438,
347055,
289727,
273344,
330689,
363458,
379844,
19399,
248796,
347103,
412651,
183279,
347123,
240630,
257024,
330754,
134150,
330763,
322582,
248872,
322612,
314448,
339030,
257125,
273515,
404593,
363641,
363644,
150657,
248961,
330888,
363669,
339100,
380061,
339102,
199839,
429214,
265379,
249002,
306346,
3246,
421048,
339130,
208058,
322749,
265412,
290000,
298208,
298212,
298213,
290022,
330984,
298221,
298228,
388349,
437505,
322824,
257305,
339234,
208164,
372009,
412971,
306494,
216386,
224586,
372043,
331090,
314710,
372054,
159066,
314720,
314726,
380271,
249204,
249205,
208244,
290173,
306559,
224640,
314751,
314758,
298374,
314760,
142729,
388487,
314766,
306579,
282007,
290207,
314783,
314789,
282022,
314791,
396711,
396712,
314798,
380337,
380338,
150965,
380357,
339398,
306639,
413137,
429542,
191981,
282096,
306673,
191990,
372227,
323080,
323087,
323089,
175639,
388632,
396827,
282141,
134686,
347694,
265798,
282183,
265804,
396882,
44635,
396895,
323172,
323178,
224883,
314998,
323196,
175741,
339584,
282245,
323207,
323217,
282271,
282276,
298661,
282280,
298667,
61101,
224946,
110268,
224958,
323263,
274115,
306890,
241361,
241365,
298720,
323331,
323332,
339715,
216839,
339720,
372496,
323346,
241441,
339745,
257830,
421672,
315202,
216918,
241495,
241528,
315264,
339841,
282504,
315273,
315274,
372626,
380821,
298909,
118685,
200627,
323507,
290745,
274371,
151497,
372701,
298980,
380908,
282612,
315432,
315434,
102445,
233517,
176175,
241716,
241720,
225351,
315465,
315476,
307289,
315487,
356447,
315497,
315498,
438377,
233589,
266357,
422019,
241808,
323729,
381073,
299174,
405687,
258239,
389313,
299203,
299209,
372941,
282831,
266449,
307435,
438511,
381172,
184575,
381208,
151839,
233762,
217380,
282919,
151847,
332083,
332085,
332089,
438596,
332101,
323913,
348492,
323920,
348500,
168281,
332123,
332127,
242023,
160110,
242033,
291192,
340357,
225670,
332167,
242058,
373134,
291224,
242078,
315810,
315811,
381347,
340398,
127427,
324039,
373197,
160225,
242148,
291311,
291333,
340490,
283153,
258581,
234036,
315960,
348732,
242237,
70209,
348742,
70215,
348749,
381517,
332378,
201308,
242273,
242277,
111208,
184940,
373358,
389745,
209530,
373375,
152195,
348806,
184973,
316049,
111253,
316053,
111258,
111259,
332446,
176808,
299699,
422596,
422599,
291530,
225995,
242386,
422617,
422626,
234217,
299759,
299776,
291585,
430849,
291592,
62220,
422673,
430865,
291604,
422680,
283419,
152365,
422703,
422709,
152374,
160571,
430910,
160575,
160580,
381773,
201551,
242529,
349026,
357218,
201577,
308076,
242541,
177019,
185211,
308092,
398206,
291712,
381829,
316298,
308112,
349072,
390045,
185250,
185254,
373687,
373706,
316364,
324586,
316405,
349175,
201720,
127992,
357379,
308243,
357414,
300084,
308287,
218186,
341073,
439384,
300135,
300136,
316520,
316526,
357486,
144496,
300150,
291959,
300151,
160891,
300158,
349316,
349318,
373903,
169104,
177296,
185493,
324760,
119962,
300187,
300188,
300201,
300202,
373945,
259268,
283852,
283853,
259280,
333011,
316627,
234742,
128251,
439562,
292107,
414990,
251153,
177428,
349462,
382258,
300343,
382269,
177484,
406861,
259406,
234831,
283991,
374109,
333160,
243056,
316787,
357762,
112017,
234898,
259475,
275859,
357786,
251298,
333220,
316842,
374191,
292292,
300487,
300489,
210390,
210391,
210393,
144867,
54765,
251378,
308723,
333300,
333303,
300536,
259599,
316946,
308756,
398869,
374296,
374299,
308764,
333343,
431649,
169518,
431663,
194110,
349763,
218696,
292425,
128587,
333388,
333393,
128599,
333408,
300644,
415338,
243307,
54893,
325231,
333430,
325245,
235135,
194180,
415375,
153251,
300714,
210603,
415420,
333503,
333509,
259781,
333517,
333520,
333523,
325346,
333542,
153319,
325352,
284401,
325371,
243472,
366360,
325404,
399147,
431916,
300848,
259899,
325439,
153415,
341836,
415567,
325457,
317269,
341847,
350044,
128862,
292712,
423789,
292720,
325492,
276341,
341879,
317304,
333688,
112509,
325503,
55167,
333701,
243591,
317323,
325515,
325518,
333722,
350109,
292771,
333735,
415655,
284587,
292782,
243637,
301008,
153554,
292836,
292837,
317415,
325619,
432116,
333817,
292858,
415741,
333828,
358410,
399373,
317467,
145435,
325674,
309295,
129076,
243767,
358456,
325694,
227428,
194666,
260207,
432240,
333940,
292988,
194691,
415881,
104587,
235662,
284826,
333991,
333996,
334042,
194782,
301279,
317664,
243962,
375039,
194820,
325905,
325912,
309529,
211235,
432421,
211238,
325931,
358703,
358709,
325968,
366930,
6489,
383332,
383336,
317820,
211326,
317831,
252308,
293274,
121245,
342450,
293303,
293310,
416197,
129483,
342476,
358882,
342498,
334309,
391655,
432618,
375276,
301571,
342536,
416286,
375333,
244269,
375343,
23092,
375351,
244281,
301638,
309830,
293448,
55881,
416341,
309846,
416351,
268899,
244327,
39530,
244347,
326287,
375440,
334481,
318106,
318107,
342682,
318130,
383667,
293556,
39614,
334547,
318173,
375526,
342762,
342763,
293612,
129773,
154359,
228088,
432893,
162561,
383754,
310036,
285466,
326429,
293664,
326433,
400166,
293672,
318250,
318252,
375609,
293693,
342847,
252741,
293711,
244568,
244570,
351077,
342887,
228215,
269178,
400252,
359298,
359299,
260996,
113542,
392074,
56208,
326553,
318364,
310176,
310178,
293800,
236461,
326581,
326587,
326601,
359381,
433115,
343005,
326635,
187374,
383983,
318461,
293886,
293893,
433165,
384016,
433174,
252958,
203830,
359478,
277597,
113760,
392290,
253029,
285798,
15471,
351344,
285814,
285820,
392318,
384131,
302216,
326804,
187544,
351390,
253099,
253100,
318639,
367799,
113850,
294074,
302274,
367810,
244940,
195808,
310497,
302325,
228600,
228609,
261377,
245019,
253216,
130338,
261425,
351537,
171317,
318775,
286013,
146762,
294218,
294219,
318805,
425304,
163175,
327024,
327025,
318848,
179587,
253317,
384393,
368011,
318864,
318868,
212375,
318875,
212382,
310692,
245161,
286129,
286132,
228795,
425405,
302531,
425418,
310748,
286172,
187878,
245223,
343542,
286202,
359930,
302590,
253451,
359950,
146964,
253463,
286244,
245287,
245292,
196164,
286288,
179801,
196187,
343647,
310889,
204397,
138863,
188016,
294529,
229001,
188048,
425626,
302754,
229029,
40614,
384695,
319162,
327358,
286399,
212685,
384720,
302802,
278233,
278240,
212716,
212717,
360177,
229113,
278272,
319233,
360195,
286494,
294700,
409394,
319288,
319292,
360252,
360264,
376669,
245599,
425825,
425833,
417654,
188292,
294807,
376732,
311199,
319392,
294823,
327596,
294843,
188348,
237504,
294850,
384964,
344013,
212942,
24532,
294886,
327661,
311281,
311282
] |
87b6bed85690691415e595179766f73212b52bec
|
96d5db87536b796aab478b06900c3ec77c7daa30
|
/CoVID-19 Companion/Views/Extention/UIViewExtention.swift
|
56a6c00aba116ab8a0ea7e69f95c2c4d7dc89811
|
[] |
no_license
|
oluwatobiHammed/CoVID-19-Companion
|
3f18cc8a8d9fa50617195db74e5ac87305f393e7
|
ef3157f5bc0a0b4336f10065ad2704667c5e8330
|
refs/heads/master
| 2022-11-18T11:19:45.529987 | 2020-07-21T22:58:18 | 2020-07-21T22:58:18 | 270,944,420 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 772 |
swift
|
//
// UIViewExtention.swift
// CoVID-19 Companion
//
// Created by Oladipupo Oluwatobi on 10/07/2020.
// Copyright © 2020 Oladipupo Oluwatobi. All rights reserved.
//
import UIKit
extension UIView {
func addTapGesture(action: @escaping () -> Void ){
let tap = UIViewTapGestureRecognizer(target: self , action: #selector(self.handleTap(_:)))
tap.action = action
tap.numberOfTapsRequired = 1
self.addGestureRecognizer(tap)
self.isUserInteractionEnabled = true
}
@objc func handleTap(_ sender: UIViewTapGestureRecognizer) {
sender.action!()
}
}
//MARK: - Custom UIViewTapGestureRecognizer
class UIViewTapGestureRecognizer: UITapGestureRecognizer {
var action : (()->Void)? = nil
}
|
[
-1
] |
e4d5a316247defc2a201c7676cd877cec2efb629
|
1c190185d2ba5d2d8d702b03dc0aaea9614d6843
|
/Hamba/View Controllers/RP2ViewController.swift
|
9d8298fd59bb073d181ce01c007239b931075cf7
|
[] |
no_license
|
DanialRana3/HambaIOS
|
9999db8bb5c7b9702a8a6dc4ebeb305ce6f1c337
|
6bc18abbc88f5dbf8787e06a2d6e3be728b79b0c
|
refs/heads/master
| 2020-06-14T18:52:41.531785 | 2019-07-10T16:25:21 | 2019-07-10T16:25:21 | 195,093,099 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 3,888 |
swift
|
//
// RP2ViewController.swift
// Hamba
//
// Created by Hexagonal3 on 08/06/2019.
// Copyright © 2019 Hexagonal3. All rights reserved.
//
import UIKit
class RP2ViewController: XBViewController {
@IBOutlet weak var sendMeAgain: UIButton!
@IBOutlet weak var codeView: UIView!
@IBOutlet weak var codeTF: UITextField!
@IBOutlet weak var NewPassView: UIView!
@IBOutlet weak var NewPassTF: UITextField!
@IBOutlet weak var ConfirmPassView: UIView!
@IBOutlet weak var ConfirmPassTF: UITextField!
@IBOutlet weak var ResetPassButton: UIButton!
var userID = ""
@IBOutlet weak var code_errorLbl: UILabel!
@IBOutlet weak var password_errorLbl: UILabel!
@IBOutlet weak var confirmPass_errorLbl: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
codeView.setCurverBorderView(borderColor: Colors.bussiness_type_dark_green, size: 20)
codeTF.setPlaceholder(color: Colors.bussiness_type_dark_green, string: "Enter your four digit code")
NewPassView.setCurverBorderView(borderColor: Colors.bussiness_type_dark_green, size: 20)
NewPassTF.setPlaceholder(color: Colors.bussiness_type_dark_green, string: "New Password")
ConfirmPassView.setCurverBorderView(borderColor: Colors.bussiness_type_dark_green, size: 20)
ConfirmPassTF.setPlaceholder(color: Colors.bussiness_type_dark_green, string: "Confirm Password")
ResetPassButton.setCurveBorderButton(color: .clear, size: 20)
self.code_errorLbl.text = ""
self.password_errorLbl.text = ""
self.confirmPass_errorLbl.text = ""
}
func validateData()->Bool{
var isValid:Bool = true
self.code_errorLbl.text = ""
self.password_errorLbl.text = ""
self.confirmPass_errorLbl.text = ""
if self.codeTF.text?.count != 6{
code_errorLbl.text = "Verification code must be 6 digits"
isValid = false
}else if self.NewPassTF.text!.count < 7{
password_errorLbl.text = "Pasword must be greater or equal 6 digits"
isValid = false
}else if self.NewPassTF.text != self.ConfirmPassTF.text{
confirmPass_errorLbl.text = "Confirm Pasword is not same"
isValid = false
}
return isValid
}
@IBAction func didTappedRP(_ sender: UIButton){
if !self.validateData() {
return
}
self.startActivityIndicator(withMsg: "Resetting Password")
ApiManager.shared().resetPassword(userID: self.userID, password: self.NewPassTF.text!, code: self.codeTF.text!, completionHandler: { (status, Msg, Data) in
let tempResp :BaseResponse = Data as! BaseResponse
self.stopActivityIndicator()
if(tempResp.error == "0"){
self.showBannerAlert_Success(title: "Password Reset", body: tempResp.message)
let rootVC:RP3ViewController = self.storyboard?.instantiateViewController(withIdentifier: "RP3ViewController") as! RP3ViewController
UIApplication.shared.keyWindow?.rootViewController = rootVC
}else{
self.showBannerAlert_Error(title: "Password Reset", body: tempResp.message)
}
})
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/
}
|
[
-1
] |
6d137014c955b7822dca7dfe7cd444c0f7dcbfd3
|
2320ebcc56363a5715d9ecac6687a05646feb424
|
/Sources/Cryptor/Status.swift
|
50a8c916ec95a0fdb5a793b63b1a7a9faf5739e0
|
[
"Apache-2.0"
] |
permissive
|
KyeMaloy97/BlueCryptor
|
6675f6d36098eab6061679b090ee09d1b841ad3c
|
4503221a71d49c6075b5042f5ff2d858acbe74a8
|
refs/heads/master
| 2020-03-21T12:57:45.279242 | 2018-06-07T15:08:20 | 2018-06-07T15:08:20 | 138,580,558 | 0 | 0 |
Apache-2.0
| 2018-06-25T10:37:15 | 2018-06-25T10:37:14 | null |
UTF-8
|
Swift
| false | false | 6,088 |
swift
|
//
// Status.swift
// Cryptor
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
import Foundation
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
import CommonCrypto
#elseif os(Linux)
import OpenSSL
#endif
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
///
/// Links the native CommonCryptoStatus enumeration to Swift versions.
///
public enum Status: CCCryptorStatus, Swift.Error, CustomStringConvertible {
/// Successful
case success
/// Parameter Error
case paramError
/// Buffer too Small
case bufferTooSmall
/// Memory Failure
case memoryFailure
/// Alignment Error
case alignmentError
/// Decode Error
case decodeError
/// Unimplemented
case unimplemented
/// Overflow
case overflow
/// Random Number Generator Err
case rngFailure
///
/// Converts this value to a native `CCCryptorStatus` value.
///
public func toRaw() -> CCCryptorStatus {
switch self {
case .success:
return CCCryptorStatus(kCCSuccess)
case .paramError:
return CCCryptorStatus(kCCParamError)
case .bufferTooSmall:
return CCCryptorStatus(kCCBufferTooSmall)
case .memoryFailure:
return CCCryptorStatus(kCCMemoryFailure)
case .alignmentError:
return CCCryptorStatus(kCCAlignmentError)
case .decodeError:
return CCCryptorStatus(kCCDecodeError)
case .unimplemented:
return CCCryptorStatus(kCCUnimplemented)
case .overflow:
return CCCryptorStatus(kCCOverflow)
case .rngFailure:
return CCCryptorStatus(kCCRNGFailure)
}
}
///
/// Human readable descriptions of the values. (Not needed in Swift 2.0?)
///
static let descriptions = [
success: "Success",
paramError: "ParamError",
bufferTooSmall: "BufferTooSmall",
memoryFailure: "MemoryFailure",
alignmentError: "AlignmentError",
decodeError: "DecodeError",
unimplemented: "Unimplemented",
overflow: "Overflow",
rngFailure: "RNGFailure"
]
///
/// Obtain human-readable string from enum value.
///
public var description: String {
return (Status.descriptions[self] != nil) ? Status.descriptions[self]! : ""
}
///
/// Create enum value from raw `CCCryptorStatus` value.
///
public static func fromRaw(status: CCCryptorStatus) -> Status? {
var from = [
kCCSuccess: success,
kCCParamError: paramError,
kCCBufferTooSmall: bufferTooSmall,
kCCMemoryFailure: memoryFailure,
kCCAlignmentError: alignmentError,
kCCDecodeError: decodeError,
kCCUnimplemented: unimplemented,
kCCOverflow: overflow,
kCCRNGFailure: rngFailure
]
return from[Int(status)]
}
}
#elseif os(Linux)
///
/// Error status
///
public enum Status: Swift.Error, CustomStringConvertible {
/// Success
case success
/// Unimplemented with reason
case unimplemented(String)
/// Not supported with reason
case notSupported(String)
/// Parameter Error
case paramError
/// Failure with error code
case fail(UInt)
/// Random Byte Generator Failure with error code
case rngFailure(UInt)
/// The error code itself
public var code: Int {
switch self {
case .success:
return 0
case .notSupported:
return -1
case .unimplemented:
return -2
case .paramError:
return -3
case .fail(let code):
return Int(code)
case .rngFailure(let code):
return Int(code)
}
}
///
/// Create enum value from raw `SSL error code` value.
///
public static func fromRaw(status: UInt) -> Status? {
return Status.fail(status)
}
///
/// Obtain human-readable string for the error code.
///
public var description: String {
switch self {
case .success:
return "No error"
case .notSupported(let reason):
return "Not supported: \(reason)"
case .unimplemented(let reason):
return "Not implemented: \(reason)"
case .paramError:
return "Invalid parameters passed"
case .fail(let errorCode):
return "ERROR: code: \(errorCode), reason: \(ERR_error_string(UInt(errorCode), nil))"
case .rngFailure(let errorCode):
return "Random Byte Generator ERROR: code: \(errorCode), reason: \(ERR_error_string(UInt(errorCode), nil))"
}
}
}
// MARK: Operators
func == (lhs: Status, rhs: Status) -> Bool {
return lhs.code == rhs.code
}
func != (lhs: Status, rhs: Status) -> Bool {
return lhs.code != rhs.code
}
#endif
///
/// CryptorError
/// Thrown in caaes where a _fatalError()_ is **NOT** appropriate.
///
public enum CryptorError: Swift.Error, CustomStringConvertible {
/// Success
case success
/// Invalid key size
case invalidKeySize
/// Invalid IV size
case invalidIVSizeOrLength
/// Fail with code and string
case fail(Int32, String)
/// The error code itself
public var errCode: Int32 {
switch self {
case .success:
return 0
case .invalidKeySize:
return -1
case .invalidIVSizeOrLength:
return -2
case .fail(let errCode, _):
return Int32(errCode)
}
}
/// Error Description
public var description: String {
switch self {
case .success:
return "Success"
case .invalidKeySize:
return "Invalid key size."
case .invalidIVSizeOrLength:
return "Invalid IV size or length."
case .fail(let (_, reason)):
return reason
}
}
}
|
[
342259
] |
9026c797a609b434329a7ae666c2d42dc19edf5d
|
618882a89dc1959d9ffda85c8f54a169083a2432
|
/Projet_12/Series/Controller/SerieDetailsViewController.swift
|
c9b66d6aa87f1f3ecde9e2aefd2048b667e40d26
|
[] |
no_license
|
leo33ncls/Projet_12
|
71dc707601db6fe03a20986216f3da5a4f3dfdbe
|
899db11d4433b707785ec7b361db66cd2ee06ea8
|
refs/heads/master
| 2020-12-15T15:57:32.866854 | 2020-06-08T21:41:06 | 2020-06-08T21:41:06 | 235,165,373 | 0 | 0 | null | 2020-03-29T16:38:34 | 2020-01-20T18:07:17 |
Swift
|
UTF-8
|
Swift
| false | false | 8,090 |
swift
|
//
// SerieDetailsViewController.swift
// Projet_12
//
// Created by Léo NICOLAS on 19/02/2020.
// Copyright © 2020 Léo NICOLAS. All rights reserved.
//
import UIKit
import FirebaseAuth
// View Controller that displays details of a serie.
class SerieDetailsViewController: UITableViewController {
// MARK: - View Outlet
@IBOutlet weak var favoriteButton: UIBarButtonItem!
// MARK: - View Properties
// The serie received from SeriesVC, SearchVC or FavoriteSerieVC.
var serie: Serie?
let segueToEvaluationIdentifier = "segueToEvaluationVC"
let segueToForumIdentifier = "segueToForumVC"
// ========================
// MARK: - View Cycles
override func viewDidLoad() {
super.viewDidLoad()
tabBarController?.tabBar.isHidden = true
registerCell()
// Observe the notification sent when the evaluateButton is tapped.
let name = NSNotification.Name(rawValue: "EvaluateButtonTapped")
NotificationCenter.default.addObserver(self, selector: #selector(evaluateButtonTapped), name: name, object: nil)
tableView.reloadData()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
guard let currentSerie = serie else { return }
guard let currentUserId = Auth.auth().currentUser?.uid else { return }
// Set the color of the favoriteButton.
FavoriteSerieService.isAFavoriteSerie(userId: currentUserId, serie: currentSerie) { (success) in
if success {
self.favoriteButton.tintColor = UIColor.customOrange
} else {
self.favoriteButton.tintColor = UIColor.white
}
}
tableView.reloadData()
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
guard let currentSerie = serie else { return }
// Give the serie to the EvaluationVC or to the ForumVC.
if segue.identifier == segueToEvaluationIdentifier,
let evaluationVC = segue.destination as? EvaluationViewController {
evaluationVC.serie = currentSerie
} else if segue.identifier == segueToForumIdentifier,
let forumVC = segue.destination as? ForumViewController {
forumVC.serie = currentSerie
}
}
/// Function that performs a segue to EvaluationVC when the evaluateButton is pressed.
@objc func evaluateButtonTapped() {
performSegue(withIdentifier: segueToEvaluationIdentifier, sender: nil)
}
// ========================
// MARK: - View Functions
/// Function that registers the custom cells on the tableView.
private func registerCell() {
let imageSerieCell = UINib(nibName: "ImageSerieTableViewCell", bundle: nil)
self.tableView.register(imageSerieCell, forCellReuseIdentifier: "ImageSerieCell")
let informationCell = UINib(nibName: "InformationSerieTableViewCell", bundle: nil)
self.tableView.register(informationCell, forCellReuseIdentifier: "InformationSerieCell")
let evaluationCell = UINib(nibName: "EvaluationTableViewCell", bundle: nil)
self.tableView.register(evaluationCell, forCellReuseIdentifier: "EvaluationCell")
let synopsisCell = UINib(nibName: "SynopsisTableViewCell", bundle: nil)
self.tableView.register(synopsisCell, forCellReuseIdentifier: "SynopsisCell")
let forumCell = UINib(nibName: "ForumTableViewCell", bundle: nil)
self.tableView.register(forumCell, forCellReuseIdentifier: "ForumCell")
}
/// Function that creates and configures the ImageSerieTableViewCell.
private func configureImageSerieTVCell(tableView: UITableView, currentSerie: Serie) -> UITableViewCell {
guard let cell = tableView.dequeueReusableCell(withIdentifier: "ImageSerieCell")
as? ImageSerieTableViewCell else {
return UITableViewCell()
}
cell.setUpShadow(width: view.bounds.width)
cell.configure(serie: currentSerie)
return cell
}
/// Function that creates and configures the InformationSerieTableViewCell.
private func configureInformationSerieTVCell(tableView: UITableView, currentSerie: Serie) -> UITableViewCell {
guard let cell = tableView.dequeueReusableCell(withIdentifier: "InformationSerieCell")
as? InformationSerieTableViewCell else {
return UITableViewCell()
}
cell.configure(serie: currentSerie)
return cell
}
/// Function that creates and configures the EvaluationTableViewCell.
private func configureEvaluationTVCell(tableView: UITableView, currentSerie: Serie) -> UITableViewCell {
guard let cell = tableView.dequeueReusableCell(withIdentifier: "EvaluationCell")
as? EvaluationTableViewCell else {
return UITableViewCell()
}
cell.configure(serie: currentSerie)
return cell
}
/// Function that creates and configures the SynopsisTableViewCell.
private func configureSynopsisTVCell(tableView: UITableView, currentSerie: Serie) -> UITableViewCell {
guard let cell = tableView.dequeueReusableCell(withIdentifier: "SynopsisCell") as? SynopsisTableViewCell else {
return UITableViewCell()
}
cell.configure(serie: currentSerie)
return cell
}
/// Function that creates and configures the ForumTableViewCell.
private func configureForumTVCell(tableView: UITableView, currentSerie: Serie) -> UITableViewCell {
guard let cell = tableView.dequeueReusableCell(withIdentifier: "ForumCell") as? ForumTableViewCell else {
return UITableViewCell()
}
return cell
}
// =================
// MARK: - View Actions
// Action that saves or removes the serie in the FavoriteSerie database.
@IBAction func saveSerieAsFavorite(_ sender: UIBarButtonItem) {
guard let currentSerie = serie else { return }
guard let currentUserId = Auth.auth().currentUser?.uid else { return }
FavoriteSerieService.isAFavoriteSerie(userId: currentUserId, serie: currentSerie) { (success) in
if success {
FavoriteSerieService.removeFavoriteSerie(userId: currentUserId, serie: currentSerie)
self.favoriteButton.tintColor = UIColor.white
} else {
FavoriteSerieService.saveSerieAsFavorite(userId: currentUserId, serie: currentSerie)
self.favoriteButton.tintColor = UIColor.customOrange
}
}
}
// =================
// MARK: - TableView
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
guard let currentSerie = serie else { return UITableViewCell() }
switch indexPath.row {
case 0: return configureImageSerieTVCell(tableView: tableView, currentSerie: currentSerie)
case 1: return configureInformationSerieTVCell(tableView: tableView, currentSerie: currentSerie)
case 2: return configureEvaluationTVCell(tableView: tableView, currentSerie: currentSerie)
case 3: return configureSynopsisTVCell(tableView: tableView, currentSerie: currentSerie)
case 4: return configureForumTVCell(tableView: tableView, currentSerie: currentSerie)
default: return UITableViewCell()
}
}
override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
switch indexPath.row {
case 0: return 200
case 1: return 150
case 2: return 140
case 3:
tableView.estimatedRowHeight = 150
return UITableView.automaticDimension
case 4: return 45
default: return 150
}
}
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
// Perform a segue to ForumVC when the ForumTableViewCell is selected.
if indexPath.row == 4 {
performSegue(withIdentifier: segueToForumIdentifier, sender: nil)
}
}
}
|
[
-1
] |
3569e25f4a5b05aa1f5faea190401c54e3e25842
|
481632eb2be806141ee31159af8ac72c4b93ec00
|
/Source/Framework/VgcManager.swift
|
e84d0ff9b6e82e43dabd419b8ee3f73108a2669e
|
[
"MIT"
] |
permissive
|
ParisiLabs/VirtualGameController
|
702c7ef9957893e0d208e5fa2e8576957c13c7ac
|
7453c0f5c20404dc281d7547b23113496d2db4bc
|
refs/heads/master
| 2020-12-28T21:51:24.982584 | 2015-11-19T02:32:49 | 2015-11-19T02:32:49 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 16,826 |
swift
|
//
// VgcManager.swift
//
//
// Created by Rob Reuss on 10/8/15.
//
//
import Foundation
#if !(os(watchOS))
import GameController
#endif
#if os(iOS) || os(tvOS) // Need this only for UIDevice
import UIKit
#endif
/// The "elements" global should be considered private from the Central development side of things.
/// In that context, it provides the backing state of the software controller for
/// the various profiles, and should not be accessed directly.
///
/// On the peripheral development side, it is a key part of developing a custom software-based
/// peripheral, providing the basis for sending element values to the Central.
///
/// This variable provides a reference to an Elements object that acts as an
/// an interface to both standard and custom elements, provides a couple of methods
/// for access those sets, and provides access to individual Element instances for
/// each supported element.
///
public var customElements: CustomElementsSuperclass!
///
/// appRole:
/// The appRole value must ONLY be set by passing it as a parameter to startAs.
///
/// - parameter .Central: The consumer of the Peripheral data, typically a game.
///
/// - parameter .Peripheral: A game controller that may be a hardware controller or a
/// VGC software controller, it receives input from a user through
/// Elements (buttons, thumbsticks, accelerometer, etc.) and sends
/// those values to either a Bridge or a Central.
///
/// - parameter .Bridge: An intermediary between Peripherals and the Central, which
/// effectively functions as both a Central and Peripheral, usually
/// forwarding element values to the Central, although it may also
/// process those values in terms of calling handlers. An iPhone
/// positioned in a slide-on controller will typically function as
/// as a Bridge (although it can also be a Central). An iPhone paired
/// with an Apple Watch that is functioning as a Peripheral will act
/// as a Bridge. Peripherals much be given the .BridgedPeripheral role
/// in order to be discovered by a .Bridge
///
/// - parameter .EnhancementBridge: Special Bridge mode for using a form-fitting/slide-on controller
/// with an iPhone. Prevents additional Peripherals from connecting.
///
@objc public enum AppRole: Int, CustomStringConvertible {
case Central = 0
case Peripheral = 1
case Bridge = 2
case EnhancementBridge = 3
public var description : String {
switch self {
case .Central: return "Central"
case .Peripheral: return "Peripheral"
case .Bridge: return "Bridge"
case .EnhancementBridge: return "Enhancement Bridge"
}
}
}
///
/// ControllerType enumeration: Most values are for informational purposes,
/// except MFiHardware, which is used to trigger the "wrapped" approach to
/// handling hardware controllers in VgcController.
///
@objc public enum ControllerType: Int, CustomStringConvertible {
case Software
case MFiHardware
case ICadeHardware
case BridgedMFiHardware
case BridgedICadeHardware
case Watch
public var description : String {
switch self {
case .MFiHardware: return "MFi Hardware"
case .ICadeHardware: return "iCade Hardware"
case .Software: return "Software"
case .BridgedMFiHardware: return "Bridged MFi Hardware"
case .BridgedICadeHardware: return "Bridged iCade Hardware"
case .Watch: return "Watch"
}
}
}
@objc public enum ProfileType: Int, CustomStringConvertible {
case Unknown
case MicroGamepad
case Gamepad
case ExtendedGamepad
case Motion
case Watch
public var description : String {
switch self {
case .Unknown: return "Unknown"
case .MicroGamepad: return "MicroGamepad"
case .Gamepad: return "Gamepad"
case .ExtendedGamepad: return "ExtendedGamepad"
case .Motion: return "Motion"
case .Watch: return "Watch"
}
}
var pathComponentRead : String {
switch self {
case .Unknown: return ""
case .MicroGamepad: return "microGamepad"
case .Gamepad: return "gamepad"
case .ExtendedGamepad: return "extendedGamepad"
case .Motion: return "motion"
case .Watch: return "extendedGamepad"
}
}
var pathComponentWrite : String {
switch self {
case .Unknown: return ""
case .MicroGamepad: return "vgcMicroGamepad"
case .Gamepad: return "vgcGamepad"
case .ExtendedGamepad: return "vgcExtendedGamepad"
case .Motion: return "vgcMotion"
case .Watch: return "vgcExtendedGamepad"
}
}
}
/// For transmitted element value messages...
let messageValueSeperator = ":"
#if !os(watchOS)
@objc public class VgcService: NSObject {
public var name: String
public var type: AppRole
internal var netService: NSNetService
public var fullName: String { return "\(name) (\(type.description))" }
init(name: String, type: AppRole, netService: NSNetService) {
self.name = name
self.type = type
self.netService = netService
}
}
#endif
public class VgcManager: NSObject {
// Define this as a singleton although never used as such; only class methods used
static let sharedInstance = VgcManager()
private override init() {}
// Default to being a Peripheral
public static var appRole: AppRole = .Peripheral
///
/// Shared set of elements (in contrast to controllers on a Central/Bridge, each
/// of which have their own set of elements).
///
public static var elements = Elements()
///
/// Used as a component of the bonjour names for the various app types.
/// This should be set to something that uniquely identifies your app.
///
public static var appIdentifier = "vgc"
static var bonjourTypeCentral: String { return "_\(VgcManager.appIdentifier)_central._tcp." }
static var bonjourTypeBridge: String { return "_\(VgcManager.appIdentifier)_bridge._tcp." }
///
/// An app in Bridge mode can call it's handlers or simply relay
/// data forward to the Central. Relaying is more performant.
///
public static var bridgeRelayOnly = false
#if !os(watchOS)
///
/// The vendor of the iCade controller in use, or .Disabled if the functionality
/// is not being used. The Mode can be set at any time, and would presumably be
/// in response to an end-user selecting the type of iCade controller they've paired
/// with their iOS device.
///
public static var iCadeControllerMode: IcadeControllerMode = .Disabled {
didSet {
#if !os(watchOS)
if iCadeControllerMode != .Disabled { iCadePeripheral = VgcIcadePeripheral() } else { iCadePeripheral = nil }
#endif
}
}
public static var iCadePeripheral: VgcIcadePeripheral!
#endif
///
/// We support mapping from either the Peripheral or Central side. Central-side mapping
/// is recommended; it is more efficient because two values do not need to be transmitted.
/// Central-side mapping also works with hardware controllers.
///
public static var usePeripheralSideMapping: Bool = false
public static var netServiceBufferSize = 256
///
/// Don't enable these unless they are really needed because they produce
/// tons of data to be transmitted and clog the channels.
///
public static var enableMotionUserAcceleration = true
public static var enableMotionRotationRate = true
public static var enableMotionAttitude = true
public static var enableMotionGravity = true
///
/// Logs measurements of mesages transmitted/received and displays in console
///
static var performanceSamplingEnabled: Bool { get { return performanceSamplingDisplayFrequency > 0 } }
///
/// Controls how long we wait before averaging the number of messages
/// transmitted/received per second when logging performance. Set to 0 to disable.
///
public static var performanceSamplingDisplayFrequency: Float = 10.0
#if !os(watchOS)
public static var peripheral: Peripheral!
#endif
/// Network name for publishing service, defaults to device name
#if !os(watchOS) && !os(OSX)
public static var centralServiceName = UIDevice.currentDevice().name
#endif
#if os(OSX)
public static var centralServiceName = NSHost.currentHost().localizedName
#endif
/// Simplified version of startAs when custom mapping and custom elements are not needed
public class func startAs(appRole: AppRole, appIdentifier: String) {
VgcManager.startAs(appRole, appIdentifier: appIdentifier, customElements: CustomElementsSuperclass(), customMappings: CustomMappingsSuperclass())
}
///
/// Kicks off the search for software controllers. This is a required method and should be
/// called early in the application launch process.
///
public class func startAs(appRole: AppRole, appIdentifier: String, customElements: CustomElementsSuperclass!, customMappings: CustomMappingsSuperclass!) {
self.appRole = appRole
if appIdentifier != "" { self.appIdentifier = appIdentifier } else { print("ERROR: You must set appIdentifier to some string") }
Elements.customElements = customElements
Elements.customMappings = customMappings
print("Setting up as a \(VgcManager.appRole.description.uppercaseString)")
#if !os(watchOS)
switch (VgcManager.appRole) {
case .Peripheral:
VgcManager.peripheral = Peripheral()
// Default device for software Peripheral, can be overriden by setting the VgcManager.peripheral.deviceInfo property
VgcManager.peripheral.deviceInfo = DeviceInfo(deviceUID: "", vendorName: "", attachedToDevice: false, profileType: .ExtendedGamepad, controllerType: .Software, supportsMotion: true)
case .Central:
VgcController.setup()
case .Bridge, .EnhancementBridge:
VgcController.setup()
}
#endif
}
}
// Convienance function
public func deviceIsTypeOfBridge() -> Bool {
return VgcManager.appRole == .Bridge || VgcManager.appRole == .EnhancementBridge
}
// Meta information related to the controller. This object is
// made available for both hardware and software controllers. It
// supports copying, for use in the bridge/forwarding context, and
// supports archiving for transmission from peripheral to central.
/// DeviceInfo contains key properties of a controller, either hardware or software.
///
/// - parameter deviceUID: Unique identifier for the controller. Hardware controllers have this built-in. An arbitrary identifier can be given to a software controller, and the NSUUID().UUIDString function is recommended.
///
/// - parameter vendorName: Built-in to a hardware controller. For software controllers, either define a name or use an empty string "" and the machine/device name will be used.
///
/// - parameter profileType: Built-in to a hardware controller. This can be aribtrarily set to either extendedGamepad or Gamepad for a software controller, and will determine what elements are available to the controller. microGamepad is only available in the tvOS context and is untested with software controllers.
///
/// - parameter supportsMotion: Built-in parameter with a hardware controller (the Apple TV remote is the only hardware controller known to support motion). This can be set when defining a software controller, but would be overriden on the basis of the availabiity of Core Motion. For example, an OSX-based software controller would report supports motion as false.
///
@objc public class DeviceInfo: NSObject, NSCoding {
internal(set) var deviceUID: String
internal(set) public var vendorName: String
internal(set) public var attachedToDevice: Bool
internal(set) public var profileType: ProfileType
internal(set) public var controllerType: ControllerType
internal(set) public var supportsMotion: Bool
@objc public init(var deviceUID: String, vendorName: String, attachedToDevice: Bool, profileType: ProfileType, controllerType: ControllerType, supportsMotion: Bool) {
// If no deviceUID is specified, auto-generate a UID and store it to provide
// a persistent way of identifying the peripheral.
if deviceUID == "" {
let defaults = NSUserDefaults.standardUserDefaults()
if let existingDeviceUID = defaults.stringForKey("deviceUID") {
print("Found existing UID for device: \(existingDeviceUID)")
deviceUID = existingDeviceUID
} else {
deviceUID = NSUUID().UUIDString
print("Created new UID for device: \(deviceUID)")
defaults.setObject(deviceUID, forKey: "deviceUID")
}
}
self.deviceUID = deviceUID
self.attachedToDevice = attachedToDevice
self.profileType = profileType
self.controllerType = controllerType
self.supportsMotion = supportsMotion
self.vendorName = vendorName
super.init()
if (self.vendorName == "") {
#if os(iOS) || os(tvOS)
self.vendorName = UIDevice.currentDevice().name
#endif
#if os(OSX)
self.vendorName = NSHost.currentHost().localizedName!
#endif
}
if self.vendorName == "" {
self.vendorName = "Unknown"
}
if profileType == .MicroGamepad {
print("ERROR: The use of the .MicroGamepad profile for software-based controllers will lead to unpredictable results.")
}
}
public override var description: String {
var result: String = "\n"
result += "Device information:\n\n"
result += "Vendor: \(self.vendorName)\n"
result += "Type: \(self.controllerType)\n"
result += "Profile: \(self.profileType)\n"
result += "Attached: \(self.attachedToDevice)\n"
result += "Motion: \(self.supportsMotion)\n"
result += "ID: \(self.deviceUID)\n"
return result
}
// The deviceInfo is sent over-the-wire to a Bridge or Central using
// NSKeyed archiving...
required convenience public init(coder decoder: NSCoder) {
let deviceUID = decoder.decodeObjectForKey("deviceUID") as! String
let vendorName = decoder.decodeObjectForKey("vendorName") as! String
let attachedToDevice = decoder.decodeBoolForKey("attachedToDevice")
let profileType = ProfileType(rawValue: decoder.decodeIntegerForKey("profileType"))
let supportsMotion = decoder.decodeBoolForKey("supportsMotion")
let controllerType = ControllerType(rawValue: decoder.decodeIntegerForKey("controllerType"))
self.init(deviceUID: deviceUID, vendorName: vendorName, attachedToDevice: attachedToDevice, profileType: profileType!, controllerType: controllerType!, supportsMotion: supportsMotion)
}
public func encodeWithCoder(coder: NSCoder) {
coder.encodeObject(self.deviceUID, forKey: "deviceUID")
coder.encodeObject(self.vendorName, forKey: "vendorName")
coder.encodeBool(self.attachedToDevice, forKey: "attachedToDevice")
coder.encodeInteger(self.profileType.rawValue, forKey: "profileType")
coder.encodeInteger(self.controllerType.rawValue, forKey: "controllerType")
coder.encodeBool(self.supportsMotion, forKey: "supportsMotion")
}
// A copy of the deviceInfo object is made when forwarding it through a Bridge.
func copyWithZone(zone: NSZone) -> AnyObject {
let copy = DeviceInfo(deviceUID: deviceUID, vendorName: vendorName, attachedToDevice: attachedToDevice, profileType: profileType, controllerType: controllerType, supportsMotion: supportsMotion)
return copy
}
}
|
[
-1
] |
e17b035bb06adbf85df123d5e384fb6007ea7343
|
9fe19e592c330730db55b70031d952b3e53f82e4
|
/MusicPlayer/iTunesNetworkClient/Methods/Search.swift
|
e773cc98abb2b5454708c6bbc55fcff94d6a854e
|
[] |
no_license
|
ioramashvili/MusicPlayer
|
1ef56cc1c9b9016440367c79266494c0d57dcf39
|
cafd7eaf88966fd2baf51e097b2c3dd2a38a097d
|
refs/heads/master
| 2020-03-30T20:14:51.128773 | 2018-10-04T18:57:58 | 2018-10-04T18:57:58 | 151,579,740 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 492 |
swift
|
extension iTunesNetworkClient {
public class func makeNewsAndOffersRequest(term: String, limit: Int, media: Media) -> iTunesNetworkClientRequest {
let param: [Key: Any] = [
.term: term.replacingOccurrences(of: " ", with: "+"),
.limit: limit,
.media: media.rawValue
]
return iTunesNetworkClientRequest(httpMethod: .get, method: Method.search, param: param)
}
public enum Media: String {
case music
}
}
|
[
-1
] |
6f982230b67df52970c59efc7b3eda8ff4b72c1b
|
7c26929330cced25404265cda5fea37bebedd4e8
|
/Mathleta/Model/Player.swift
|
3dbc36adc4897d4d4db2127fdaa20edacce099ad
|
[] |
no_license
|
paolobernardo/Mathleta
|
5629476c9c5d389f2ffd9b5280852f1f3a111466
|
fdfe3d20b6e4445a37ccdc825ff25f51073b8086
|
refs/heads/master
| 2020-03-26T19:23:42.929676 | 2018-08-17T23:56:47 | 2018-08-17T23:56:47 | 145,261,972 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 321 |
swift
|
//
// Player.swift
// Mathleta
//
// Created by Paolo Bernardo on 14/08/18.
// Copyright © 2018 Paolo Bernardo. All rights reserved.
//
import Foundation
import RealmSwift
class Player: Object{
@objc dynamic var name = ""
@objc dynamic var score : Int = 0
@objc dynamic var level : Int = 1
}
|
[
-1
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.