Rowena  Waters

Rowena Waters

1661956149

Notificationz: Helping You Own NotificationCenter in Swift!

Notificationz 📡

Helping you own NotificationCenter 

Highlights

Keep Your Naming Conventions:
This library gives you convenient access to NotificationCenter, but it's up to you to set it up the way you like!

Nothing to Hide:
Not trying to hide NotificationCenter functionality. Just an attempt to provide a more convenient API

Full and Simple Testing:
Testing this library was simple, since it only forwards calls to NotificationCenter for the most part. Mocking that object allowed tests to reach 100% coverage.

Features

You can try them in the playground shipped with the framework!

Use your own naming convention to wrap NotificationCenter

let nsCenter = NotificationCenter.default
let 📡 = NotificationCenterAdapter(notificationCenter: nsCenter)
📡.post(.💃)

// my personal preference, define this in Globals.swift
let NC = NotificationCenterAdapter(notificationCenter: nsCenter)
// Now, you can use `NC` throughout the app

Four simple keywords to remember

let obj = Object()
NC.add(obj, selector: #selector(Object.call))   // normal add observer
NC.observe { notification in }                  // observe using blocks
NC.post(.tenhut)                                // post a notification
NC.remove(obj)                                  // remove from nsCenter

Transparent and convenient API

let keys = ["observe", "many", "keys"].map { Notification.Name($0) }
NC.observe(keys) { _ in }       // observe on the same thread
NC.observeUI(keys) { _ in }     // delivered to the main thread

NC.post(.test)
NC.post(.test, userInfo: ["info":5])
NC.post(Notification(name: .test, object: nil))

RAII-based observers

class Dummy {

    // declare the observer as optional
    var broadcastObserver: Observer?

    init() {
        // assign it anywhere you like
        broadcastObserver = NC.observe { [unowned self] _ in
            self.doSomething()
        }.execute() // this is a neat bonus feature
    }

    func doSomething() {
        // exectued twice, since we call "execute" manually
        print("it works!")
    }
}

var dummy: Dummy? = Dummy()
NC.post(.test)  // calls doSomething
dummy = nil     // clean up is automatic
NC.post(.test)  // doesn't crash!

Getting Started

Carthage

Carthage is fully supported. Simply add the following line to your Cartfile:

github "SwiftKitz/Notificationz"

Cocoapods

Cocoapods is fully supported. Simply add the following line to your Podfile:

pod 'Notificationz'

Submodule

For manual installation, you can grab the source directly or through git submodules, then simply:

  • Drop the Notificationz.xcodeproj file as a subproject (make sure Copy resources is not enabled)
  • Navigate to your root project settings. Under "Embedded Binaries", click the "+" button and select the Notificationz.framework

Motivation

After migrating to Swift, the NotificationCenter APIs really stood out in the code. Writing so much boiler plate all over the place just to register, handle, and cleanup notifications. Coming from C++, RAII seemed a pretty invaluable pattern to be applied here.

With this framework, one can easily declare all their observers as properties:

class Sample {
    private var keyboardObserver: Observer?
    private var reachabilityObserver: Observer?
}

Other programmers should be pleased with this consistency! Moreover, there is no need to worry handling notifications in some other function somewhere nor do cleanup in deinit. It just works:

keyboardObserver = NC.observeUI(UIKeyboardWillShowNotification) { [unowned self] _ in
    // you can write your handler code here, maybe call another function
}

// you can force cleanup by setting the property to nil, but don't have to
keyboardObserver = nil

Download Details:

Author: SwiftKitz
Source code: https://github.com/SwiftKitz/Notificationz

License: MIT license
#swift 

What is GEEK

Buddha Community

Notificationz: Helping You Own NotificationCenter in Swift!
Houston  Sipes

Houston Sipes

1600430400

10 Free Online Resources To Learn Swift Language

Swift is a fast and efficient general-purpose programming language that provides real-time feedback and can be seamlessly incorporated into existing Objective-C code. This is why developers are able to write safer, more reliable code while saving time. It aims to be the best language that can be used for various purposes ranging from systems programming to mobile as well as desktop apps and scaling up to cloud services.

Below here, we list down the 10 best online resources to learn Swift language.

(The list is in no particular order)

#developers corner #free online resources to learn swift language #learn swift #learn swift free #learn swift online free #resources to learn swift #swift language #swift programming

Adele Hansley

Adele Hansley

1620970963

Swift Assignment Help Australia | Online Swift Assignment Service

Swift is a new programming language introduced for iOS and OS X mobile app improvement by Apple. This program without a doubt adopts the excellent of C and objective C without leaving the constraints of C-language. Quick is used to jot down packages, and iOS is the working device on which those applications run.
Functions of Swift in Computer programming:
Open source: Swift Assignment Help explains it is an open supply programming language that is without difficulty accessible and is low priced for those who’re trying to step within the platform of iOS development. Swift is already to be had inside Linux and projects are taken to carry it to windows.
Take much less time to market with clean coding strategies: With the usage of swift, the work may be achieved within the stipulated time frame and will let you utilize special programs to bring together the app at a reduced time.
Least mistakes prone: Because that is a practical program, it helps capabilities within the form of variables. It generates popular codes that can be efficient enough to do extremely good matters along with the discount of repetitions in addition to efforts.
Clean Renovation: Protection has been the maximum vital concept now not simplest for beginners. However also for the leading mobile agencies, it may deal with the functions and is safer than goal C.
Price-Powerful: If you are seeking out an iOS app developer to expand local apps, then, rapid can be your remaining choice. Considering swift comes with blended codes then it can shop the employer money.
A Couple of Faceted Language: Quick is taken into consideration to be a more than one faceted program that enables the iOS app developers to broaden all types of apps starting from commonly used company apps to the brand-new low strength apple watch apps.
Preliminary App Sizes may be Trimmed Down by Way of the Use of Dynamic Libraries: With the aid of the use of rapid, you could immediately upload to the memory using trimming down the preliminary app length which increases the final product overall performance.
Modern: It includes the pleasant capabilities of all the present languages and special ambitions to help the developers for cellular app development which is modern and interactive. It’s taken into consideration to be the high usability programming language within the future and might clear up nearly all applications while programming.
Use Contemporary Studies: It takes the tremendous capabilities of all the prevailing languages and contains them.
Excessive Ability: The clean usability of the language enables even a median developer to expand apps for iOS and also, restore issues with minimum attempt.
Use Easy Grammar and Syntax: Swift Assignment Help Service in Australia mentions that the programming language fast can be part of all the keywords and there is no need for the programmer to give up the codes using a semicolon. The grammar and syntax used are a lot less difficult than in different programming languages. The experts of Assignment help online in Australia will help the student to complete their work.

#swift assignment help #swift assignment help service in australia #assignment help online in australia #assignment help service

Top Swift Development Companies | Top Swift Developers - TopDevelopers.co

A thoroughly researched list of top Swift developers with ratings & reviews to help find the best Swift development companies around the world.

#swift development service providers #best swift development companies #top swift development companies #swift development solutions #top swift developers #swift

Hire Dedicated Swift Developers

Want to create a native iOS application for your Startup?

Hire Dedicated Swift Developers for end-to-end services like development, migration, upgrade, testing, and support & maintenance. Trust HourlyDeveloper.io our Swift development team for iOS device apps that are high on performance and security.

Consult with experts:- https://bit.ly/2C5M6cz

#hire dedicated swift developers #swift developers #swift development company #swift development services #swift development #swift

Best Swift App Development Company

Hire an Exceptional Swift App Developer from Mobile App Development India. Maadi has a dedicated Swift App Development team that is superiorly talented and builds highly functional, cost-effective mobile apps with error-free coding.

Contact: https://www.mobile-app-development-india.com/swift-app-development/

#swift ios app development india #hire swift programmer india #swift ios development #apple swift app development #swift mobile app development #swift app development