text
stringlengths
9
39.2M
dir
stringlengths
26
295
lang
stringclasses
185 values
created_date
timestamp[us]
updated_date
timestamp[us]
repo_name
stringlengths
1
97
repo_full_name
stringlengths
7
106
star
int64
1k
183k
len_tokens
int64
1
13.8M
```ruby # frozen_string_literal: true # Lanes related to the Release Process (Code Freeze, Betas, Final Build, App Store Submission) platform :ios do lane :code_freeze do |skip_confirm: false| ensure_git_status_clean Fastlane::Helper::GitHelper.checkout_and_pull(DEFAULT_BRANCH) check_pods_references ...
/content/code_sandbox/fastlane/lanes/release.rb
ruby
2016-08-11T15:55:22
2024-08-14T02:42:22
simplenote-ios
Automattic/simplenote-ios
2,038
1,134
```swift /// Simplenote credentials for screenshots generation via UI tests /// struct ScreenshotsCredentials { static let testUserEmail = "test@example.com" static let testUserPassword = "password" } ```
/content/code_sandbox/SimplenoteScreenshots/ScreenshotsCredentials-demo.swift
swift
2016-08-11T15:55:22
2024-08-14T02:42:22
simplenote-ios
Automattic/simplenote-ios
2,038
42
```swift import UITestsFoundation import XCTest import XCUITestHelpers class SimplenoteScreenshots: XCTestCase { override func setUp() { continueAfterFailure = false UIPasteboard.general.strings = [] } func testScreenshots() throws { let app = XCUIApplication() setupSnapsh...
/content/code_sandbox/SimplenoteScreenshots/SimplenoteScreenshots.swift
swift
2016-08-11T15:55:22
2024-08-14T02:42:22
simplenote-ios
Automattic/simplenote-ios
2,038
2,160
```swift // // SnapshotHelper.swift // Example // // Created by Felix Krause on 10/8/15. // // ----------------------------------------------------- // IMPORTANT: When modifying this file, make sure to // increment the version number at the very // bottom of the file to notify users about // ...
/content/code_sandbox/SimplenoteScreenshots/SnapshotHelper.swift
swift
2016-08-11T15:55:22
2024-08-14T02:42:22
simplenote-ios
Automattic/simplenote-ios
2,038
2,335
```swift import XCTest @testable import Simplenote // MARK: - NSString Simplenote Tests // class NSStringSimplenoteTests: XCTestCase { /// Verifies that `byEncodingAsTagHash` effectively escapes all of the non alphanumeric characters /// func your_sha256_hashnTheReceiver() { let sample = "12345678...
/content/code_sandbox/SimplenoteTests/NSStringSimplenoteTests.swift
swift
2016-08-11T15:55:22
2024-08-14T02:42:22
simplenote-ios
Automattic/simplenote-ios
2,038
668
```swift import XCTest @testable import Simplenote // MARK: - InterlinkResultsController Tests // class InterlinkResultsControllerTests: XCTestCase { /// InMemory Storage! /// private let storage = MockupStorageManager() /// InterlinkResultsController /// private var resultsController: Interl...
/content/code_sandbox/SimplenoteTests/InterlinkResultsControllerTests.swift
swift
2016-08-11T15:55:22
2024-08-14T02:42:22
simplenote-ios
Automattic/simplenote-ios
2,038
865
```swift import XCTest @testable import Simplenote // MARK: - NoteContentPreviewTests Tests // class NoteContentPreviewTests: XCTestCase { /// InMemory Storage! /// private let storage = MockupStorageManager() /// Verifies that Markdown Title Markers are stripped from the title /// func testTr...
/content/code_sandbox/SimplenoteTests/NoteContentPreviewTests.swift
swift
2016-08-11T15:55:22
2024-08-14T02:42:22
simplenote-ios
Automattic/simplenote-ios
2,038
216
```swift import XCTest @testable import Simplenote // MARK: - UIImage+Simplenote Unit Tests // class UIImageSimplenoteTests: XCTestCase { /// Verify every single UIColorName in existance yields a valid UIColor instancce /// func testEverySingleUIImageNameEffectivelyYieldsSomeUIImageInstance() { fo...
/content/code_sandbox/SimplenoteTests/UIImageSimplenoteTests.swift
swift
2016-08-11T15:55:22
2024-08-14T02:42:22
simplenote-ios
Automattic/simplenote-ios
2,038
93
```swift import XCTest @testable import Simplenote // MARK: - NoteContentHelperTests Tests // class NoteContentHelperTests: XCTestCase { /// Empty title and body when content is nil /// func testEmptyTitleAndBodyRangeWhenContentIsNil() { let content: String? = nil let structure = NoteConte...
/content/code_sandbox/SimplenoteTests/NoteContentHelperTests.swift
swift
2016-08-11T15:55:22
2024-08-14T02:42:22
simplenote-ios
Automattic/simplenote-ios
2,038
621
```swift import XCTest @testable import Simplenote class PublishControllerTests: XCTestCase { private let publishController = PublishController() private let storage = MockupStorageManager() private var logger = PublishLogger() private var mockAppDelegate: MockAppDelegate? override func setUpWithE...
/content/code_sandbox/SimplenoteTests/PublishControllerTests.swift
swift
2016-08-11T15:55:22
2024-08-14T02:42:22
simplenote-ios
Automattic/simplenote-ios
2,038
1,167
```swift import Foundation @testable import Simplenote // MARK: - MockApplication // class MockApplication: ApplicationStateProvider { var applicationState: UIApplication.State = .active } ```
/content/code_sandbox/SimplenoteTests/MockApplication.swift
swift
2016-08-11T15:55:22
2024-08-14T02:42:22
simplenote-ios
Automattic/simplenote-ios
2,038
38
```swift import Foundation @testable import Simplenote // MARK: - MockupStorage Sample Entity Insertion Methods // extension MockupStorageManager { /// Inserts a new (Sample) Note into the receiver's Main MOC /// @discardableResult func insertSampleNote(contents: String = "", simperiumKey: String = UU...
/content/code_sandbox/SimplenoteTests/MockupStorage+Sample.swift
swift
2016-08-11T15:55:22
2024-08-14T02:42:22
simplenote-ios
Automattic/simplenote-ios
2,038
267
```swift import XCTest @testable import Simplenote // MARK: - Note+Extension Tests // class NoteLinkTests: XCTestCase { /// InMemory Storage! /// private let storage = MockupStorageManager() func testNoteInterlinkReferenceCount() { let (referencedNote, referencing) = insertSampleEntitiesWithI...
/content/code_sandbox/SimplenoteTests/NoteLinkTests.swift
swift
2016-08-11T15:55:22
2024-08-14T02:42:22
simplenote-ios
Automattic/simplenote-ios
2,038
361
```swift import XCTest @testable import Simplenote // MARK: - AuthenticationValidator Tests // class AuthenticationValidatorTests: XCTestCase { /// Testing Validator /// let validator = AuthenticationValidator() /// Verifies that `performUsernameValidation` returns `true` when the input string is val...
/content/code_sandbox/SimplenoteTests/AuthenticationValidatorTests.swift
swift
2016-08-11T15:55:22
2024-08-14T02:42:22
simplenote-ios
Automattic/simplenote-ios
2,038
457
```swift import Foundation import XCTest @testable import Simplenote // MARK: - NSPredicate+Email Unit Tests // class NSPredicateEmailTests: XCTestCase { /// Verifies that `predicateForEmailValidation` evaluates false whenever the input string is empty /// func testPredicateForEmailValidationEvaluatesFals...
/content/code_sandbox/SimplenoteTests/NSPredicateEmailTests.swift
swift
2016-08-11T15:55:22
2024-08-14T02:42:22
simplenote-ios
Automattic/simplenote-ios
2,038
474
```swift import XCTest @testable import Simplenote // MARK: - String Truncation Tests // class StringSimplenoteTests: XCTestCase { /// Verifies that `truncateWords(upTo:) ` returns the N first characters of the receiver, whenever there are no words in the specified range. /// func testTruncateWordsReturns...
/content/code_sandbox/SimplenoteTests/StringSimplenoteTests.swift
swift
2016-08-11T15:55:22
2024-08-14T02:42:22
simplenote-ios
Automattic/simplenote-ios
2,038
985
```swift @testable import Simplenote class MockTimerFactory: TimerFactory { var timer: MockTimer? override func scheduledTimer(with timeInterval: TimeInterval, completion: @escaping () -> Void) -> Timer { let timer = MockTimer() self.timer = timer timer.completion = completion ...
/content/code_sandbox/SimplenoteTests/MockTimerFactory.swift
swift
2016-08-11T15:55:22
2024-08-14T02:42:22
simplenote-ios
Automattic/simplenote-ios
2,038
137
```swift import XCTest @testable import Simplenote // MARK: - CGRect Tests // class CGRectSimplenoteTests: XCTestCase { /// Verifies that `splity(by:)` returns a zero height lower slice whenever the anchor has Zero location and Height /// func your_sha256_hashht() { let input = CGRect(x: .zero, y:...
/content/code_sandbox/SimplenoteTests/CGRectSimplenoteTests.swift
swift
2016-08-11T15:55:22
2024-08-14T02:42:22
simplenote-ios
Automattic/simplenote-ios
2,038
341
```objective-c // // Use this file to import your target's public headers that you would like to expose to Swift. // #import "Simplenote-Bridging-Header.h" ```
/content/code_sandbox/SimplenoteTests/SimplenoteTests-Bridging-Header.h
objective-c
2016-08-11T15:55:22
2024-08-14T02:42:22
simplenote-ios
Automattic/simplenote-ios
2,038
37
```swift import XCTest import SimplenoteFoundation @testable import Simplenote // MARK: - NotesListControllerTests // class NotesListControllerTests: XCTestCase { /// InMemory Storage! /// private let storage = MockupStorageManager() /// List Controller /// private var noteListController: Not...
/content/code_sandbox/SimplenoteTests/NotesListControllerTests.swift
swift
2016-08-11T15:55:22
2024-08-14T02:42:22
simplenote-ios
Automattic/simplenote-ios
2,038
4,101
```swift import XCTest @testable import Simplenote // MARK: - NoteScrollPositionCacheTests // class NoteScrollPositionCacheTests: XCTestCase { private lazy var storage = MockFileStorage<NoteScrollPositionCache.ScrollCache>(fileURL: URL(fileURLWithPath: "")) private lazy var cache = NoteScrollPositionCache(stor...
/content/code_sandbox/SimplenoteTests/NoteScrollPositionCacheTests.swift
swift
2016-08-11T15:55:22
2024-08-14T02:42:22
simplenote-ios
Automattic/simplenote-ios
2,038
409
```swift import Foundation import SimplenoteEndpoints @testable import Simplenote extension Remote { static func randomResult() -> Result<Data?, RemoteError> { if Bool.random() { return .success(nil) } return .failure(RemoteError(statusCode: 0, response: nil, networkError: nil)...
/content/code_sandbox/SimplenoteTests/RemoteResult+TestHelpers.swift
swift
2016-08-11T15:55:22
2024-08-14T02:42:22
simplenote-ios
Automattic/simplenote-ios
2,038
73
```swift import XCTest @testable import Simplenote // MARK: - EmailVerificationTests // class EmailVerificationTests: XCTestCase { func testEmailVerificationCorrectlyParsesToken() { let payload = [ "token": #"{"username": "1234"}"# ] let parsed = EmailVerification(payload: payl...
/content/code_sandbox/SimplenoteTests/EmailVerificationTests.swift
swift
2016-08-11T15:55:22
2024-08-14T02:42:22
simplenote-ios
Automattic/simplenote-ios
2,038
264
```swift import Foundation import XCTest @testable import Simplenote // MARK: - Options Unit Tests // class OptionsTests: XCTestCase { private let suiteName = OptionsTests.classNameWithoutNamespaces.debugDescription private lazy var defaults = UserDefaults(suiteName: suiteName)! override func setUp() { ...
/content/code_sandbox/SimplenoteTests/OptionsTests.swift
swift
2016-08-11T15:55:22
2024-08-14T02:42:22
simplenote-ios
Automattic/simplenote-ios
2,038
290
```swift import Foundation /// Unit Tests Constants /// struct Constants { /// Default Expectation Timeout /// static let expectationTimeout = TimeInterval(10) } ```
/content/code_sandbox/SimplenoteTests/Constants.swift
swift
2016-08-11T15:55:22
2024-08-14T02:42:22
simplenote-ios
Automattic/simplenote-ios
2,038
33
```swift import Foundation // MARK: - UserDefaults Extension Methods // extension UserDefaults { /// Resets all of the receiver's values /// func reset() { for (key, _) in dictionaryRepresentation() { removeObject(forKey: key) } synchronize() } } ```
/content/code_sandbox/SimplenoteTests/UserDefaults+Tests.swift
swift
2016-08-11T15:55:22
2024-08-14T02:42:22
simplenote-ios
Automattic/simplenote-ios
2,038
58
```swift import XCTest @testable import Simplenote // MARK: - NSMutableAttributedString Styling Tests // class NSMutableAttributedStringStylingTests: XCTestCase { /// Verifies that `NSRegularExpression.regexForChecklists` will not match checklists that are in the middle of a string /// func your_sha256_ha...
/content/code_sandbox/SimplenoteTests/NSMutableAttributedStringStylingTests.swift
swift
2016-08-11T15:55:22
2024-08-14T02:42:22
simplenote-ios
Automattic/simplenote-ios
2,038
1,313
```swift import Foundation import XCTest @testable import Simplenote // MARK: - NSString+Condensing Unit Tests // class NSStringCondensingTests: XCTestCase { /// Verifies that `replacingNewlinesWithSpaces` returns an empty string, whenever the receiver is an empty string /// func testReplaceNewlinesWithSp...
/content/code_sandbox/SimplenoteTests/NSStringCondensingTests.swift
swift
2016-08-11T15:55:22
2024-08-14T02:42:22
simplenote-ios
Automattic/simplenote-ios
2,038
429
```swift import XCTest @testable import Simplenote class UIColorSimplenoteTests: XCTestCase { func testUIColorFromHexStringReturnsCorrectColor() { //spBlue20 in RGB is r: 132 g: 164 b: 240 let spBlue20 = UIColor(hexString: "84a4f0") //gray5 in RGB is r: 220 g: 220 b: 222 let gray5 =...
/content/code_sandbox/SimplenoteTests/UIColorSimplenoteTests.swift
swift
2016-08-11T15:55:22
2024-08-14T02:42:22
simplenote-ios
Automattic/simplenote-ios
2,038
392
```swift import Foundation import CoreData @testable import Simplenote /// MockupStorageManager: InMemory CoreData Stack. /// class MockupStorageManager { /// DataModel Name /// private let name = "Simplenote" /// Returns the Storage associated with the View Thread. /// var viewContext: NSMan...
/content/code_sandbox/SimplenoteTests/MockupStorage.swift
swift
2016-08-11T15:55:22
2024-08-14T02:42:22
simplenote-ios
Automattic/simplenote-ios
2,038
639
```swift import XCTest @testable import Simplenote // MARK: - String Truncation Tests // class NoteBodyExcerptTests: XCTestCase { /// InMemory Storage! /// private let storage = MockupStorageManager() private let noteBody = "Download the latest version of Simplenote and youll be able to insert links ...
/content/code_sandbox/SimplenoteTests/NoteBodyExcerptTests.swift
swift
2016-08-11T15:55:22
2024-08-14T02:42:22
simplenote-ios
Automattic/simplenote-ios
2,038
654
```swift import XCTest @testable import Simplenote class NoticeControllerTests: XCTestCase { private lazy var presenter = MockNoticePresenter() private lazy var timerFactory = MockTimerFactory() private lazy var controller = NoticeController(presenter: presenter, timerFactory: timerFactory) func testS...
/content/code_sandbox/SimplenoteTests/NoticeControllerTests.swift
swift
2016-08-11T15:55:22
2024-08-14T02:42:22
simplenote-ios
Automattic/simplenote-ios
2,038
1,123
```swift import XCTest @testable import Simplenote // MARK: - PinLockRemoveControllerTests // class PinLockRemoveControllerTests: XCTestCase { private lazy var delegate = MockPinLockRemoveControllerDelegate() private lazy var pinLockManager = MockPinLockManager() private lazy var controller = PinLockRemove...
/content/code_sandbox/SimplenoteTests/PinLock/PinLockRemoveControllerTests.swift
swift
2016-08-11T15:55:22
2024-08-14T02:42:22
simplenote-ios
Automattic/simplenote-ios
2,038
478
```swift import XCTest @testable import Simplenote // MARK: - String Content Slice Tests // class StringContentSliceTests: XCTestCase { private let sampleExcerpt = "Download the latest version of Simplenote and youll be able to insert links from one note into another note to easily organize and cross-reference inf...
/content/code_sandbox/SimplenoteTests/StringContentSliceTests.swift
swift
2016-08-11T15:55:22
2024-08-14T02:42:22
simplenote-ios
Automattic/simplenote-ios
2,038
907
```swift import XCTest @testable import Simplenote // MARK: - PinLockBaseControllerTests // class PinLockBaseControllerTests: XCTestCase { private let controller = PinLockBaseController() private let configurationObserver = PinLockControllerConfigurationObserver() func your_sha256_hashon() { // Gi...
/content/code_sandbox/SimplenoteTests/PinLock/PinLockBaseControllerTests.swift
swift
2016-08-11T15:55:22
2024-08-14T02:42:22
simplenote-ios
Automattic/simplenote-ios
2,038
202
```swift import XCTest @testable import Simplenote // MARK: - PinLockSetupControllerTests // class PinLockSetupControllerTests: XCTestCase { private lazy var delegate = MockPinLockSetupControllerDelegate() private lazy var pinLockManager = MockPinLockManager() private lazy var controller = PinLockSetupCont...
/content/code_sandbox/SimplenoteTests/PinLock/PinLockSetupControllerTests.swift
swift
2016-08-11T15:55:22
2024-08-14T02:42:22
simplenote-ios
Automattic/simplenote-ios
2,038
651
```swift import Foundation @testable import Simplenote // MARK: - PinLockControllerConfigurationObserver // class PinLockControllerConfigurationObserver { var lastConfiguration: PinLockControllerConfiguration? { configurations.last } var lastAnimation: UIView.ReloadAnimation? { animations....
/content/code_sandbox/SimplenoteTests/PinLock/Helpers/PinLockControllerConfigurationObserver.swift
swift
2016-08-11T15:55:22
2024-08-14T02:42:22
simplenote-ios
Automattic/simplenote-ios
2,038
161
```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
```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
```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
```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
```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
```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