HackingWithSwift | The project source code for hackingwithswift.com
kandi X-RAY | HackingWithSwift Summary
kandi X-RAY | HackingWithSwift Summary
The project source code for hackingwithswift.com
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of HackingWithSwift
HackingWithSwift Key Features
HackingWithSwift Examples and Code Snippets
Community Discussions
Trending Discussions on HackingWithSwift
QUESTION
I have a pdf that I'm downloading from an api to the local device and trying to use PDFView as I'm trying to not use webview for anything,
my issue is when I get to the PDFView part, I'm following this tutorial. and I'm stuck on the PdfDocument piece. It keeps saying the path is null.
...ANSWER
Answered 2021-Jun-08 at 22:24The problem is for sure in this line, and I think it should be:
QUESTION
I checked this tutorial https://www.hackingwithswift.com/forums/swiftui/nested-json/4018 to fix a nested json issue.
My JSON source has changed from
...ANSWER
Answered 2021-Apr-28 at 18:26If you decode News
you have to assign the items
array to Novitadss
QUESTION
The problem has been solved by 'hackingwithswift' website
Just follow the steps on the link! "https://www.hackingwithswift.com/books/ios-swiftui/one-to-many-relationships-with-core-data-swiftui-and-fetchrequest"
original ask
I would like to use elements of [relationship]
But whatever I try, it doesn't work..
There is something, what I missed and, sadly I don't know what that would be until now :/
First of all, I want to show my core data model and code.
Entity: Page, Attribute: name(String), relationship: toCard
Entity: Card, Attribute: title(String), price(Double), relationship: toPage
Scenario: Page has multiple cards
One to Many (One page to many cards)
ANSWER
Answered 2021-May-02 at 13:44I solved this problem with help from this awesome 'hackingwithswift' website! Just follow the steps on the link!
Edited:
Goto .xcdatamodeld file
Click Entity -> Class -> Codezen to Manual/None
Editor -> Create NSManagedObject Subclass
Add in Page+CoreDataProperties.swift
QUESTION
I have a class A that has a "to many" relationship with B. A and its Bs are fetched from a REST endpoint, we use this approach to create the objects.
A has a unique ID and some other properties (not shown in the example). B has an ID (bID) that is unique when combined with A, and a relationship to A called a. For A the constraint is "uniqueID". For B, the constraint is "a, bID" - we want each B to only exist for each combination of A and bID. The delete rule for A to its Bs is "Cascade". The merge policy for the context and all child contexts is NSOverwriteMergePolicy
.
The code looks something like this:
...ANSWER
Answered 2021-Apr-14 at 04:49I'm using the following extension to solve this problem:
QUESTION
I'm using a UIHostingController
to embed ContentView
inside ViewController
. I want to change the name of ContentView
's name
when the "Change name" button is pressed. Here's my code:
ANSWER
Answered 2021-Apr-07 at 04:09QUESTION
How can I add hyperlinked text in a UITextView so that when it is clicked, a custom function in my app is called. Basically, my intention is to show a little popup window that gives more information on the clicked-upon word(s), similar to how Wikipedia works –
I read in this Hacking With Swift article that you can "use custom URL schemes, e.g. yourapp://" in attributed text, but I'm confused how yourapp://... links to a particular function within your app? What would my URL
be?
The code they talk about in the article is:
...ANSWER
Answered 2021-Mar-19 at 21:24Your URL can be whatever you want as long as you have a way to parse/compare it in your shouldInteractWith
function:
For example, you might make it myapp://ACTION_NAME
QUESTION
I want to crop out a portion of a view. I followed this article: "How to mask one UIView using another UIView", and this is my code currently:
...ANSWER
Answered 2021-Mar-14 at 05:22It’s all in the transparency of the colors you paint the mask with. (The hues — what we usually think of as color — are irrelevant.) The masking depends upon the degree of transparency. Areas of the mask that are partially transparent will make the masked view be partially transparent.
So make the mask the whole size of the target view, and make the whole mask a partially transparent color, except for the central area which is an opaque color.
QUESTION
I'm learning how to make games in iOS, so I decided to replicate the first level of Mario Bros using my own assets, just to learn how to make them as well.
The issue I'm having right now is that, when creating the scrolling background, using this formula I found on Hacking with Swift, I keep getting a line in between my images.
I've checked that my images have no border in the AI file. (The images are the ones above)
...ANSWER
Answered 2021-Mar-10 at 22:19Your image has a thin black border on the left handside and along the top, 1 pixel wide. It's black. Remove that and try again.
QUESTION
I am following this tutorial on Coordinator pattern, and so far I have it going through creating the coordinator and running the start() from app delegate. But then calling a function on that coordinator doesn't work, because suddenly the coordinator var is nil. It seems that the initial view controller that is shown is not the one coming from the coordinator.start() but rather the one from the storyboard entry point. I did disable the Main in the main interface of the projects target.
AppDelegate:
...ANSWER
Answered 2021-Mar-01 at 21:40The problem is merely that the tutorial you're looking at is too old for current conditions. There is no Single View App template any more, and the App Delegate no longer contains the window. If you create a project in Xcode 11 or Xcode 12, the window is owned by the scene delegate. Implement the scene delegate's willConnect
method to do the work that the app delegate was doing in the tutorial, and everything will spring to life.
Also the mechanism for preventing Main.storyboard from trying to load automatically has changed; you have to remove it from Application Scene Manifest in the Info.plist (editing by hand — there is no simple interface).
QUESTION
I am trying to reset my ScrollView when the user selects a tab. The problem is all the tutorials are for buttons nested inside the ScrollView. My ScrollView is completely separate from where I need to tap to reset the ScrollView.
I found this tutorial - https://www.hackingwithswift.com/forums/swiftui/have-a-button-outside-of-scrollviewreader-be-able-to-scroll-the-scrollview-to-a-position/2741
Yet I get the error "Cannot find proxy in scope".
...ANSWER
Answered 2021-Feb-23 at 19:34Adapting the example from the link in the question, your code can look like this:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install HackingWithSwift
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page