text stringlengths 9 39.2M | dir stringlengths 25 226 | lang stringclasses 163
values | created_date timestamp[s] | updated_date timestamp[s] | repo_name stringclasses 751
values | repo_full_name stringclasses 752
values | star int64 1.01k 183k | len_tokens int64 1 18.5M |
|---|---|---|---|---|---|---|---|---|
```swift
import XCTest
@testable import Simplenote
// MARK: - PinLockVerifyControllerTests
//
class PinLockVerifyControllerTests: XCTestCase {
private lazy var delegate = MockPinLockVerifyControllerDelegate()
private lazy var pinLockManager = MockPinLockManager()
private lazy var controller = PinLockVerify... | /content/code_sandbox/SimplenoteTests/PinLock/PinLockVerifyControllerTests.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 661 |
```swift
import Foundation
@testable import Simplenote
// MARK: - PinLockControllerConfiguration
//
extension PinLockControllerConfiguration {
static func random() -> PinLockControllerConfiguration {
return PinLockControllerConfiguration(title: UUID().uuidString,
... | /content/code_sandbox/SimplenoteTests/PinLock/Helpers/PinLockControllerConfiguration+Tests.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 61 |
```swift
import XCTest
@testable import Simplenote
// MARK: - MockPinLockManager
//
class MockPinLockManager: SPPinLockManager {
var actualPin: String = UUID().uuidString
var setPinInvocations: [String] = []
var numberOfTimesRemovePinIsCalled: Int = 0
var evaluateBiometryCompletions: [(Bool) -> Void]... | /content/code_sandbox/SimplenoteTests/PinLock/Helpers/MockPinLockManager.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 217 |
```swift
import XCTest
@testable import SimplenoteEndpoints
@testable import Simplenote
class MockAccountVerificationRemote: AccountRemote {
private var pendingVerifications: [(email: String, completion: (Result<Data?, RemoteError>) -> Void)] = []
override func verify(email: String, completion: @escaping (Res... | /content/code_sandbox/SimplenoteTests/Verification/Helpers/MockAccountVerificationRemote.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 168 |
```swift
import XCTest
import SimplenoteEndpoints
@testable import Simplenote
// MARK: - AccountVerificationControllerTests
//
class AccountVerificationControllerTests: XCTestCase {
private let email = UUID().uuidString
private lazy var remote = MockAccountVerificationRemote()
private lazy var controller ... | /content/code_sandbox/SimplenoteTests/Verification/AccountVerificationControllerTests.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 731 |
```swift
import XCTest
@testable import Simplenote
// MARK: - TagTextFieldInputValidatorTests
//
class TagTextFieldInputValidatorTests: XCTestCase {
let validator = TagTextFieldInputValidator()
func testValidationSucceeds() {
let text = ""
let range = text.endIndex..<text.endIndex
let... | /content/code_sandbox/SimplenoteTests/Tags/TagTextFieldInputValidatorTests.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 832 |
```unknown
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1530"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.Debugger... | /content/code_sandbox/Simplenote.xcodeproj/xcshareddata/xcschemes/SimplenoteUITests_Subset.xcscheme | unknown | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 1,543 |
```unknown
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1530"
wasCreatedForAppExtension = "YES"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting... | /content/code_sandbox/Simplenote.xcodeproj/xcshareddata/xcschemes/SimplenoteShare.xcscheme | unknown | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 854 |
```unknown
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1530"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning ... | /content/code_sandbox/Simplenote.xcodeproj/xcshareddata/xcschemes/Simplenote.xcscheme | unknown | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 987 |
```unknown
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1530"
wasCreatedForAppExtension = "YES"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting... | /content/code_sandbox/Simplenote.xcodeproj/xcshareddata/xcschemes/SimplenoteIntents.xcscheme | unknown | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 852 |
```unknown
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1530"
wasCreatedForAppExtension = "YES"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting... | /content/code_sandbox/Simplenote.xcodeproj/xcshareddata/xcschemes/SimplenoteWidgetsExtension.xcscheme | unknown | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 1,049 |
```unknown
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1530"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning ... | /content/code_sandbox/Simplenote.xcodeproj/xcshareddata/xcschemes/UITestsFoundation.xcscheme | unknown | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 556 |
```unknown
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1530"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.Debugger... | /content/code_sandbox/Simplenote.xcodeproj/xcshareddata/xcschemes/SimplenoteScreenshots.xcscheme | unknown | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 806 |
```unknown
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1530"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.Debugger... | /content/code_sandbox/Simplenote.xcodeproj/xcshareddata/xcschemes/SimplenoteUITests.xcscheme | unknown | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 660 |
```unknown
#!/usr/bin/env swift
import Foundation
guard CommandLine.arguments.count > 1 else {
print("Usage: fix-translation path/to/Localizable.strings")
exit(1)
}
func fix(file: String) throws {
var encoding = String.Encoding.utf8
let contents = try String(contentsOfFile: file, usedEncoding: &encod... | /content/code_sandbox/Scripts/fix-translation | unknown | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 219 |
```ruby
#!/usr/bin/env ruby
# frozen_string_literal: true
# Supported languages:
# ar,cy,zh-Hans,zh-Hant,nl,fa,fr,de,el,he,id,ko,pt,ru,es,sv,tr,ja,it
# * Arabic
# * Welsh
# * Chinese (China) [zh-Hans]
# * Chinese (Taiwan) [zh-Hant]
# * Dutch
# * French
# * Greek
# * German
# * Hebrew
# * Indonesian
# * Korean
# * Port... | /content/code_sandbox/Scripts/update-translations.rb | ruby | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 834 |
```ruby
# frozen_string_literal: true
# Parses the release notes file to extract the current version information and
# puts it to STDOUT.
#
# To update the release notes for localization:
#
# ruby ./this_script >| Simplenote/Resources/release_notes.txt
#
# To generate the App Store Connect release message:
#
# ruby ./... | /content/code_sandbox/Scripts/extract_release_notes.rb | ruby | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 684 |
```shell
#!/bin/bash
SOURCE_PATH=$1
TARGET_PATH=$2
USAGE="error: Usage $0 source_path target_path"
if [[ -z ${SOURCE_PATH:+x} || -z ${TARGET_PATH:+x} ]]; then
echo $USAGE
exit 1
fi
git check-ignore "${TARGET_PATH}" > /dev/null
GIT_IGNORE_EXIT_CODE=$?
if [ $GIT_IGNORE_EXIT_CODE -ne 0 ]; then
echo "error: Att... | /content/code_sandbox/Scripts/Build-Phases/copy-secret.sh | shell | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 267 |
```shell
#!/bin/bash
IPHONE_TIME=$(ruby -e "require 'time';puts Time.new(2007, 1, 9, 9, 42, 0).iso8601")
xcrun simctl boot "${TARGET_DEVICE_IDENTIFIER}"
xcrun simctl status_bar "${TARGET_DEVICE_IDENTIFIER}" override \
--time $IPHONE_TIME \
--dataNetwork wifi \
--wifiMode active \
--wifiBars 3 \
-... | /content/code_sandbox/Scripts/pre-actions/configure-status-bar.sh | shell | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 115 |
```objective-c
//
// Use this file to import your target's public headers that you would like to expose to Swift.
//
#import "Foundation/Foundation.h"
``` | /content/code_sandbox/SimplenoteWidgets/Simplenote-Widgets-Bridging-Header.h | objective-c | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 30 |
```swift
import SwiftUI
import WidgetKit
@available(iOS 14.0, *)
@main
struct SimplenoteWidgets: WidgetBundle {
var body: some Widget {
NewNoteWidget()
NoteWidget()
ListWidget()
}
}
``` | /content/code_sandbox/SimplenoteWidgets/SimplenoteWidgets.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 52 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "path_to_url">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>SimplenoteWidgets</string>
<key>CFBundleExecutable</key... | /content/code_sandbox/SimplenoteWidgets/Info.plist | xml | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 280 |
```swift
// This file contains the required class structure to be able to fetch and use core data files in widgets and intents
// We have collapsed the auto generated core data files into a single file as it is unlikely that the files will need to
// be regenerated. Contained in this file is the generated class files ... | /content/code_sandbox/SimplenoteWidgets/Models/Tag+Widget.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 160 |
```swift
// This file contains the required class structure to be able to fetch and use core data files in widgets and intents
// We have collapsed the auto generated core data files into a single file as it is unlikely that the files will need to
// be regenerated. Contained in this file is the generated class files ... | /content/code_sandbox/SimplenoteWidgets/Models/Note+Widget.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 906 |
```swift
// This file contains the required class structure to be able to fetch and use core data files in widgets and intents
// We have collapsed the auto generated core data files into a single file as it is unlikely that the files will need to
// be regenerated. Contained in this file is the generated class files ... | /content/code_sandbox/SimplenoteWidgets/Models/SPManagedObject+Widget.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 164 |
```unknown
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "path_to_url">
<plist version="1.0">
<dict>
<key>INEnums</key>
<array>
<dict>
<key>INEnumClassName</key>
<string>ListFilterKind</string>
<key>INEnumDisplayName</key>
<string>Kind</string>
<key>INEnu... | /content/code_sandbox/SimplenoteWidgets/Supporting Files/ListWidgetIntent.intentdefinition | unknown | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 2,230 |
```unknown
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "path_to_url">
<plist version="1.0">
<dict>
<key>com.apple.security.application-groups</key>
<array>
<string>group.com.codality.NotationalFlow.Development</string>
</array>
</dict>
</plist>
``` | /content/code_sandbox/SimplenoteWidgets/Supporting Files/SimplenoteWidgetsExtension-Debug.entitlements | unknown | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 90 |
```unknown
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "path_to_url">
<plist version="1.0">
<dict>
<key>com.apple.security.application-groups</key>
<array>
<string>group.com.codality.NotationalFlow</string>
</array>
</dict>
</plist>
``` | /content/code_sandbox/SimplenoteWidgets/Supporting Files/SimplenoteWidgetsExtension-Release.entitlements | unknown | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 88 |
```unknown
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "path_to_url">
<plist version="1.0">
<dict>
<key>NSPrivacyCollectedDataTypes</key>
<array>
<dict>
<key>NSPrivacyCollectedDataType</key>
<string>NSPrivacyCollectedDataTypeOtherDiagnosticData</string>
<key>... | /content/code_sandbox/SimplenoteWidgets/Supporting Files/PrivacyInfo.xcprivacy | unknown | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 760 |
```unknown
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "path_to_url">
<plist version="1.0">
<dict>
<key>com.apple.security.application-groups</key>
<array>
<string>group.com.codality.NotationalFlow.Internal</string>
</array>
</dict>
</plist>
``` | /content/code_sandbox/SimplenoteWidgets/Supporting Files/SimplenoteWidgetsExtension-DistributionInternal.entitlements | unknown | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 89 |
```unknown
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "path_to_url">
<plist version="1.0">
<dict>
<key>com.apple.security.application-groups</key>
<array>
<string>group.com.codality.NotationalFlow.Alpha</string>
</array>
</dict>
</plist>
``` | /content/code_sandbox/SimplenoteWidgets/Supporting Files/SimplenoteWidgetsExtension-DistributionAlpha.entitlements | unknown | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 89 |
```unknown
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "path_to_url">
<plist version="1.0">
<dict>
<key>INEnums</key>
<array/>
<key>INIntentDefinitionModelVersion</key>
<string>1.2</string>
<key>INIntentDefinitionNamespace</key>
<string>BYLISy</string>
<key>INInten... | /content/code_sandbox/SimplenoteWidgets/Supporting Files/NoteWidgetIntent.intentdefinition | unknown | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 1,582 |
```swift
import SwiftUI
import WidgetKit
struct WidgetWarningView: View {
let warning: WidgetsState
var body: some View {
GeometryReader { geometry in
ZStack(alignment: .center) {
Text(warning.message)
.subheadline(color: .secondaryTextColor)
... | /content/code_sandbox/SimplenoteWidgets/Views/WidgetWarningView.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 238 |
```swift
import SwiftUI
import WidgetKit
struct NewNoteImage: View {
let size: CGFloat
let foregroundColor: Color
let backgroundColor: Color
var body: some View {
ZStack {
Image(Constants.newNoteImage)
.resizable()
.aspectRatio(contentMode: .fill)
... | /content/code_sandbox/SimplenoteWidgets/Views/NewNoteButton.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 174 |
```swift
import SwiftUI
struct NoteListTable: View {
let rows: [Row]
let geometry: GeometryProxy
var body: some View {
let width = geometry.size.width - Constants.sidePadding
let height = round((geometry.size.height - Constants.headerSize) / CGFloat(rows.count))
ForEach(.zero ..< ... | /content/code_sandbox/SimplenoteWidgets/Views/NoteListTable.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 211 |
```swift
import SwiftUI
import WidgetKit
struct NoteListRow: View {
var noteTitle: String
var width: CGFloat
var height: CGFloat
var lastRow: Bool
var body: some View {
Text(noteTitle)
.font(.subheadline)
.lineLimit(Constants.lineLimit)
.frame(width: wid... | /content/code_sandbox/SimplenoteWidgets/Views/NoteListRow.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 198 |
```swift
import SwiftUI
import WidgetKit
@available(iOS 14.0, *)
struct NewNoteWidgetView: View {
var body: some View {
ZStack {
VStack(alignment: .leading) {
HStack {
NewNoteImage(size: Constants.side,
foregroundColor: .white... | /content/code_sandbox/SimplenoteWidgets/Views/NewNoteWidgetView.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 235 |
```swift
import SwiftUI
import WidgetKit
struct NoteWidgetView: View {
var entry: NoteWidgetEntry
@Environment(\.widgetFamily) var widgetFamily
var body: some View {
GeometryReader { geometry in
ZStack {
VStack(alignment: .leading) {
Text(entry.title... | /content/code_sandbox/SimplenoteWidgets/Views/NoteWidgetView.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 270 |
```swift
import SwiftUI
import WidgetKit
struct ListWidgetHeaderView: View {
let tag: WidgetTag
@Environment(\.widgetFamily) var widgetFamily
var body: some View {
HStack(alignment: .center) {
Link(destination: URL.internalUrl(forTag: tag.identifier)) {
Text(tag.tagDes... | /content/code_sandbox/SimplenoteWidgets/Views/ListWidgetHeaderView.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 205 |
```swift
import SwiftUI
import WidgetKit
struct ListWidgetView: View {
var entry: ListWidgetEntry
@Environment(\.widgetFamily) var widgetFamily
var body: some View {
GeometryReader { geometry in
ZStack {
HStack(alignment: .top) {
VStack(alignment: .l... | /content/code_sandbox/SimplenoteWidgets/Views/ListWidgetView.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 451 |
```swift
import Foundation
enum WidgetsState {
case standard
case noteMissing
case tagDeleted
case loggedOut
}
extension WidgetsState {
var message: String {
switch self {
case .standard:
return String()
case .noteMissing:
return NSLocalizedString("N... | /content/code_sandbox/SimplenoteWidgets/Tools/WidgetsState.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 134 |
```swift
import Foundation
import SimplenoteFoundation
import SimplenoteSearch
import CoreData
class ExtensionResultsController {
/// Data Controller
///
let managedObjectContext: NSManagedObjectContext
/// Initialization
///
init(context: NSManagedObjectContext) {
self.managedObjectC... | /content/code_sandbox/SimplenoteWidgets/Tools/ExtensionResultsController.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 865 |
```swift
class WidgetDefaults {
static let shared = WidgetDefaults()
private let defaults = UserDefaults(suiteName: SimplenoteConstants.sharedGroupDomain)
private init() { }
var loggedIn: Bool {
get {
defaults?.bool(forKey: .accountIsLoggedIn) ?? false
}
set {
... | /content/code_sandbox/SimplenoteWidgets/Tools/WidgetDefaults.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 147 |
```swift
import Foundation
struct DemoContent {
static let singleNoteTitle = "Lorem ipsum dolor sit amet"
static let singleNoteContent = ", consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Nulla facilisi nullam vehicula ipsum a arcu cursus. Cursus risus at ultrice... | /content/code_sandbox/SimplenoteWidgets/Tools/DemoContent.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 545 |
```swift
import Foundation
import CoreData
class ExtensionCoreDataWrapper {
private lazy var coreDataManager: CoreDataManager = {
do {
return try CoreDataManager(StorageSettings().sharedStorageURL, for: .widgets)
} catch {
fatalError()
}
}()
private lazy var... | /content/code_sandbox/SimplenoteWidgets/Tools/ExtensionCoreDataWrapper.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 140 |
```swift
import Foundation
struct WidgetConstants {
static let rangeForSixEntries = .zero..<6
}
``` | /content/code_sandbox/SimplenoteWidgets/Tools/WidgetConstants.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 22 |
```swift
import WidgetKit
struct NewNoteWidgetEntry: TimelineEntry {
let date: Date
}
struct NewNoteTimelineProvider: TimelineProvider {
typealias Entry = NewNoteWidgetEntry
func placeholder(in context: Context) -> NewNoteWidgetEntry {
return NewNoteWidgetEntry(date: Date())
}
func getSn... | /content/code_sandbox/SimplenoteWidgets/Providers/NewNoteWidgetProvider.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 161 |
```swift
import WidgetKit
struct NoteWidgetEntry: TimelineEntry {
let date: Date
let title: String
let content: String
let url: URL
let loggedIn: Bool
let state: State
enum State {
case standard
case noteMissing
case loggedOut
}
}
extension NoteWidgetEntry {
... | /content/code_sandbox/SimplenoteWidgets/Providers/NoteWidgetProvider.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 629 |
```swift
import WidgetKit
struct ListWidgetEntry: TimelineEntry {
let date: Date
let widgetTag: WidgetTag
let noteProxies: [ListWidgetNoteProxy]
let loggedIn: Bool
let state: State
enum State {
case standard
case tagDeleted
case loggedOut
}
}
extension ListWidgetEn... | /content/code_sandbox/SimplenoteWidgets/Providers/ListWidgetProvider.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 770 |
```swift
import SwiftUI
extension View {
func filling() -> some View {
self.modifier(Filling())
}
func frame(side: CGFloat, alignment: Alignment = .center) -> some View {
self.frame(width: side, height: side, alignment: alignment)
}
}
extension View {
func widgetBackground(@ViewBu... | /content/code_sandbox/SimplenoteWidgets/Extensions/View+Simplenote.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 123 |
```swift
import SwiftUI
extension Color {
static var bodyTextColor: Color {
Color(light: .gray100, dark: .white)
}
static var secondaryTextColor: Color {
Color(light: .gray50, dark: .gray30)
}
static var widgetBackgroundColor: Color {
Color(light: .white, dark: .darkGray1)... | /content/code_sandbox/SimplenoteWidgets/Extensions/Color+Widgets.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 127 |
```swift
import Foundation
extension ListFilterKind {
var description: String {
switch self {
case .tag:
return NSLocalizedString("Tag", comment: "Display title for a User Tag")
default:
return NSLocalizedString("All Notes", comment: "Display title for All Notes")
... | /content/code_sandbox/SimplenoteWidgets/Extensions/WidgetTag+Helpers.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 216 |
```swift
import SwiftUI
import WidgetKit
@available(iOS 14.0, *)
extension Text {
func widgetHeader(_ widgetFamily: WidgetFamily, color: Color) -> Text {
self
.font(widgetFamily == .systemSmall ? .subheadline : .body)
.fontWeight(.bold)
.foregroundColor(color)
}
... | /content/code_sandbox/SimplenoteWidgets/Extensions/Text+Simplenote.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 100 |
```swift
import SwiftUI
struct Filling: ViewModifier {
func body(content: Content) -> some View {
content
.frame(
minWidth: .zero,
maxWidth: .infinity,
minHeight: .zero,
maxHeight: .infinity,
alignment: .topLeading
... | /content/code_sandbox/SimplenoteWidgets/ViewModifiers/Filling.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 65 |
```swift
import SwiftUI
import WidgetKit
@available(iOS 14.0, *)
struct ListWidget: Widget {
var body: some WidgetConfiguration {
IntentConfiguration(kind: Constants.configurationKind, intent: ListWidgetIntent.self, provider: ListWidgetProvider()) { (entry) in
prepareWidgetView(fromEntry: entry... | /content/code_sandbox/SimplenoteWidgets/Widgets/ListWidget.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 256 |
```swift
import SwiftUI
import WidgetKit
@available(iOS 14.0, *)
struct NoteWidget: Widget {
var body: some WidgetConfiguration {
IntentConfiguration(kind: Constants.configurationKind, intent: NoteWidgetIntent.self, provider: NoteWidgetProvider()) { (entry) in
prepareWidgetView(fromEntry: entry... | /content/code_sandbox/SimplenoteWidgets/Widgets/NoteWidget.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 249 |
```swift
import SwiftUI
import WidgetKit
@available(iOS 14.0, *)
struct NewNoteWidget: Widget {
var body: some WidgetConfiguration {
StaticConfiguration(kind: Constants.configurationKind, provider: NewNoteTimelineProvider()) { entry in
NewNoteWidgetView()
}
.configurationDisplay... | /content/code_sandbox/SimplenoteWidgets/Widgets/NewNoteWidget.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 150 |
```swift
import XCTest
let screenName = "Settings"
class Settings {
enum Elements: String {
case doneButton = "Done"
case condensedModeSwitch = "Condensed Note List"
var element: XCUIElement {
switch self {
case .doneButton:
return app.navigationB... | /content/code_sandbox/SimplenoteUITests/Settings.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 211 |
```swift
import XCTest
class SimplenoteUISmokeTestsNoteEditor: XCTestCase {
let usualLinkText = "path_to_url"
let complexLinkPreviewText = "Simplenote"
let complexLinkRawText = "[Simplenote](path_to_url"
let webViewTexts = [String](
arrayLiteral: "Simplenote",
"The simplest way to keep ... | /content/code_sandbox/SimplenoteUITests/SimplenoteUITestsNoteEditor.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 2,658 |
```swift
import XCTest
class SimplenoteUISmokeTestsHistory: XCTestCase {
let notePrefix = "HistoryTest"
override class func setUp() {
app.launch()
EmailLogin.handleSavePasswordPrompt()
getToAllNotes()
let _ = attemptLogOut()
EmailLogin.open()
EmailLogin.logIn()
... | /content/code_sandbox/SimplenoteUITests/SimplenoteUITestsHistory.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 1,209 |
```swift
import XCTest
class NoteList {
class func openNote(noteName: String) {
app.tables.cells[noteName].tap()
}
class func getNavBarIdentifier() -> String? {
let navBar = app.navigationBars.element
guard navBar.exists else { return .none }
print(">>> Currently active na... | /content/code_sandbox/SimplenoteUITests/NoteList.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 2,327 |
```swift
enum UID {
enum Picture {
static let appLogo = "simplenote-logo"
}
enum Cell {
static let settings = "settings"
}
enum NavBar {
static let allNotes = "All Notes"
static let logIn = "Log In"
static let logInWithPassword = "Log In with Password"
... | /content/code_sandbox/SimplenoteUITests/UIDs.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 791 |
```swift
import XCTest
class History {
class func close() {
guard app.staticTexts[UID.Button.restoreNote].waitForExistence(timeout: minLoadTimeout) else { return }
app.buttons[UID.Button.dismissHistory].tap()
}
class func setSliderPosition(position: CGFloat) {
app.sliders.element.... | /content/code_sandbox/SimplenoteUITests/History.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 325 |
```swift
import UITestsFoundation
import XCTest
class SimplenoteUISmokeTestsLogin: XCTestCase {
let testDataInvalidEmail = "user@gmail."
let testDataNotExistingEmail = "nevergonnagiveyouup@gmail.com"
let testDataInvalidPassword = "ABC"
let testDataNotExistingPassword = "ABCD"
override class func s... | /content/code_sandbox/SimplenoteUITests/SimplenoteUITestsLogin.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 542 |
```swift
import XCTest
class NoteEditor {
class func dismissKeyboard() {
let dismissKeyboardButton = app.buttons[UID.Button.dismissKeyboard]
guard dismissKeyboardButton.exists else { return }
dismissKeyboardButton.tap()
}
class func addTag(tagName: String) {
NoteEditor.di... | /content/code_sandbox/SimplenoteUITests/NoteEditor.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 2,157 |
```swift
import XCTest
class SimplenoteUISmokeTestsSettings: XCTestCase {
override class func setUp() {
app.launch()
getToAllNotes()
_ = attemptLogOut()
EmailLogin.open()
EmailLogin.logIn()
NoteList.waitForLoad()
}
override func setUpWithError() throws {
... | /content/code_sandbox/SimplenoteUITests/SimplenoteUISmokeTestsSettings.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 333 |
```swift
import XCTest
import XCUITestHelpers
class Preview {
class func getText() -> String {
// swiftlint:disable:next force_cast
return app.webViews.descendants(matching: .staticText).element.value as! String
}
class func getAllStaticTexts() -> XCUIElementQuery {
return app.web... | /content/code_sandbox/SimplenoteUITests/Preview.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 1,009 |
```swift
/// Value-type to describe the elements that represent a not as seen from the UI.
struct NoteData {
let name: String
let content: String
private(set) var tags: [String] = []
var formattedForAutomatedInput: String { "\(name)\n\n\(content)" }
}
``` | /content/code_sandbox/SimplenoteUITests/NoteData.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 66 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "path_to_url">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key... | /content/code_sandbox/SimplenoteUITests/Info.plist | xml | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 219 |
```swift
import XCTest
class SimplenoteUISmokeTestsTrash: XCTestCase {
override class func setUp() {
app.launch()
let _ = attemptLogOut()
EmailLogin.open()
EmailLogin.logIn()
NoteList.waitForLoad()
}
override func setUpWithError() throws {
NoteList.trashAll... | /content/code_sandbox/SimplenoteUITests/SimplenoteUITestsTrash.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 1,492 |
```swift
import XCTest
extension String {
func strippingUnicodeObjectReplacementCharacter() -> String {
replacingOccurrences(of: "\u{fffc}", with: "")
}
}
``` | /content/code_sandbox/SimplenoteUITests/Extensions.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 35 |
```swift
import XCTest
class Sidebar {
class func getButtonSettings() -> XCUIElement {
let predicate = NSPredicate(format: "identifier == '\(UID.Cell.settings)'")
return app.tables.cells.element(matching: predicate)
}
class func getButtonTagsEdit() -> XCUIElement {
// Returning fi... | /content/code_sandbox/SimplenoteUITests/Sidebar.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 479 |
```swift
import XCTest
class Trash {
class func open() {
print(">>> Opening \"Trash\"")
Sidebar.open()
app.tables.staticTexts[UID.Button.trash].tap()
}
class func restoreNote(noteName: String) {
app.tables.cells[noteName].swipeLeft()
app.tables.cells[noteName].butt... | /content/code_sandbox/SimplenoteUITests/Trash.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 306 |
```swift
import XCTest
let app = XCUIApplication()
private var stepIndex = 0
func attemptLogOut() -> Bool {
let allNotesNavBar = app.navigationBars[UID.NavBar.allNotes]
var loggedOut: Bool = false
if allNotesNavBar.exists {
loggedOut = logOut()
} else {
loggedOut = true
}
ret... | /content/code_sandbox/SimplenoteUITests/Generic.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 1,482 |
```swift
import XCTest
class EmailLogin {
class func open() {
app.buttons[UID.Button.logIn].waitForIsHittable()
app.buttons[UID.Button.logIn].tap()
}
class func close() {
/// Exit: We're already in the Onboarding UI
///
if app.buttons[UID.Button.logIn].exists, app.... | /content/code_sandbox/SimplenoteUITests/EmailLogin.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 889 |
```swift
import XCTest
// swiftlint:disable line_length
let godzilla = NoteData(
name: "Godzilla",
content: "Godzilla (Japanese: , Hepburn: Gojira, /dzl/; [odia] (About this soundlisten)) is a fictional monster, or kaiju, originating from a series of Japanese films. The character first appeared in the 1954 fil... | /content/code_sandbox/SimplenoteUITests/SimplenoteUITestsSearch.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 3,038 |
```swift
import XCTest
let notExpectedEnding = " is NOT as expected",
notFoundEnding = " NOT found",
notAbsentEnding = " NOT absent"
let inAllNotesEnding = #" in "All Notes""#,
inNoteListEnding = #" in "Note List""#,
inTrashEnding = " in \"Trash\"",
inEditorEnding = " in Note Editor",
inNotePr... | /content/code_sandbox/SimplenoteUITests/AssertGeneric.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 1,034 |
```objective-c
//
// Use this file to import your target's public headers that you would like to expose to Swift.
//
#import "SPConstants.h"
#import "TextBundleWrapper.h"
``` | /content/code_sandbox/SimplenoteShare/Simplenote-Share-Bridging-Header.h | objective-c | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 37 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="j1y-V4-xli">
... | /content/code_sandbox/SimplenoteShare/Base.lproj/MainInterface.storyboard | xml | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 491 |
```unknown
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "path_to_url">
<plist version="1.0">
<dict>
<key>previous-application-identifiers</key>
<array>
<string>4ESDVWK654.com.codality.NotationalFlow</string>
</array>
<key>com.apple.security.application-groups</key>
... | /content/code_sandbox/SimplenoteShare/Supporting Files/SimplenoteShare-AppStore.entitlements | unknown | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 181 |
```unknown
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "path_to_url">
<plist version="1.0">
<dict>
<key>com.apple.security.application-groups</key>
<array>
<string>group.com.codality.NotationalFlow.Internal</string>
</array>
<key>keychain-access-groups</key>
<array... | /content/code_sandbox/SimplenoteShare/Supporting Files/SimplenoteShare-Internal.entitlements | unknown | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 127 |
```unknown
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "path_to_url">
<plist version="1.0">
<dict>
<key>com.apple.security.application-groups</key>
<array>
<string>group.com.codality.NotationalFlow.Alpha</string>
</array>
<key>keychain-access-groups</key>
<array>
... | /content/code_sandbox/SimplenoteShare/Supporting Files/SimplenoteShare-DistributionAlpha.entitlements | unknown | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 127 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "path_to_url">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>Simplenote</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME... | /content/code_sandbox/SimplenoteShare/Supporting Files/Info.plist | xml | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 621 |
```unknown
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "path_to_url">
<plist version="1.0">
<dict>
<key>com.apple.security.application-groups</key>
<array>
<string>group.com.codality.NotationalFlow.Development</string>
</array>
<key>keychain-access-groups</key>
<ar... | /content/code_sandbox/SimplenoteShare/Supporting Files/SimplenoteShare-Development.entitlements | unknown | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 129 |
```swift
import Foundation
/// The purpose of this class is to encapsulate NSURLSession's interaction code, required to upload
/// a note to Simperium's REST endpoint.
///
class Uploader: NSObject {
/// Simperium's Token
///
private let token: String
/// Designated Initializer
///
init(simper... | /content/code_sandbox/SimplenoteShare/Simperium/Uploader.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 555 |
```swift
import Foundation
/// This class encapsulates the Note entity. It's the main project (non core data) counterpart.
///
class Note {
/// Note's Simperium Unique Key
///
let simperiumKey: String = {
return UUID().uuidString.replacingOccurrences(of: "-", with: "")
}()
/// Payload
... | /content/code_sandbox/SimplenoteShare/Simperium/Note.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 336 |
```swift
//
// Downloader.swift
// SimplenoteShare
//
// Created by Charlie Scheer on 5/13/24.
//
import Foundation
enum DownloaderError: Error {
case couldNotFetchNoteContent
var title: String {
switch self {
case .couldNotFetchNoteContent:
return NSLocalizedString("Could not ... | /content/code_sandbox/SimplenoteShare/Simperium/Downloader.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 482 |
```swift
import UIKit
import Social
typealias CompletionBlock = () -> Void
/// Main VC for Simplenote's Share Extension
///
class ShareViewController: UIViewController {
/// This completion handler closure is executed when this VC is dismissed.
///
@objc var dismissalCompletionBlock: CompletionBlock?
... | /content/code_sandbox/SimplenoteShare/ViewControllers/ShareViewController.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 1,158 |
```swift
import UIKit
class SharePresentationController: UIViewController {
private let extensionTransitioningManager: ExtensionTransitioningManager = {
let manager = ExtensionTransitioningManager()
manager.presentDirection = .bottom
manager.dismissDirection = .bottom
return manage... | /content/code_sandbox/SimplenoteShare/ViewControllers/SharePresentationController.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 399 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orie... | /content/code_sandbox/SimplenoteShare/ViewControllers/ShareViewController.xib | xml | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 798 |
```swift
import UIKit
/// Allows certain presented view controllers to request themselves to be
/// presented at full size instead of inset within the container.
///
protocol ExtensionPresentationTarget {
var shouldFillContentContainer: Bool { get }
}
final class ExtensionPresentationController: UIPresentationCon... | /content/code_sandbox/SimplenoteShare/Presentation/ExtensionPresentationController.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 1,383 |
```swift
import UIKit
final class ExtensionTransitioningManager: NSObject {
var presentDirection = Direction.bottom
var dismissDirection = Direction.bottom
}
// MARK: - UIViewControllerTransitioningDelegate Conformance
//
extension ExtensionTransitioningManager: UIViewControllerTransitioningDelegate {
fu... | /content/code_sandbox/SimplenoteShare/Presentation/ExtensionTransitioningManager.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 202 |
```swift
import UIKit
/// Direction to transition from/to.
///
/// - left: Enter/leave screen via the left edge.
/// - top: Enter/leave screen via the top edge.
/// - right: Enter/leave screen via the left edge.
/// - bottom: Enter/leave screen via the bottom edge.
///
enum Direction {
case left
case top
c... | /content/code_sandbox/SimplenoteShare/Presentation/ExtensionPresentationAnimator.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 476 |
```objective-c
//
// TextBundle.h
// TextBundle-Mac
//
// Created by Matteo Rattotti on 22/02/2019.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
extern NSString * const kUTTypeMarkdown;
extern NSString * const kUTTypeTextBundle;
extern NSString * const TextBundleErrorDomain;
typedef NS_ENUM(NSIn... | /content/code_sandbox/SimplenoteShare/Tools/TextBundleWrapper.h | objective-c | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 1,022 |
```objective-c
//
// TextBundle.m
// TextBundle-Mac
//
// Created by Matteo Rattotti on 22/02/2019.
//
#import "TextBundleWrapper.h"
#import <CoreServices/CoreServices.h>
#import <UniformTypeIdentifiers/UniformTypeIdentifiers.h>
// Filenames constants
NSString * const kTextBundleInfoFileName = @"info.json";
NSStri... | /content/code_sandbox/SimplenoteShare/Tools/TextBundleWrapper.m | objective-c | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 2,101 |
```swift
import Foundation
// MARK: - NSExtensionContext's Simplenote Methods
//
extension NSExtensionContext {
/// Returns the AttributedContentText stored in the (first) ExtensionItem
///
var attributedContentText: NSAttributedString? {
guard let item = inputItems.first as? NSExtensionItem else ... | /content/code_sandbox/SimplenoteShare/Extensions/NSExtensionContext+Simplenote.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 258 |
```swift
import Foundation
/// Encapsulates NSURLSessionConfiguration Helpers
///
extension URLSessionConfiguration {
/// Returns a new Background Session Configuration, with a random identifier.
///
class func backgroundSessionConfigurationWithRandomizedIdentifier() -> URLSessionConfiguration {
l... | /content/code_sandbox/SimplenoteShare/Extensions/NSURLSessionConfiguration+Extensions.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 94 |
```swift
import Foundation
import UIKit
// MARK: - Simplenote's Theme
//
@objc
class SPUserInterface: NSObject {
/// Ladies and gentlemen, this is a singleton.
///
@objc
static let shared = SPUserInterface()
/// Indicates if the User Interface is in Dark Mode
///
@objc
static var isDa... | /content/code_sandbox/SimplenoteShare/Themes/SPUserInterface.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 95 |
```swift
import Foundation
import MobileCoreServices
import UniformTypeIdentifiers
// MARK: - PlainTextExtractor
//
struct PlainTextExtractor: Extractor {
/// Accepted File Extension
///
let acceptedType = UTType.plainText.identifier
/// Indicates if a given Extension Context can be handled by the Ex... | /content/code_sandbox/SimplenoteShare/Extractors/PlainTextExtractor.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 231 |
```swift
import Foundation
import MobileCoreServices
import ZIPFoundation
import UniformTypeIdentifiers
// MARK: - URLExtractor
//
struct URLExtractor: Extractor {
/// Accepted File Extension
///
let acceptedType = UTType.url.identifier
/// Indicates if a given Extension Context can be handled by the... | /content/code_sandbox/SimplenoteShare/Extractors/URLExtractor.swift | swift | 2016-08-11T15:55:22 | 2024-08-14T02:42:22 | simplenote-ios | Automattic/simplenote-ios | 2,038 | 913 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.