diff --git a/ios/.gitignore b/ios/.gitignore new file mode 100644 index 0000000..d386c40 --- /dev/null +++ b/ios/.gitignore @@ -0,0 +1,92 @@ +# Created by .ignore support plugin (hsz.mobi) +### Swift template +# Xcode +# +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + +## User settings +xcuserdata/ + +## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) +*.xcscmblueprint +*.xccheckout + +## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) +build/ +DerivedData/ +*.moved-aside +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 + +## Obj-C/Swift specific +*.hmap + +## App packaging +*.ipa +*.dSYM.zip +*.dSYM + +## Playgrounds +timeline.xctimeline +playground.xcworkspace + +# Swift Package Manager +# +# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. +# Packages/ +# Package.pins +# Package.resolved +# *.xcodeproj +# +# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata +# hence it is not needed unless you have added a package configuration file to your project +# .swiftpm + +.build/ + +# CocoaPods +# +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control +# +# Pods/ +# +# Add this line if you want to avoid checking in source code from the Xcode workspace +# *.xcworkspace + +# Carthage +# +# Add this line if you want to avoid checking in source code from Carthage dependencies. +# Carthage/Checkouts + +Carthage/Build/ + +# Accio dependency management +Dependencies/ +.accio/ + +# fastlane +# +# It is recommended to not store the screenshots in the git repo. +# Instead, use fastlane to re-generate the screenshots whenever they are needed. +# For more information about the recommended setup visit: +# https://docs.fastlane.tools/best-practices/source-control/#source-control + +fastlane/report.xml +fastlane/Preview.html +fastlane/screenshots/**/*.png +fastlane/test_output + +# Code Injection +# +# After new code Injection tools there's a generated folder /iOSInjectionProject +# https://github.com/johnno1962/injectionforxcode + +iOSInjectionProject/ diff --git a/ios/circolapp/Podfile b/ios/circolapp/Podfile new file mode 100644 index 0000000..ab2b1c5 --- /dev/null +++ b/ios/circolapp/Podfile @@ -0,0 +1,7 @@ +target 'circolapp' do + # Comment the next line if you don't want to use dynamic frameworks + use_frameworks! + platform :ios, '14.2' + # Pods for iosApp + pod 'shared', :path => '../../shared' +end \ No newline at end of file diff --git a/ios/circolapp/Podfile.lock b/ios/circolapp/Podfile.lock new file mode 100644 index 0000000..ec5b81a --- /dev/null +++ b/ios/circolapp/Podfile.lock @@ -0,0 +1,23 @@ +PODS: + - HTMLKit (3.1.0) + - shared (1.0): + - HTMLKit (~> 3.1.0) + +DEPENDENCIES: + - shared (from `../../shared`) + +SPEC REPOS: + trunk: + - HTMLKit + +EXTERNAL SOURCES: + shared: + :path: "../../shared" + +SPEC CHECKSUMS: + HTMLKit: 4ed10a911462cbf972329ec6aaaa827208dfd70c + shared: fb3154b4def038b2b13aa88e01dd9f91bb2de9b5 + +PODFILE CHECKSUM: 90ac34abdd7012dde25705873407c94d0f26fa6b + +COCOAPODS: 1.10.0 diff --git a/ios/circolapp/Pods/HTMLKit/LICENSE b/ios/circolapp/Pods/HTMLKit/LICENSE new file mode 100644 index 0000000..f6d94e3 --- /dev/null +++ b/ios/circolapp/Pods/HTMLKit/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Iskandar Abudiab + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/ios/circolapp/Pods/HTMLKit/README.md b/ios/circolapp/Pods/HTMLKit/README.md new file mode 100644 index 0000000..bb2a1f7 --- /dev/null +++ b/ios/circolapp/Pods/HTMLKit/README.md @@ -0,0 +1,325 @@ +# HTMLKit + +![HTMLKit Logo](https://raw.githubusercontent.com/iabudiab/HTMLKit/master/HTMLKit.png) + +An Objective-C framework for your everyday HTML needs. + +[![Build Status](https://img.shields.io/travis/iabudiab/HTMLKit/develop.svg?style=flat)](https://travis-ci.org/iabudiab/HTMLKit) +[![codecov](https://codecov.io/gh/iabudiab/HTMLKit/branch/develop/graph/badge.svg)](https://codecov.io/gh/iabudiab/HTMLKit) +[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) +[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/HTMLKit.svg?style=flat)](https://cocoapods.org/pods/HTMLKit) +[![CocoaDocs](https://img.shields.io/cocoapods/metrics/doc-percent/HTMLKit.svg?style=flat)](http://cocoadocs.org/docsets/HTMLKit) +[![Platform](https://img.shields.io/cocoapods/p/HTMLKit.svg?style=flat)](http://cocoadocs.org/docsets/HTMLKit) +[![License MIT](https://img.shields.io/badge/license-MIT-4481C7.svg?style=flat)](https://opensource.org/licenses/MIT) + +- [Quick Overview](#overview) +- [Installation](#installation) +- [Parsing](#parsing) +- [The DOM](#the-dom) +- [CSS3 Selectors](#css3-selectors) + +# Quick Overview + +HTMLKit is a [WHATWG specification](https://html.spec.whatwg.org/multipage/)-compliant framework for parsing and serializing HTML documents and document fragments for iOS and OSX. HTMLKit parses real-world HTML the same way modern web browsers would. + +HTMLKit provides a rich DOM implementation for manipulating and navigating the document tree. It also understands [CSS3 selectors](http://www.w3.org/TR/css3-selectors/) making node-selection and querying the DOM a piece of cake. + +## DOM Validation + +DOM mutations are validated as described in the [WHATWG DOM Standard](https://dom.spec.whatwg.org). Invalid DOM manipulations throw hierarchy-related exceptions. You can disable these validations, which will also increase the performance by about 20-30%, by defining the `HTMLKIT_NO_DOM_CHECKS` compiler constant. + +## Tests + +HTMLKit passes all of the [HTML5Lib](https://github.com/html5lib/html5lib-tests) Tokenizer and Tree Construction tests. The `html5lib-tests` is configured as a git-submodule. If you plan to run the tests, do not forget to pull it too. + +The CSS3 Selector implementation is tested with an adapted version of the [CSS3 Selectors Test Suite](http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/full/flat/index.html), ignoring the tests that require user interaction, session history, and scripting. + +## Does it Swift? + +Check out the playground! + +# Installation + +## Carthage + +[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. + +If you don't have Carthage yet, you can install it with Homebrew using the following command: + +```bash +$ brew update +$ brew install carthage +``` + +To add `HTMLKit` as a dependency into your project using Carthage just add the following line in your `Cartfile`: + +``` +github "iabudiab/HTMLKit" +``` + +Then run the following command to build the framework and drag the built `HTMLKit.framework` into your Xcode project. + +```bash +$ carthage update +``` + +## CocoaPods + +[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. + +If you don't have CocoaPods yet, you can install it with the following command: + +```bash +$ gem install cocoapods +``` + +To add `HTMLKit` as a dependency into your project using CocoaPods just add the following in your `Podfile`: + +```ruby +target 'MyTarget' do + pod 'HTMLKit', '~> 3.1' +end +``` + +Then, run the following command: + +```bash +$ pod install +``` + +## Swift Package Manager + +[Swift Package Manager](https://github.com/apple/swift-package-manager) is the package manager for the Swift programming language. + +Add `HTMLKit` to your `Package.swift` dependecies: + +```swift +.Package(url: "https://github.com/iabudiab/HTMLKit", majorVersion: 3) +``` + +Then run: + +```bash +$ swift build +``` + +## Manually + +1- Add `HTMLKit` as git submodule + +```bash +$ git submodule add https://github.com/iabudiab/HTMLKit.git +``` + +2- Open the `HTMLKit` folder and drag'n'drop the `HTMLKit.xcodeproj` into the Project Navigator in Xcode to add it as a sub-project. + +3- In the General panel of your target add `HTMLKit.framework` under the `Embedded Binaries` + +# Parsing + +## Parsing Documents + +Given some HTML content, you can parse it either via the `HTMLParser` or instatiate a `HTMLDocument` directly: + +```objective-c +NSString *htmlString = @"

