<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[1v1Me Blog - Medium]]></title>
        <description><![CDATA[Making money playing video games is the problem. Architecture, a focus on our players, &amp; the best team in the world is how we are solving it. If you’re interested in joining our team, email anthony@1v1me.com. - Medium]]></description>
        <link>https://medium.com/1v1me-blog?source=rss----dabb47ee62e5---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>1v1Me Blog - Medium</title>
            <link>https://medium.com/1v1me-blog?source=rss----dabb47ee62e5---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 06:22:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/1v1me-blog" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[A Slimmer Approach To Moya]]></title>
            <link>https://medium.com/1v1me-blog/a-slimmer-approach-to-moya-3de6a62f9bdb?source=rss----dabb47ee62e5---4</link>
            <guid isPermaLink="false">https://medium.com/p/3de6a62f9bdb</guid>
            <category><![CDATA[boilerplate]]></category>
            <category><![CDATA[moya]]></category>
            <category><![CDATA[swift]]></category>
            <dc:creator><![CDATA[Quinton Pryce]]></dc:creator>
            <pubDate>Fri, 25 Aug 2023 19:30:59 GMT</pubDate>
            <atom:updated>2023-08-25T22:29:06.169Z</atom:updated>
            <content:encoded><![CDATA[<p>We have been using Moya since our inception. However simple their framework, their recommendation for API definition creates many many lines of boilerplate, and has me feeling like oh-no-this-can’t-be-good, after forgetting I’ve got food in the oven.</p><p>But mark it on the calendar, because today we will no longer create boilerplate and no longer forget we are cooking (…yes we will, who are we kidding).</p><h3>Moya</h3><p>Have a look at the example below. For a simple <strong>get</strong> request, we just wrote the request name 5 times (a big no no, if you can help it).</p><p>Having boilerplate isn’t always the worst, but if feels real bad when this enum starts to grow and you have to scroll through hundreds of lines to add a single request.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/416892951c229c6eb972714fc089a3cd/href">https://medium.com/media/416892951c229c6eb972714fc089a3cd/href</a></iframe><p>I hope if you’ve written something similar to this you’re now saying “why have I dealt with this for so long”.</p><h3>Our New Approach</h3><p>You can see with the example below how SLEEK this got. Every request can be fully digested in one line, new items can be added with as little as 3 lines as compared to 9 lines in Moya’s recommended solution, and we get to use this nice dot notation that we are all loving in SwiftUI.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b04ac244ec7292ba97f1f3b2390dd541/href">https://medium.com/media/b04ac244ec7292ba97f1f3b2390dd541/href</a></iframe><h3>My Blogs-Need-Conclusions Conclusion</h3><p>I don’t really want to tell you how many lines this saved me but it does rhyme with burmalurgadura<strong>thousand</strong>. I’ve got a can’t stop-won’t stop attitude toward removing boilerplate, especially when it starts to form an enum that is too large to view on my teeny-tiny Macbook screen.</p><p>*Bows Deeply*</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3de6a62f9bdb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/1v1me-blog/a-slimmer-approach-to-moya-3de6a62f9bdb">A Slimmer Approach To Moya</a> was originally published in <a href="https://medium.com/1v1me-blog">1v1Me Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Live Activities in iOS with FCM & APNS]]></title>
            <link>https://medium.com/1v1me-blog/live-activities-in-ios-with-fcm-apns-f2aace55c616?source=rss----dabb47ee62e5---4</link>
            <guid isPermaLink="false">https://medium.com/p/f2aace55c616</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[live-activities]]></category>
            <category><![CDATA[dynamic-island]]></category>
            <dc:creator><![CDATA[Quinton Pryce]]></dc:creator>
            <pubDate>Tue, 04 Jul 2023 16:05:47 GMT</pubDate>
            <atom:updated>2023-07-04T16:04:29.151Z</atom:updated>
            <content:encoded><![CDATA[<p>If you came here because you wanted to use FCM to update your live activity, I’m sorry. At the time of this article, FCM does not currently support custom payloads. However! 1v1Me uses FCM &amp; we spent less than a day writing the code to use APS directly AND YOU CAN TOO! 🥳</p><p>We had a few challenges with this project:</p><ul><li>The Apple docs are incomplete (<a href="https://feedbackassistant.apple.com/feedback/12336302">and have the wrong keys</a>)</li><li>The payload is finicky &amp; difficult to debug decoding errors</li><li>Using network images is undocumented &amp; not obvious</li></ul><p>This blog isn’t going to provide detailed, step-by-step guidance. Rather, it will highlight some of the difficulties we encountered. So I highly recommend familiarizing yourself with the Apple docs first.</p><h3>Getting Your APNS Token</h3><p>When a new activity is created, a new push token is generated and we subscribe to the corresponding live activity via our subscribeToLiveActivity method.</p><pre>@available(iOS 16.2, *)<br>private func start(attributes: EventActivityAttributes, state: EventActivityAttributes.EventState) {<br>    do {<br>        //…<br>        <br>        let activity = try Activity&lt;EventActivityAttributes&gt;.request(<br>            attributes: attributes,<br>            content: content,<br>            pushType: .token<br>        )<br>        <br>        Log.d(&quot;Requested an Event Activity \(activity.id)&quot;)<br>        Task {<br>            for await data in activity.pushTokenUpdates {<br>                let token = data.map { String(format: &quot;%02x&quot;, $0) }.joined()<br>                <br>                Service.stake.subscribeToLiveActivity(eventId: attributes.eventId, token: token, completion: { _ in })<br>            }<br>        }<br>        <br>    } catch {<br>        Log.d(&quot;Error requesting Event Activity \(error.localizedDescription) \(error)&quot;)<br>    }<br>}</pre><p>This method collects token updates asynchronously, with each update containing raw bytes that we convert to a string representation of the hexadecimal value. The resulting string (the token) is then used to subscribe to the live activity with our backend, which will be making use of push notifications to update our live activity.</p><h3>Decoding/Encoding</h3><p>Let’s shift our focus to the ContentState struct. The widget uses this (and the ActivityAttributes) to receive and decode data from your app &amp; your server. The Coding aspect of our live activity caused us a few headaches to say the least (it took longer to dubug this then anything else in the project…).</p><h4>Debugging Issues</h4><p>Debugging the widget can be difficult. I highly recommend writing a custom initializer for your content state and printing any of your debugging errors with the error information to the console. Apple does let you know there is an error in your console, but it won’t give you the specifics needed to debug the issue (ex. which key is the offending member in decoding errors).</p><pre>init(from decoder: Decoder) throws {<br>        do {<br>            //...<br>        } catch let DecodingError.dataCorrupted(context) {<br>            print(context)<br>            throw DecodingError.dataCorrupted(context)<br>        } catch let DecodingError.keyNotFound(key, context) {<br>            print(&quot;Key &#39;\(key)&#39; not found:&quot;, context.debugDescription)<br>            print(&quot;codingPath:&quot;, context.codingPath)<br>            throw DecodingError.keyNotFound(key, context)<br>        } catch let DecodingError.valueNotFound(value, context) {<br>            print(&quot;Value &#39;\(value)&#39; not found:&quot;, context.debugDescription)<br>            print(&quot;codingPath:&quot;, context.codingPath)<br>            throw DecodingError.valueNotFound(value, context)<br>        } catch let DecodingError.typeMismatch(type, context) {<br>            print(&quot;Type &#39;\(type)&#39; mismatch:&quot;, context.debugDescription)<br>            print(&quot;codingPath:&quot;, context.codingPath)<br>            throw DecodingError.typeMismatch(type, context)<br>        } catch {<br>            print(&quot;error: &quot;, error)<br>            throw error<br>        }<br>    }</pre><h4>Custom Decoding &amp; Dates</h4><p>When your app initializes the struct, it will use Apple’s default encoding strategies. So if you decode an object that is shared between the two targets with a date (for example) and want to encode that date, your widget will not be able to decode it. I tried many many ways around this (widget target only custom decoders, app only targeted encoders), but nothing worked. The only way around this was to define a new “Widget Safe Struct” (ie. not containing any custom types) and using it to send data to your widget.</p><p>When you receive any dates in your ContentState, they either need to match the default date format Apple has provided or you can use a TimeInterval/ Double and convert in inside the widget to a Date if you need it.</p><pre>struct ContentState: Codable, Hashable {<br>    //…<br>    <br>    init(from decoder: Decoder) throws {<br>        do {<br>            let container = try decoder.container(keyedBy: CodingKeys.self)<br>            <br>            let epochStartDate = try container.decode(Double.self, forKey: .startDate)<br>            startDate = Date(timeIntervalSince1970: epochStartDate)<br>            <br>            //…<br>        } catch {<br>            throw error<br>        }<br>    }<br>    <br>    //…<br>}</pre><p><em>We use the Date object heavily in the live activity, so we decode the Double into a date object.</em></p><h4>Passing Large Content States (Images)</h4><p>The content state is limited to 4mb, which means you can’t encode image data. We’ll talk about how to fix this in the next section.</p><h3>Using URL/Network Images</h3><p>We use a lot of network images at 1v1Me, and it was a requirement for us to be able to send them.</p><p>Nowhere in the docs does it mention how to use network images, but it was asked in a live coding session in a WWDC session &amp; the answer they gave was that the best solution is to use App Groups &amp; UserDefaults. The following is a simple implementation of that:</p><h4>Our Live Activities Network Image View</h4><pre>struct NetworkImage: View {<br>    let url: URL?<br>    var renderingMode: Image.TemplateRenderingMode = .original<br>    var placeholder: Image?<br>    <br>    var body: some View {<br>        Group {<br>            if let url = url, let imageData = UserDefaults.appGroupsDefaults?.data(forKey: url.absoluteString),<br>               let uiImage = UIImage(data: imageData)?.resized(toWidth: 300)?.withRenderingMode(renderingMode == .original ? .alwaysOriginal : .alwaysTemplate) {<br>                Image(uiImage: uiImage)<br>                 .resizable()<br>                <br>            } else if let placeholder {<br>                placeholder.foregroundColor(.theme.gray3)<br>            } else {<br>                Spacer()<br>            }<br>        }<br>    }<br>}<br><br>// Many of our imagery tends to be larger than the<br>// max size Apple has in place (1400x500px)<br>extension UIImage {<br>    func resized(toWidth width: CGFloat, isOpaque: Bool = false) -&gt; UIImage? {<br>        let canvas = CGSize(width: width, height: CGFloat(ceil(width/size.width * size.height)))<br>        let format = imageRendererFormat<br>        format.opaque = isOpaque<br>        return UIGraphicsImageRenderer(size: canvas, format: format).image { _ in<br>            draw(in: CGRect(origin: .zero, size: canvas))<br>        }<br>    }<br>}<br><br>extension UserDefaults {<br>    static var appGroupsDefaults: UserDefaults? = UserDefaults(suiteName: &quot;group.com.widgets.images&quot;)<br>}</pre><h4>Our Upload Technique For Network Images</h4><p>We use KingFisher in our main app, but you can use whatever method you use to download images (ie. URLSession).</p><pre>func downloadAndStoreInAppGroup(url: URL?) async {<br>    guard let url else { return }<br>    await withCheckedContinuation { continuation in<br>        KingfisherManager.shared.retrieveImage(with: url, options: nil, progressBlock: nil, completionHandler: { result in<br>            // Log.t(&quot;Downloaded image from Kingfisher for Widget \(result)&quot;)<br>            switch result {<br>            case .success(let imageResult):<br>                guard let data = imageResult.data() else { return }<br>                Current.appGroupDefaults?.set(data, forKey: url.absoluteString)<br>                <br>            case .failure:<br>                break<br>            }<br>            <br>            continuation.resume()<br>        })<br>    }<br>}</pre><h3>Server Side Formatting</h3><p>We are using CURB for our HTTP Library which you’ll need to add or use something similar. Ensure that you have added your appropriate Service Key which can be generated on the Apple Developer Portal.</p><p>Nothing special about this implementation other than the formatting that we’ve included below &amp; the push URLs that you’ll need for sandbox (Debug iOS builds) and production (Release iOS builds).</p><pre>SANDBOX_PUSH_URL = &#39;https://api sandbox push apple com:443/3/device/%s&#39; freeze<br>PRODUCTION_PUSH_URL = &#39;https://api push apple com:443/3/device/%s&#39; freeze<br><br>ACTIVITY_EVENT_TYPES = {<br>  update: &#39;update&#39;,<br>  end: &#39;end&#39;<br>  } freeze<br><br>def self live_activity(device_token, event, relevancy_score, dismissal_date, content_state = {}, alert = {})<br>  ec_key = OpenSSL::PKey::EC new(AppleKeys push_key_private)<br>  jwt_token = JWT encode({ iss: ENV[&#39;APPLE_TEAM_ID&#39;], iat: Time now to_i }, ec_key, &#39;ES256&#39;, { kid: ENV[&#39;APNS_KEY_ID&#39;] })<br><br>  payload = {<br>  aps: {<br>  alert: alert,<br>  timestamp: Time now to_i,<br>  event: event,<br>  &#39;relevance-score&#39; =&gt; relevancy_score,<br>  &#39;content-state&#39; =&gt; content_state<br>  }<br>  }<br><br>  payload[:aps][&#39;dismissal-date&#39;] = dismissal_date unless dismissal_date nil?<br><br>  http = Curl::Easy http_post(format(ENV[&#39;PUSH_URL&#39;], device_token), payload to_json) do |curl|<br>  curl headers[&#39;Content-Type&#39;] = &#39;application/json&#39;<br>  curl headers[&#39;Accept&#39;] = &#39;application/json&#39;<br>  curl headers[&#39;apns-topic&#39;] = &quot;#{ENV[&#39;BUNDLE_ID&#39;]} push-type liveactivity&quot;<br>  curl headers[&#39;apns-priority&#39;] = &#39;10&#39;<br>  curl headers[&#39;apns-push-type&#39;] = &#39;liveactivity&#39;<br>  curl headers[&#39;Authorization&#39;] = &quot;Bearer #{jwt_token}&quot;<br>  end<br><br>  raise &quot;Error sending live activity push notification: #{http body}&quot; unless http response_code &lt;= 299<br><br>  true<br>  end</pre><h3>Conclusion</h3><p>In conclusion, implementing Live Activities can significantly enrich the user experience of your app by extending it to the Lock Screen &amp; Dynamic Island. However, this feature comes with its unique set of challenges. Throughout this post, we have delved into these challenges, sharing our experiences and solutions we’ve discovered along the way. From addressing incomplete Apple documentation to dealing with issues related to encoding/decoding and server-side formatting.</p><p>Our hope is that this blog post will act as a valuable guide to illuminate some of these technical intricacies and make the process of adding a Live Activity to your app a much smoother one. As with any technical implementation, continual learning and adjustment are essential, so keep exploring and innovating!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f2aace55c616" width="1" height="1" alt=""><hr><p><a href="https://medium.com/1v1me-blog/live-activities-in-ios-with-fcm-apns-f2aace55c616">Live Activities in iOS with FCM &amp; APNS</a> was originally published in <a href="https://medium.com/1v1me-blog">1v1Me Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Bottom Sheet in SwiftUI with a Scrolling Option]]></title>
            <link>https://medium.com/1v1me-blog/building-a-bottom-sheet-in-swiftui-with-a-scrolling-option-201bf24bb216?source=rss----dabb47ee62e5---4</link>
            <guid isPermaLink="false">https://medium.com/p/201bf24bb216</guid>
            <category><![CDATA[swiftui]]></category>
            <category><![CDATA[bottomsheet]]></category>
            <category><![CDATA[swift]]></category>
            <dc:creator><![CDATA[Quinton Pryce]]></dc:creator>
            <pubDate>Thu, 01 Jun 2023 20:05:44 GMT</pubDate>
            <atom:updated>2023-06-01T20:05:44.170Z</atom:updated>
            <content:encoded><![CDATA[<p>As the modern user interface leans towards more gesture-based navigation, it&#39;s common to encounter the &quot;bottom sheet&quot; interface — a card that slides up from the bottom covering part of the screen. In this post, we&#39;ll look at creating a customizable bottom sheet in SwiftUI, and we will even add the ability to handle large content by making it scrollable.</p><h3>Creating a Basic Bottom Sheet</h3><p>First, we start by creating the BottomSheet struct. This struct is a SwiftUI View that takes a title, a BottomSheetCloser and a closure for the content of the sheet. The BottomSheetCloser is an ObservableObject that provides a simple interface to open and close the sheet.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9dafc231011ba54c757b3ba372c92559/href">https://medium.com/media/9dafc231011ba54c757b3ba372c92559/href</a></iframe><p>The bottom sheet is presented as a ZStack with a semi-transparent black background and the sheet itself. The sheet uses a GeometryReader to adjust the offset for the slide-up animation.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1da6ecfc9537066cdca2e453697073d2/href">https://medium.com/media/1da6ecfc9537066cdca2e453697073d2/href</a></iframe><h3>Adding Scrolling Capability</h3><p>For larger contents, the bottom sheet may end up taking too much of the screen real estate. This is where the ScrollingBottomSheet comes in. This struct is a wrapper around the BottomSheet that makes the content scrollable when it exceeds a certain height. The decision to use either a plain content or a ScrollView is done dynamically based on the calculated content height.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a2a2ac4f94bc57ce0c55794a69acb6df/href">https://medium.com/media/a2a2ac4f94bc57ce0c55794a69acb6df/href</a></iframe><p>The content height is calculated using a GeometryReader overlay on the content. This overlay doesn&#39;t affect the content&#39;s appearance or interaction but allows us to read its size.</p><h3>The Future: Swipe to Dismiss &amp; Improvements</h3><p>There&#39;s always room for improvement and expansion. One potential enhancement could be the ability to swipe down the sheet to dismiss it.</p><p>In the time I spent looking at this code, I only now realize there are some things in here that not all bottom sheets have (title, backgrounds, close buttons). These could be generalized away, but for 1v1Me it makes it easy to spin up a consistent header &amp; background for the sheets without having to constantly use “ThemedBottomSheet.swift” all the time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=201bf24bb216" width="1" height="1" alt=""><hr><p><a href="https://medium.com/1v1me-blog/building-a-bottom-sheet-in-swiftui-with-a-scrolling-option-201bf24bb216">Building a Bottom Sheet in SwiftUI with a Scrolling Option</a> was originally published in <a href="https://medium.com/1v1me-blog">1v1Me Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Customizing SwiftUI Buttons With ButtonStyle]]></title>
            <link>https://medium.com/1v1me-blog/customizing-swiftui-buttons-with-buttonstyle-9b32e7f41c97?source=rss----dabb47ee62e5---4</link>
            <guid isPermaLink="false">https://medium.com/p/9b32e7f41c97</guid>
            <category><![CDATA[swiftui]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[haptics]]></category>
            <dc:creator><![CDATA[Quinton Pryce]]></dc:creator>
            <pubDate>Mon, 19 Dec 2022 23:18:58 GMT</pubDate>
            <atom:updated>2022-12-19T23:18:58.584Z</atom:updated>
            <content:encoded><![CDATA[<p>SwiftUI’s <strong>ButtonStyle</strong> can be a really powerful configuration tool to make quick &amp; concise buttons for your app.</p><p><strong>ButtonStyles </strong>let us define a set of modifiers to apply to a button in one line <em>(theming, animations, </em><strong><em>haptics</em></strong><em>, etc.)</em>.</p><h4>Theming With ButtonStyles</h4><p>One of the <strong>ButtonStyles</strong> at 1v1Me is a <strong>Pill</strong>. We have written custom initializers for frequently used <strong>backgroundColor</strong> and <strong>titleColor</strong> combinations.</p><pre>struct Pill: ButtonStyle {<br>    let backgroundColor: Color<br>    let titleColor: Color<br>    <br>    static var destructive: Pill {<br>        return Pill(backgroundColor: .red, titleColor: .white)<br>    }<br><br>    func makeBody(configuration: Configuration) -&gt; some View {<br>        configuration.label<br>            .font(.system(size: 16, weight: .bold))<br>            .padding(.horizontal, 16)<br>            .background(backgroundColor)<br>            .foregroundColor(titleColor)<br>            .frame(maxWidth: .infinity)<br>            .frame(height: 48)<br>            .clipShape(Capsule())<br>    }<br>}<br><br>Button(&quot;Press Me!&quot;, action: {<br>    print(&quot;Hello, World!&quot;)<br>})<br>.buttonStyle(Pill.destructive)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/558/1*m5usvOkfVbTedw7M7KMJwg.png" /></figure><h4>Ensure Tapability</h4><p>Not all buttons are going to have content from edge-to-edge. Our event card is a custom view inside a button with some empty areas which are not tappable by default:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/335/1*Bm3pb7qwgGSOloHPZ0rJ6w.jpeg" /><figcaption>Buttons are not tappable by default if the views do not extend all the way to the sides. Any area that is black in our event card is not tappable without additional customization.</figcaption></figure><p>To fix this we can add a content shape to our <strong>ButtonStyle</strong> to ensure that the entire button is tappable.</p><pre>struct Tappable: ButtonStyle {<br>    func makeBody(configuration: Configuration) -&gt; some View {<br>        configuration.label<br>            .contentShape(Rectangle())<br>    }<br>}</pre><h4>Adding Touch Animations &amp; Haptics To Buttons</h4><p>If you want to add more familiarity to your buttons &amp; bring a sense of touch you can add <strong>animations.</strong></p><pre>struct ScaleOnTap: ButtonStyle {<br>    func makeBody(configuration: Configuration) -&gt; some View {<br>        configuration.label<br>            .scaleEffect(configuration.isPressed ? 0.95 : 1)<br>    }<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/536/1*r2J-wEGNQ8ZEaw2x3JjjCA.gif" /></figure><h4>Adding Haptics To Buttons</h4><p><strong>Haptics</strong> are a powerful way to bring your app into the physical world.</p><p>The simplest way to add <strong>Haptics</strong> to your buttons within your <strong>ButtonStyle </strong>is to lean on the animations that you might have already set.</p><pre>struct ScaleOnTap: ButtonStyle {<br>    func makeBody(configuration: Configuration) -&gt; some View {<br>        configuration.label<br>            .scaleEffect(<br>                configuration.isPressed ? <br>                    { Global.haptics.interaction(); return 0.95 }() : 1<br>            )<br>    }<br>}</pre><p>Unfortunately, SwiftUI hasn’t made any hooks available for button taps in <strong>ButtonStyles </strong>besides <strong>simultaneousGesture </strong>which unfortunately doesn’t work when applied to the label of the <strong>Button</strong>.</p><p>Other than this shoehorn we added to get haptics in our <strong>ButtonStyles</strong>, you can go with a custom button with tap gestures to get the same result.</p><h4>Bonus Haptics Interaction Example</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/03a69d9ee2c00b2e2f29f8251f8e9af8/href">https://medium.com/media/03a69d9ee2c00b2e2f29f8251f8e9af8/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9b32e7f41c97" width="1" height="1" alt=""><hr><p><a href="https://medium.com/1v1me-blog/customizing-swiftui-buttons-with-buttonstyle-9b32e7f41c97">Customizing SwiftUI Buttons With ButtonStyle</a> was originally published in <a href="https://medium.com/1v1me-blog">1v1Me Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Make Money Playing Call of Duty Warzone]]></title>
            <link>https://medium.com/1v1me-blog/how-to-make-money-playing-call-of-duty-warzone-b7adb0cc97ee?source=rss----dabb47ee62e5---4</link>
            <guid isPermaLink="false">https://medium.com/p/b7adb0cc97ee</guid>
            <category><![CDATA[call-of-duty]]></category>
            <category><![CDATA[wagering]]></category>
            <category><![CDATA[money]]></category>
            <category><![CDATA[gambling]]></category>
            <dc:creator><![CDATA[Anthony Geranio]]></dc:creator>
            <pubDate>Mon, 11 Jul 2022 17:56:23 GMT</pubDate>
            <atom:updated>2022-07-11T18:07:25.952Z</atom:updated>
            <content:encoded><![CDATA[<p>Imagine a world where you could make money playing Call of Duty. Wouldn’t that be awesome?</p><p>Well, with <a href="https://1v1.me/warzoneblog">1v1Me</a> you can start playing your favorite video games like Call of Duty to win real cash.</p><p><strong>How Does 1v1Me Work?</strong></p><p>You use <a href="https://1v1.me/warzoneblog">1v1Me</a> to play vs someone else in Call of Duty for real money.</p><p>For example, you would play against someone else for $20 in a Warzone Kill Race and whoever wins, gets paid $20 immediately.</p><p><strong>How Do I Get Started with 1v1Me?</strong></p><p>Using <a href="https://1v1.me/warzoneblog">1v1Me</a> is simple:</p><ol><li>Download <a href="https://1v1.me/warzoneblog">1v1Me</a></li><li>Create an account</li><li>Join the Call of Duty Warzone community</li><li>Find a match to accept or post your own and find an opponent instantly</li><li>Whoever wins, gets paid</li></ol><p><strong>How Does 1v1Me Stop Cheaters?</strong></p><p>We require anyone who plays on our platform to stream their match to Twitch. If there are issues during the match we freeze the funds immediately, review the footage and ban bad actors accordingly.</p><p><a href="https://1v1.me/warzoneblog">1v1Me</a> has a 4.5+ Star Rating on the App Store and a very positive customer sentiment within the gaming community.</p><p><strong>Are there Fees on 1v1Me?</strong></p><p>There are <strong>no fees </strong>to play on <a href="https://1v1.me/warzoneblog">1v1Me</a>.</p><p><strong>Is there Live Support on 1v1Me?</strong></p><p>We have free 24/7 Live Support on <a href="https://1v1.me/warzoneblog">1v1Me</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b7adb0cc97ee" width="1" height="1" alt=""><hr><p><a href="https://medium.com/1v1me-blog/how-to-make-money-playing-call-of-duty-warzone-b7adb0cc97ee">How to Make Money Playing Call of Duty Warzone</a> was originally published in <a href="https://medium.com/1v1me-blog">1v1Me Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Make Money Playing Madden]]></title>
            <link>https://medium.com/1v1me-blog/how-to-make-money-playing-madden-29aebe47e957?source=rss----dabb47ee62e5---4</link>
            <guid isPermaLink="false">https://medium.com/p/29aebe47e957</guid>
            <category><![CDATA[money]]></category>
            <category><![CDATA[gambling]]></category>
            <category><![CDATA[video-games-industry]]></category>
            <category><![CDATA[madden]]></category>
            <category><![CDATA[wagering]]></category>
            <dc:creator><![CDATA[Anthony Geranio]]></dc:creator>
            <pubDate>Mon, 11 Jul 2022 17:53:22 GMT</pubDate>
            <atom:updated>2022-07-11T18:08:10.861Z</atom:updated>
            <content:encoded><![CDATA[<p>Imagine a world where you could make money playing Madden. Wouldn’t that be awesome?</p><p>Well, with <a href="https://1v1.me/maddenblog">1v1Me</a> you can start playing your favorite video games like Madden to win real cash.</p><p><strong>How Does 1v1Me Work?</strong></p><p>You use <a href="https://1v1.me/maddenblog">1v1Me</a> to play 1v1 vs someone else in Madden for real money either using Ultimate or Regular Teams.</p><p>For example, you would play against someone else for $20 in Ultimate Team and whoever wins, gets paid $20 immediately.</p><p><strong>How Do I Get Started with 1v1Me?</strong></p><p>Using <a href="https://1v1.me/maddenblog">1v1Me</a> is simple:</p><ol><li>Download <a href="https://1v1.me/maddenblog">1v1Me</a></li><li>Create an account</li><li>Join the Madden community</li><li>Find a match to accept or post your own and find an opponent instantly</li><li>Whoever wins, gets paid</li></ol><p><strong>How Does 1v1Me Stop Cheaters?</strong></p><p>We require anyone who plays on our platform to stream their match to Twitch. If there are issues during the match we freeze the funds immediately, review the footage and ban bad actors accordingly.</p><p><a href="https://1v1.me/maddenblog">1v1Me</a> has a 4.5+ Star Rating on the App Store and a very positive customer sentiment within the gaming community.</p><p><strong>Are there Fees on 1v1Me?</strong></p><p>There are <strong>no fees </strong>to play on <a href="https://1v1.me/maddenblog">1v1Me</a>.</p><p><strong>Is there Live Support on 1v1Me?</strong></p><p>We have free 24/7 Live Support on <a href="https://1v1.me/maddenblog">1v1Me</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=29aebe47e957" width="1" height="1" alt=""><hr><p><a href="https://medium.com/1v1me-blog/how-to-make-money-playing-madden-29aebe47e957">How to Make Money Playing Madden</a> was originally published in <a href="https://medium.com/1v1me-blog">1v1Me Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Make Money Playing FIFA]]></title>
            <link>https://medium.com/1v1me-blog/how-to-make-money-playing-fifa-365d4e29fb70?source=rss----dabb47ee62e5---4</link>
            <guid isPermaLink="false">https://medium.com/p/365d4e29fb70</guid>
            <category><![CDATA[wagering]]></category>
            <category><![CDATA[fifa]]></category>
            <category><![CDATA[gambling]]></category>
            <category><![CDATA[video-games-industry]]></category>
            <category><![CDATA[money]]></category>
            <dc:creator><![CDATA[Anthony Geranio]]></dc:creator>
            <pubDate>Mon, 11 Jul 2022 17:52:01 GMT</pubDate>
            <atom:updated>2022-07-11T18:06:59.951Z</atom:updated>
            <content:encoded><![CDATA[<p>Imagine a world where you could make money playing FIFA. Wouldn’t that be awesome?</p><p>Well, with <a href="https://1v1.me/fifablog">1v1Me</a> you can start playing your favorite video games like FIFA to win real cash.</p><p><strong>How Does It Work?</strong></p><p>You use <a href="https://1v1.me/fifablog">1v1Me</a> to play 1v1 vs someone else in FIFA for real money either using Ultimate or Regular Teams.</p><p>For example, you would play against someone else for $20 in Ultimate Team and whoever wins, gets paid $20 immediately.</p><p><strong>How Do I Get Started with 1v1Me?</strong></p><p>Using <a href="https://1v1.me/fifablog">1v1Me</a> is simple:</p><ol><li>Download <a href="https://1v1.me/fifablog">1v1Me</a></li><li>Create an account</li><li>Join the FIFA community</li><li>Find a match to accept or post your own and find an opponent instantly</li><li>Whoever wins, gets paid</li></ol><p><strong>How Does 1v1Me Stop Cheaters?</strong></p><p>We require anyone who plays on our platform to stream their match to Twitch. If there are issues during the match we freeze the funds immediately, review the footage and ban bad actors accordingly.</p><p><a href="https://1v1.me/fifablog">1v1Me</a> has a 4.5+ Star Rating on the App Store and a very positive customer sentiment within the gaming community.</p><p><strong>Are there Fees on 1v1Me?</strong></p><p>There are <strong>no fees </strong>to play on <a href="https://1v1.me/fifablog">1v1Me</a>.</p><p><strong>Is there Live Support on 1v1Me?</strong></p><p>We have free 24/7 Live Support on <a href="https://1v1.me/fifablog">1v1Me</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=365d4e29fb70" width="1" height="1" alt=""><hr><p><a href="https://medium.com/1v1me-blog/how-to-make-money-playing-fifa-365d4e29fb70">How to Make Money Playing FIFA</a> was originally published in <a href="https://medium.com/1v1me-blog">1v1Me Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building 1v1Me’s Video Feed On iOS]]></title>
            <link>https://medium.com/1v1me-blog/building-1vmes-video-feed-on-ios-74706cfa739?source=rss----dabb47ee62e5---4</link>
            <guid isPermaLink="false">https://medium.com/p/74706cfa739</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[uikit]]></category>
            <category><![CDATA[gaming]]></category>
            <category><![CDATA[swift]]></category>
            <dc:creator><![CDATA[Quinton Pryce]]></dc:creator>
            <pubDate>Fri, 08 Jul 2022 03:57:15 GMT</pubDate>
            <atom:updated>2022-07-08T04:07:15.854Z</atom:updated>
            <content:encoded><![CDATA[<p>Every major social media app is doing it.</p><ul><li>TikTok’s Feed</li><li>Instagram’s Reels</li><li>Facebook’s Videos</li><li>YouTube’s Shorts</li></ul><p>This full-screen page style is everywhere, but Apple has not made implementing it very easy.</p><figure><img alt="1v1Me Clips uses this UI pattern to show videos in landscape &amp; portrait mode." src="https://cdn-images-1.medium.com/max/320/1*qaal_oIsN6uOxsDXGBJsuQ.gif" /><figcaption>1v1Me Clips uses this UI pattern to show videos in landscape &amp; portrait mode.</figcaption></figure><p>This guide will walk you through how to build this full-screen TikTok-style UI pattern into your app for both landscape and portrait mode. You can view the <a href="https://github.com/1v1Me/FullScreenCollectionViewController/tree/main">full example here</a>.</p><h3>The Layout</h3><p>1. Set cell spacing to 0.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/60ba4b7494fbc6b4ccacaec3e1660109/href">https://medium.com/media/60ba4b7494fbc6b4ccacaec3e1660109/href</a></iframe><p>2. Set the preRotationFirstIndexPath.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/42a21267df4e7b0ef9207b1a71d5282e/href">https://medium.com/media/42a21267df4e7b0ef9207b1a71d5282e/href</a></iframe><p>3. Set the target content offset point during rotation. This prevents other cells from showing while the phone is rotating.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/aa16ec0ebee7110f884d7c0929bab43b/href">https://medium.com/media/aa16ec0ebee7110f884d7c0929bab43b/href</a></iframe><p>4. After the rotation, double-check that the cell we landed on is the cell that was shown before the rotation started.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/07513ce0f4e121f9499d4962e989387d/href">https://medium.com/media/07513ce0f4e121f9499d4962e989387d/href</a></iframe><p>5. After letting go of a scroll gesture we need to calculate what offset point (collection view cell) to snap to using the proposedContentOffset and the velocity.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/750e65d6132b2334256a2e58def1efd0/href">https://medium.com/media/750e65d6132b2334256a2e58def1efd0/href</a></iframe><p><a href="https://github.com/1v1Me/FullScreenCollectionViewController/blob/main/FullScreenSwiping/FullPageCollectionViewFlowLayout.swift">Putting it all together</a> gives us a flow layout that powers a full-screen swipeable collection view. A complex but robust solution.</p><h3>The View Controller</h3><p>The base view controller is very simple.</p><p>It is responsible for setting up the collection view:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c30d4f85b3b2d931ff0a330248b82296/href">https://medium.com/media/c30d4f85b3b2d931ff0a330248b82296/href</a></iframe><p>&amp; for setting the layout’s indexPathForCellInFrameBeforeBoundsChange:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/17e6d86283571809a348169c49739d09/href">https://medium.com/media/17e6d86283571809a348169c49739d09/href</a></iframe><p>There we have it. A layout that handles which cell to show after a swipe gesture &amp; after a phone rotation, and a simple view controller to house it.</p><p>Extending the view controller we described here is easy as shown in the <a href="https://github.com/1v1Me/FullScreenCollectionViewController">full example</a> to allow you to use this UI pattern across your different views.</p><h3>Props To Innovation, But Could You Share It?</h3><p>Apple has done an impressive job laying out foundational UI patterns for iOS Developers to easily implement. Even with <a href="https://www.google.com/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=&amp;cad=rja&amp;uact=8&amp;ved=2ahUKEwjQrMim1-f4AhW1GzQIHaPrCzsQFnoECA0QAw&amp;url=https%3A%2F%2Fwww.apple.com%2Fca%2Fapp-store%2F&amp;usg=AOvVaw314p_wHzTPXBBnIXe5CENX">nearly two million apps</a> on the App Store, there are a leading few who pave new, non-native roads through the landscape. And although ingenuity &amp; creativity should be praised, it makes app-building more difficult for small teams due to the user’s custom-UI expectations from the top few apps.</p><p>My Grandma wrote me a note with three pieces of advice. One of them was <strong>“Get involved in your community”</strong>. No matter who you are, what you do, or what level you are, you’re experience is vital to your communities heartbeat and continued growth.</p><p>If you solve an interesting problem, try to share it. Any bit helps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OqCbrwcLQp3itxGX-0_9yg.jpeg" /><figcaption>This is the note she gave me many years ago. Embrace Optimism, Get involved in your community, Enjoy this moment.</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=74706cfa739" width="1" height="1" alt=""><hr><p><a href="https://medium.com/1v1me-blog/building-1vmes-video-feed-on-ios-74706cfa739">Building 1v1Me’s Video Feed On iOS</a> was originally published in <a href="https://medium.com/1v1me-blog">1v1Me Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Xcode Cloud With Firebase]]></title>
            <link>https://medium.com/1v1me-blog/using-xcode-cloud-with-firebase-3bc66e7094bb?source=rss----dabb47ee62e5---4</link>
            <guid isPermaLink="false">https://medium.com/p/3bc66e7094bb</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[xcode]]></category>
            <category><![CDATA[xcode-cloud]]></category>
            <category><![CDATA[swift]]></category>
            <dc:creator><![CDATA[Quinton Pryce]]></dc:creator>
            <pubDate>Wed, 15 Jun 2022 18:25:49 GMT</pubDate>
            <atom:updated>2022-06-15T01:34:51.898Z</atom:updated>
            <content:encoded><![CDATA[<p>Do you know what’s the worst? A long intro.</p><h3>Xcode Cloud Initial Setup</h3><p>Apple did a lovely job of <a href="https://developer.apple.com/documentation/xcode/configuring-your-first-xcode-cloud-workflow">documenting the initial setup here</a>.</p><p><em>I won’t dive into any setup details, but if you struggle at all with weird errors popping up, first ensure your Xcode &amp; Mac OS are on the newest versions.</em></p><h3>Customizing Workflows</h3><p>Hats off to the iOS Dev Ops out there, but I couldn’t be happier to delete fastlane &amp; move to <em>the cloud</em>.</p><h4>My setup</h4><p>I now have two Workflows:</p><ol><li>a<strong> debug</strong> build using <strong>Firebase’s App Distribution</strong>.</li><li>a <strong>release</strong> build using <strong>TestFlight</strong>.</li></ol><h4>My additional needs</h4><ol><li>Upload a build to Firebase.</li><li>Upload dsyms to Firebase’s Crashlytics.</li><li>Tag the build version on git.</li></ol><p><em>Adding these additional features requires </em><a href="https://developer.apple.com/documentation/xcode/writing-custom-build-scripts"><em>writing custom build scripts</em></a><em>.</em></p><h4>Uploading a build to Firebase</h4><ol><li><a href="https://firebase.google.com/docs/cli#install_the_firebase_cli">Download the Firebase CLI script</a> &amp; zip it inside your <em>ci_scripts </em>folder. <br><em>Read over the </em><a href="https://firebase.google.com/docs/app-distribution/ios/distribute-cli"><em>Firebase CLI Script doc</em></a><em> if you’re unsure how to use it.</em></li><li>Execute the upload in ci_post_xcodebuild.sh.</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6cd84e9ad45d3f21407bc1de30abc447/href">https://medium.com/media/6cd84e9ad45d3f21407bc1de30abc447/href</a></iframe><h4>Uploading dsyms to Firebase</h4><ol><li>Find and copy your <a href="https://firebase.google.com/docs/crashlytics/get-deobfuscated-reports?platform=ios">upload-symbols</a> script in your Crashlytics framework.</li><li>Execute the upload in ci_post_xcodebuild.sh.</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e233b8e399e196d533c031f6e437c191/href">https://medium.com/media/e233b8e399e196d533c031f6e437c191/href</a></iframe><h4>Create a git tag of the distributed version</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/da82b0d6abdc7537511ef4b47b27e8f8/href">https://medium.com/media/da82b0d6abdc7537511ef4b47b27e8f8/href</a></iframe><p>Mic. Drop.</p><p><em>Often I tend around the bush, rather than beating straight through it. I have taken my personal Dev Ops nightmare, of learning how to customize Xcode Cloud as an opportunity to tersely document the intricacies of a Firebase configuration.</em></p><p><em>If in this article you missed the personal story, inside jokes, gifs, &amp; LinkedIn plug, I’d invite you to look at any of Medium’s other blogs.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3bc66e7094bb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/1v1me-blog/using-xcode-cloud-with-firebase-3bc66e7094bb">Using Xcode Cloud With Firebase</a> was originally published in <a href="https://medium.com/1v1me-blog">1v1Me Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>