HTMLKit

Hello there!

"; + +// Via parser +HTMLParser *parser = [[HTMLParser alloc] initWithString:htmlString]; +HTMLDocument *document = [parser parseDocument]; + +// Via static initializer +HTMLDocument *document = [HTMLDocument documentWithString:htmlString]; +``` + +## Parsing Fragments + +You can also prase HTML content as a document fragment with a specified context element: + +```objective-c +NSString *htmlString = @"

HTMLKit

Hello there!

"; + +HTMLParser *parser = [[HTMLParser alloc] initWithString: htmlString]; + +HTMLElement *tableContext = [[HTMLElement alloc] initWithTagName:@"table"]; +NSArray *nodes = [parser parseFragmentWithContextElement:tableContext]; + +for (HTMLNode *node in nodes) { + NSLog(@"%@", node.outerHTML); +} + +// The same parser instance can be reusued: +HTMLElement *bodyContext = [[HTMLElement alloc] initWithTagName:@"body"]; +nodes = [parser parseFragmentWithContextElement:bodyContext]; +``` + +# The DOM + +The DOM tree can be manipulated in several ways, here are just a few: + +* Create new elements and assign attributes + +```objective-c +HTMLElement *description = [[HTMLElement alloc] initWithTagName:@"meta" attributes: @{@"name": @"description"}]; +description[@"content"] = @"HTMLKit for iOS & OSX"; +``` + +* Append nodes to the document + +```objective-c +HTMLElement *head = document.head; +[head appendNode:description]; + +HTMLElement *body = document.body; +NSArray *nodes = @[ + [[HTMLElement alloc] initWithTagName:@"div" attributes: @{@"class": @"red"}], + [[HTMLElement alloc] initWithTagName:@"div" attributes: @{@"class": @"green"}], + [[HTMLElement alloc] initWithTagName:@"div" attributes: @{@"class": @"blue"}] +]; +[body appendNodes:nodes]; +``` + +* Enumerate child elements and perform DOM editing + +```objective-c +[body enumerateChildElementsUsingBlock:^(HTMLElement *element, NSUInteger idx, BOOL *stop) { + if ([element.tagName isEqualToString:@"div"]) { + HTMLElement *lorem = [[HTMLElement alloc] initWithTagName:@"p"]; + lorem.textContent = [NSString stringWithFormat:@"Lorem ipsum: %lu", (unsigned long)idx]; + [element appendNode:lorem]; + } +}]; +``` + +* Remove nodes from the document + +```objective-c +[body removeChildNodeAtIndex:1]; +[head removeAllChildNodes]; +[body.lastChild removeFromParentNode]; +``` + +* Manipulate the HTML directly + +```objective-c +greenDiv.innerHTML = @"